aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src/util.h
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2020-09-07 09:55:07 +0000
committerIngo Klöcker <[email protected]>2020-09-07 09:55:07 +0000
commit188cc9e9b553998d2a8ec52bd8282365e22bf400 (patch)
treec47ac66ef24dfdd647843e347f1e1f885a5cc614 /lang/cpp/src/util.h
parentcpp: Add missing keylist modes (diff)
downloadgpgme-188cc9e9b553998d2a8ec52bd8282365e22bf400.tar.gz
gpgme-188cc9e9b553998d2a8ec52bd8282365e22bf400.zip
cpp: Add keylist mode WithSecret
* lang/cpp/src/global.h (WithSecret): New. * lang/cpp/src/context.cpp (operator<<): Handle WithSecret. * lang/cpp/src/util.h (add_to_gpgme_keylist_mode_t, convert_from_gpgme_keylist_mode_t): Ditto. -- GnuPG-bug-id: 4794
Diffstat (limited to 'lang/cpp/src/util.h')
-rw-r--r--lang/cpp/src/util.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/lang/cpp/src/util.h b/lang/cpp/src/util.h
index f68724a8..e04115bf 100644
--- a/lang/cpp/src/util.h
+++ b/lang/cpp/src/util.h
@@ -84,6 +84,9 @@ static inline gpgme_keylist_mode_t add_to_gpgme_keylist_mode_t(unsigned int oldm
if (newmodes & GpgME::WithKeygrip) {
oldmode |= GPGME_KEYLIST_MODE_WITH_KEYGRIP;
}
+ if (newmodes & GpgME::WithSecret) {
+ oldmode |= GPGME_KEYLIST_MODE_WITH_SECRET;
+ }
#ifndef NDEBUG
if (newmodes & ~(GpgME::Local |
GpgME::Extern |
@@ -92,10 +95,11 @@ static inline gpgme_keylist_mode_t add_to_gpgme_keylist_mode_t(unsigned int oldm
GpgME::Validate |
GpgME::Ephemeral |
GpgME::WithTofu |
- GpgME::WithKeygrip)) {
+ GpgME::WithKeygrip |
+ GpgME::WithSecret)) {
//std::cerr << "GpgME::Context: keylist mode must be one of Local, "
//"Extern, Signatures, SignatureNotations, Validate, Ephemeral, WithTofu, "
- //"WithKeygrip, or a combination thereof!" << std::endl;
+ //"WithKeygrip, WithSecret, or a combination thereof!" << std::endl;
}
#endif
return static_cast<gpgme_keylist_mode_t>(oldmode);
@@ -116,6 +120,9 @@ static inline unsigned int convert_from_gpgme_keylist_mode_t(unsigned int mode)
if (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS) {
result |= GpgME::SignatureNotations;
}
+ if (mode & GPGME_KEYLIST_MODE_WITH_SECRET) {
+ result |= GpgME::WithSecret;
+ }
if (mode & GPGME_KEYLIST_MODE_WITH_TOFU) {
result |= GpgME::WithTofu;
}
@@ -133,6 +140,7 @@ static inline unsigned int convert_from_gpgme_keylist_mode_t(unsigned int mode)
GPGME_KEYLIST_MODE_EXTERN |
GPGME_KEYLIST_MODE_SIGS |
GPGME_KEYLIST_MODE_SIG_NOTATIONS |
+ GPGME_KEYLIST_MODE_WITH_SECRET |
GPGME_KEYLIST_MODE_WITH_TOFU |
GPGME_KEYLIST_MODE_WITH_KEYGRIP |
GPGME_KEYLIST_MODE_EPHEMERAL |