puppetlabs/puppet — pull request #701 by daniel-pittman (2012-04-23 21:55:04+00:00)
Title: Bug/2.7.x/14127 ssh auth keys fails on completely empty line

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