Ignore subkeys in apt-key's output
authortiger-jmw <jmw@tiger-computing.co.uk>
Wed, 5 Apr 2017 12:04:54 +0000 (13:04 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Apr 2017 12:04:54 +0000 (13:04 +0100)
commitfea38ed46825dd1aecfd613074789c75deafb6b7
tree14eb7ae942cb3c55c8f697ecb87bc0833d80ac74
parent30298508223bac5946acb2cd0c38e0899c574876
Ignore subkeys in apt-key's output

The output of `apt-key adv --list-keys --with-colons --fingerprint --fixed-list-mode` is always a `pub` line followed by one of more `fpr` lines (for subkeys, if any). This can cause the wrong pairs of `pub` and `fpr` lines to be hashed, resulting in nonsense.

The ordering `pub`, `fpr`, `pub`, `fpr` is guaranteed by `apt-key`.

Therefore, this commit clears `fpr_line` when a `pub` line is encountered, to reset the grouping. The current code ignores subkeys anyway, so this is no more bad.
lib/puppet/provider/apt_key/apt_key.rb