Are there cases where gpg --verify will exit 0, even if verification failed?

Sandeep Murthy s.murthy at mykolab.com
Wed Jan 14 14:22:45 CET 2015


>> Are there cases where gpg --verify will exit 0, even if verification failed?

Verification could fail internally within the gpg program, or externally because
the signature fie does not exist or is incorrectly named or maybe corrupt
e.g.

[srm@~]$ gpg --verify asig.sig; echo $?
gpg: can't open `asig.sig': No such file or directory
gpg: verify signatures failed: No such file or directory
2

Exit codes in shells indicate problems relating to completion or disruption
of the child process invoked by a parent process.

They will not record unsuccessful events inside the child process
related to program functions, i.e. if you inside gpg editing a key
and enter an incorrect subcommand or use it incorrectly then this will
not affect the exit code, I don’t think.

Sandeep Murthy
s.murthy at mykolab.com

> On 14 Jan 2015, at 07:51, Dave Pawson <dave.pawson at gmail.com> wrote:
> 
> In Unix terms, a program that has run successfully to completion
> exits with status zero, no 'extra' semantic attached?
> 
> Dave
> 
> On 13 January 2015 at 19:03, Patrick Schleizer
> <patrick-mailinglists at whonix.org> wrote:
>> In another thread...
>> 
>> Werner Koch
>>> On Mon, 12 Jan 2015 19:52, patrick-
>>>> When it exits 0, then this approach is sound, sane and fine?
>>> You better check the status lines; in particular watch out for
>>> 
>>>  [GNUPG:] VALIDSIG E4B868C8F90C.....
>>> 
>>> or use gpgv.
>> 
>> Are there cases where gpg --verify will exit 0, even if verification failed?
>> 
>> (Suppose one uses a separate --homedir where only legitimate signing
>> keys are imported.)
>> 
>> 
>> _______________________________________________
>> Gnupg-users mailing list
>> Gnupg-users at gnupg.org
>> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 
> 
> 
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 873 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: </pipermail/attachments/20150114/1b6b111e/attachment.sig>


More information about the Gnupg-users mailing list