cpp: Respect decrypt flags in new functions
* lang/cpp/src/context.cpp: Respect directly provided flags in the new decrypt functions. -- Overlooked in the initial commit. Also fixed the according unused variable warnings.
This commit is contained in:
parent
5493164f86
commit
18b7906078
@ -915,7 +915,7 @@ DecryptionResult Context::decrypt(const Data &cipherText, Data &plainText, const
|
|||||||
d->lastop = Private::Decrypt;
|
d->lastop = Private::Decrypt;
|
||||||
const Data::Private *const cdp = cipherText.impl();
|
const Data::Private *const cdp = cipherText.impl();
|
||||||
Data::Private *const pdp = plainText.impl();
|
Data::Private *const pdp = plainText.impl();
|
||||||
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags), cdp ? cdp->data : 0, pdp ? pdp->data : 0);
|
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags), cdp ? cdp->data : 0, pdp ? pdp->data : 0);
|
||||||
return DecryptionResult(d->ctx, Error(d->lasterr));
|
return DecryptionResult(d->ctx, Error(d->lasterr));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,7 +929,7 @@ Error Context::startDecryption(const Data &cipherText, Data &plainText, const De
|
|||||||
d->lastop = Private::Decrypt;
|
d->lastop = Private::Decrypt;
|
||||||
const Data::Private *const cdp = cipherText.impl();
|
const Data::Private *const cdp = cipherText.impl();
|
||||||
Data::Private *const pdp = plainText.impl();
|
Data::Private *const pdp = plainText.impl();
|
||||||
return Error(d->lasterr = gpgme_op_decrypt_ext_start(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags),
|
return Error(d->lasterr = gpgme_op_decrypt_ext_start(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags),
|
||||||
cdp ? cdp->data : 0, pdp ? pdp->data : 0));
|
cdp ? cdp->data : 0, pdp ? pdp->data : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -995,7 +995,7 @@ std::pair<DecryptionResult, VerificationResult> Context::decryptAndVerify(const
|
|||||||
d->lastop = Private::DecryptAndVerify;
|
d->lastop = Private::DecryptAndVerify;
|
||||||
const Data::Private *const cdp = cipherText.impl();
|
const Data::Private *const cdp = cipherText.impl();
|
||||||
Data::Private *const pdp = plainText.impl();
|
Data::Private *const pdp = plainText.impl();
|
||||||
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | DecryptVerify),
|
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify),
|
||||||
cdp ? cdp->data : 0, pdp ? pdp->data : 0);
|
cdp ? cdp->data : 0, pdp ? pdp->data : 0);
|
||||||
return std::make_pair(DecryptionResult(d->ctx, Error(d->lasterr)),
|
return std::make_pair(DecryptionResult(d->ctx, Error(d->lasterr)),
|
||||||
VerificationResult(d->ctx, Error(d->lasterr)));
|
VerificationResult(d->ctx, Error(d->lasterr)));
|
||||||
@ -1011,7 +1011,7 @@ Error Context::startCombinedDecryptionAndVerification(const Data &cipherText, Da
|
|||||||
d->lastop = Private::DecryptAndVerify;
|
d->lastop = Private::DecryptAndVerify;
|
||||||
const Data::Private *const cdp = cipherText.impl();
|
const Data::Private *const cdp = cipherText.impl();
|
||||||
Data::Private *const pdp = plainText.impl();
|
Data::Private *const pdp = plainText.impl();
|
||||||
return Error(d->lasterr = gpgme_op_decrypt_ext_start(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | DecryptVerify), cdp ? cdp->data : 0, pdp ? pdp->data : 0));
|
return Error(d->lasterr = gpgme_op_decrypt_ext_start(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify), cdp ? cdp->data : 0, pdp ? pdp->data : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
Error Context::startCombinedDecryptionAndVerification(const Data &cipherText, Data &plainText)
|
Error Context::startCombinedDecryptionAndVerification(const Data &cipherText, Data &plainText)
|
||||||
|
Loading…
Reference in New Issue
Block a user