Fix keygen without signing capability

If no usage is provided we need to explicitly
set "cert" as usage. This only affects OpenPGP because
for S/MIME the UI forces at least one usage.

GnuPG-Bug-Id: T4373
BUG: 404795
parent 64744ca7
......@@ -1621,13 +1621,14 @@ QStringList KeyCreationPage::keyUsages() const
!is_dsa(keyType()) && !is_rsa(subkeyType())) {
usages << QStringLiteral("encrypt");
}
if (0) // not needed in pgp (implied) and not supported in cms
if (certificationAllowed()) {
usages << QStringLiteral("certify");
}
if (authenticationAllowed()) {
usages << QStringLiteral("auth");
}
if (usages.empty() && certificationAllowed()) {
/* Empty usages cause an error so we need to
* add at least certify if nothing else is selected */
usages << QStringLiteral("cert");
}
return usages;
}
......@@ -1641,13 +1642,12 @@ QStringList OverviewPage::i18nKeyUsages() const
!is_dsa(keyType()) && !is_rsa(subkeyType())) {
usages << i18n("Encrypt");
}
if (0) // not needed in pgp (implied) and not supported in cms
if (certificationAllowed()) {
usages << i18n("Certify");
}
if (authenticationAllowed()) {
usages << i18n("Authenticate");
}
if (usages.empty() && certificationAllowed()) {
usages << i18n("Certify");
}
return usages;
}
......
Markdown is supported
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