Home GnuPG
Diffusion GPGME 1698eec2ae3e

cpp: Return successful verification for signed but not encrypted data

Description

cpp: Return successful verification for signed but not encrypted data

* lang/cpp/src/context.cpp (Context::decrypt): Use decryptionResult().
(Context::verifyDetachedSignature, Context::verifyOpaqueSignature):
Use verificationResult().
(Context::verificationResult): Ignore "no data" error for signed but
not encrypted data.
(Context::decryptAndVerify): Use decryptionResult() and
verificationResult().

gpgme's decrypt operations set the error to GPG_ERR_NO_DATA if no
encrypted data was found. It makes sense to use this error for the
encryption result, but it doesn't make sense to use it also for the
verfication result if signed data was found.
This way using the combined decrypt-verify operations on data that
may be encrypted and/or signed doesn't produce confusing results.

Details

Provenance
ikloeckerAuthored on Feb 2 2023, 11:59 AM
Parents
rMc407728064ca: qt: Add job for extracting encrypted and signed archives
Branches
Unknown
Tags
Unknown
Tasks
T6342: GPGME/Kleopatra: Extend gpgme to use gpgtar