HomePhorge

(#14127) ssh_authorized_keys grammer fails on blank lines.
b4d1c654320eUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#14127) ssh_authorized_keys grammer fails on blank lines.

The ssh_authorized_keys grammer, defined for ParsedFile, is wrong about both
comments and blank lines. Specifically, it failed in two key ways:

It failed if a comment didn't start on character one; any whitespace caused
the comment to be ignored, which is absolutely incorrect by the official
OpenSSH implementation.

It also failed because a "blank" line was defined as a line that contained one
or more whitespace characters at the start - and nothing more!

This failed in a bunch of ways, starting with assuming that a comment on a
line with leading whitespace was actually a blank line.

This change fixes both of those bugs, as well as adding appropriate tests.

(See rsa_key_allowed_in_file in auth-rsa.c for the parser, at least in the
current as of this commit version of OpenSSH. That is official enough for me
to assume that everyone will behave that way ;)

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>

Details

Event Timeline

Daniel Pittman <daniel@puppetlabs.com> committed rPUb4d1c654320e: (#14127) ssh_authorized_keys grammer fails on blank lines. (authored by Daniel Pittman <daniel@puppetlabs.com>).Apr 23 2012, 11:54 PM