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

Only allow encryption keys of current protocol in certificate selection

... instead of relying on suitable default options (which we did not
have until now).

GnuPG-bug-id: 5332
parent 34f54202
......@@ -283,7 +283,11 @@ void SignEncryptWidget::dialogRequested(CertificateLineEdit *certificateLineEdit
CertificateSelectionDialog *const dlg = new CertificateSelectionDialog(this);
dlg->setKeyFilter(std::make_shared<EncryptCertificateFilter>(mCurrentProto));
dlg->setOptions(dlg->options() | CertificateSelectionDialog::MultiSelection | CertificateSelectionDialog::IncludeGroups);
dlg->setOptions(CertificateSelectionDialog::Options(
CertificateSelectionDialog::MultiSelection |
CertificateSelectionDialog::EncryptOnly |
CertificateSelectionDialog::optionsFromProtocol(mCurrentProto) |
CertificateSelectionDialog::IncludeGroups));
if (dlg->exec()) {
const std::vector<Key> keys = dlg->selectedCertificates();
......
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