You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamas Cservenak (Jira)" <ji...@apache.org> on 2024/09/23 14:52:00 UTC
[jira] [Commented] (MGPG-99) Passcode byte array provided to gpg executable on stdin is not terminated
[ https://issues.apache.org/jira/browse/MGPG-99?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17883904#comment-17883904 ]
Tamas Cservenak commented on MGPG-99:
-------------------------------------
I know this issue is closed, but possible would like to know following:
* OS
* Java
* env (anything specific)
* Maven version
> Passcode byte array provided to gpg executable on stdin is not terminated
> -------------------------------------------------------------------------
>
> Key: MGPG-99
> URL: https://issues.apache.org/jira/browse/MGPG-99
> Project: Maven GPG Plugin
> Issue Type: Bug
> Affects Versions: 3.1.0
> Reporter: Niels Bertram
> Assignee: Tamas Cservenak
> Priority: Minor
> Fix For: 3.2.0
>
> Attachments: image-2023-08-15-10-40-10-637.png
>
>
> We ran into a strange issue using the maven-gpg-plugin with gnu gpg 2.3.7.
> The 2.x versions of gpg prefer to take the passcode for the signing key via stdin and the maven-gpg-plugin does setup the signing process accordingly with the `--passphrase-fd 0` [argument|https://github.com/apache/maven-gpg-plugin/blob/master/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java#L102] provided to the command process.
> On [Line 106|https://github.com/apache/maven-gpg-plugin/blob/master/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java#L106] the passcode is written to as bytes to the input stream that is then provided in [Line 173|https://github.com/apache/maven-gpg-plugin/blob/master/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java#L173] to the gpg process.
> Unfortunately it appears that gpg requires a `CR` or `LF` to recognise that the passcode is provided as arg 0 on stdin. In our case it does not and the process fails with following error: `gpg: signing failed: No pinentry` .
> The use of the loopback pinentry device is properly configured by the plugin but the hint for us was that the gpg executable did not know there was any input on stdin.
> After some experimentation, we found that appending a `CR` character to the passcode will trigger the stdin to provide the passcode to the program.
> This "fix" looks like this in the `settings.xml` file.
> !image-2023-08-15-10-40-10-637.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)