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

Allow any usages and any protocols if no restrictions were requested

GnuPG-bug-id: 5332
parent d2545463
Pipeline #52957 canceled with stage
......@@ -97,15 +97,22 @@ static const struct {
int SelectCertificateCommand::doStart()
{
d->ensureDialogCreated();
CertificateSelectionDialog::Options opts;
for (unsigned int i = 0; i < sizeof option_table / sizeof * option_table; ++i)
for (unsigned int i = 0; i < sizeof option_table / sizeof * option_table; ++i) {
if (hasOption(option_table[i].name)) {
opts |= option_table[i].option;
}
}
if (opts & CertificateSelectionDialog::AnyCertificate == 0) {
// neither sign-only nor encrypt-only => any usage
opts |= CertificateSelectionDialog::AnyCertificate;
}
if (opts & CertificateSelectionDialog::AnyFormat == 0) {
// neither openpgp-only nor x509-only => any protocol
opts |= CertificateSelectionDialog::AnyFormat;
}
d->dialog->setOptions(opts);
if (const int err = inquire("SELECTED_CERTIFICATES",
......
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