cpp: Pass ThrowKeyIds and EncryptWrap flags to GpgME

* lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert
ThrowKeyIds and EncryptWrap to corresponding gpgme encrypt flags.
(operator<<): Add flags to debug stream.
--

GnuPG-bug-id: 6359
This commit is contained in:
Ingo Klöcker 2023-01-26 11:52:28 +01:00
parent 64da77620a
commit 70aaf05a6a
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9

View File

@ -1335,6 +1335,12 @@ static gpgme_encrypt_flags_t encryptflags2encryptflags(Context::EncryptionFlags
if (flags & Context::Symmetric) {
result |= GPGME_ENCRYPT_SYMMETRIC;
}
if (flags & Context::ThrowKeyIds) {
result |= GPGME_ENCRYPT_THROW_KEYIDS;
}
if (flags & Context::EncryptWrap) {
result |= GPGME_ENCRYPT_WRAP;
}
return static_cast<gpgme_encrypt_flags_t>(result);
}
@ -1909,6 +1915,8 @@ std::ostream &operator<<(std::ostream &os, Context::EncryptionFlags flags)
CHECK(ExpectSign);
CHECK(NoCompress);
CHECK(Symmetric);
CHECK(ThrowKeyIds);
CHECK(EncryptWrap);
#undef CHECK
return os << ')';
}