aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/decryptionresult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src/decryptionresult.cpp')
-rw-r--r--lang/cpp/src/decryptionresult.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lang/cpp/src/decryptionresult.cpp b/lang/cpp/src/decryptionresult.cpp
index 17524db9..ea0a8a5c 100644
--- a/lang/cpp/src/decryptionresult.cpp
+++ b/lang/cpp/src/decryptionresult.cpp
@@ -51,6 +51,9 @@ public:
if (res.file_name) {
res.file_name = strdup(res.file_name);
}
+ if (res.symkey_algo) {
+ res.symkey_algo = strdup(res.symkey_algo);
+ }
//FIXME: copying gpgme_recipient_t objects invalidates the keyid member,
//thus we use _keyid for now (internal API)
for (gpgme_recipient_t r = res.recipients ; r ; r = r->next) {
@@ -68,6 +71,10 @@ public:
std::free(res.file_name);
}
res.file_name = 0;
+ if (res.symkey_algo) {
+ std::free(res.symkey_algo);
+ }
+ res.symkey_algo = 0;
}
_gpgme_op_decrypt_result res;
@@ -165,6 +172,11 @@ const char *GpgME::DecryptionResult::symkeyAlgo() const
return d ? d->res.symkey_algo : nullptr;
}
+bool GpgME::DecryptionResult::isLegacyCipherNoMDC() const
+{
+ return d && d->res.legacy_cipher_nomdc;
+}
+
class GpgME::DecryptionResult::Recipient::Private : public _gpgme_recipient
{
public:
@@ -241,6 +253,7 @@ std::ostream &GpgME::operator<<(std::ostream &os, const DecryptionResult &result
<< "\n unsupportedAlgorithm: " << protect(result.unsupportedAlgorithm())
<< "\n isWrongKeyUsage: " << result.isWrongKeyUsage()
<< "\n isDeVs " << result.isDeVs()
+ << "\n legacyCipherNoMDC " << result.isLegacyCipherNoMDC()
<< "\n symkeyAlgo: " << protect(result.symkeyAlgo())
<< "\n recipients:\n";
const std::vector<DecryptionResult::Recipient> recipients = result.recipients();