Commit f5e94b6e authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Remove unused MustNotBeSecretKey flag

... and reuse the freed value for the NeedSecretKeyData flag.

GnuPG-bug-id: 5956
parent bd71828f
Pipeline #172460 passed with stage
in 2 minutes and 32 seconds
......@@ -48,7 +48,7 @@ public:
NeedSelection = 0x0001,
OnlyOneKey = 0x0002,
NeedSecretKey = 0x0004, //< command performs secret key operations
MustNotBeSecretKey = 0x0008,
NeedSecretKeyData = 0x0008, //< command needs access to the secret key data
MustBeOpenPGP = 0x0010,
MustBeCMS = 0x0020,
......@@ -62,8 +62,6 @@ public:
MustBeTrustedRoot = 0x0400 | MustBeRoot,
MustBeUntrustedRoot = 0x0800 | MustBeRoot,
NeedSecretKeyData = 0x1000,
_AllRestrictions_Helper,
AllRestrictions = 2 * (_AllRestrictions_Helper - 1) - 1
};
......
......@@ -768,8 +768,6 @@ Command::Restrictions KeyListController::Private::calculateRestrictionsMask(cons
#endif
if (std::all_of(keys.cbegin(), keys.cend(), primaryKeyCanBeUsedForSecretKeyOperations)) {
result |= Command::NeedSecretKey;
} else if (!std::any_of(keys.cbegin(), keys.cend(), std::mem_fn(&Key::hasSecret))) {
result |= Command::MustNotBeSecretKey;
}
if (std::all_of(std::begin(keys), std::end(keys), [](const auto &k) { return k.subkey(0).isSecret() && !k.subkey(0).isCardKey(); })) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment