Home GnuPG
Diffusion GnuPG beb79f2705ad

sm: Use gpg_err_code() instead of -1

Description

sm: Use gpg_err_code() instead of -1

* sm/verify.c (gpgsm_verify): use gpg_err_code instead of 'rc == -1'
comparison.

In ed6ebb696e (sm: Implement initial support for keyboxd., 2020-09-10),
the return of keydb_search() was changed to use gpg_err_code(). Adjust
gpgsm_verify() to use it. This provides a nicer error message to users
when a certificate is not found -- the same error that is seen from 2.2.

Prior to this change, when a cert was not found, gpgsm output:

gpgsm: failed to find the certificate: Not found

as opposed to the more human-readable message from 2.2:

gpgsm: certificate not found

They now return the same message.

  • Signed-off-by: Todd Zullinger <tmz@pobox.com>

Details

Provenance
tmzullingerAuthored on Nov 26 2021, 9:35 AM
wernerCommitted on Apr 25 2022, 12:09 PM
Parents
rGca5d5142c6d6: Deprecate the --supervised options.
Branches
Unknown
Tags
Unknown