Fix gpg output parsing #40
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use «foreach» instead of «while» to traverse the GnuPG output array, otherwise the topic variable never gets initialized, and the «while» continuously evaluates the array in boolean context and we get into infinite loops.
With GnuPG the infinite loop currently never triggers because it does not output anything on stdout. But with the Sequoia GnuPG Chameleon it outputs the original contents being verified (which is a divergence that should probably be fixed upstream).
Force the output to stdout instead of stderr so that we can parse it, and update the parser to match on current output lines. Although ideally the parser should be switched to try to use one of the machine parseable outputs such as --with-colons, otherwise there is no guarantee this will not change again in the future, but this is the simplest minimal change.