Exit status and failed decryption of session key
Florian Weimer
Florian.Weimer@RUS.Uni-Stuttgart.DE
13 Jun 2000 11:25:26 +0200
Werner Koch <wk@gnupg.org> writes:
> > Bug or feature? It's quite annoying if you want to find out whether
> > decryption succeed by looking at the exit status.
>
> Still in 1.0.1e ?
Yes. mainproc.c, lines 1162, 1163 read:
if( rc != G10ERR_NOT_PROCESSED )
log_error(_("Can't check signature: %s\n"), g10_errstr(rc) );
log_error() increments the error count, and g10.c:g10_exit() does the
following:
rc = rc? rc : log_get_errorcount(0)? 2 :
g10_errors_seen? 1 : 0;
I don't think this can be easily changed.
As a result, I ignore the exit status completely and rely solely on
the status fd output to decide whether decryption was successful or
not.
--
Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE
University of Stuttgart http://cert.uni-stuttgart.de/
RUS-CERT +49-711-685-5973/fax +49-711-685-5898
http://ca.uni-stuttgart.de:11371/pks/lookup?op=get&search=0xC06EC3B5