From 09667a6006986a782af98ca1de4d6521e1b8f353 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 10 Aug 2016 14:12:33 +0200 Subject: Cpp: Handle empty recipients consistently * lang/cpp/src/context.cpp (Context::getKeysFromRecipients): New helper. (Context::encrypt, Context::startEncryption, Context::signAndEncrypt) (Context::startCombinedSigningAndEncryption): Use new helper. * lang/cpp/src/context.h (Context::getKeysFromRecipients): Add as private helper. -- bf776ce was incomplete as the code to handle recpients was duplicated four times. This is now unified and constently uses a nullptr instead of an empty array. --- lang/cpp/src/context.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lang/cpp/src/context.h') diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h index 70ab079f..7d7f53a6 100644 --- a/lang/cpp/src/context.h +++ b/lang/cpp/src/context.h @@ -368,6 +368,11 @@ public: { return d; } +private: + // Helper functions that need to be context because they rely + // on the "Friendlyness" of context to access the gpgme types. + gpgme_key_t *const getKeysFromRecipients(const std::vector &recipients); + private: Private *const d; -- cgit v1.2.3