Skip to content

Commit

Permalink
Revert some changes to fix auth multiple cards
Browse files Browse the repository at this point in the history
WE2-575

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma authored and mrts committed Oct 11, 2021
1 parent cf4b145 commit 591494c
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions src/ui/webeiddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,25 +188,35 @@ void WebEidDialog::onMultipleCertificatesReady(
ui->selectCertificateOriginLabel->setText(fromPunycode(origin));
setupCertificateAndPinInfo(certificateAndPinInfos);

if (CertificateButton* button =
qobject_cast<CertificateButton*>(ui->selectionGroup->checkedButton())) {

switch (currentCommand) {
case CommandType::GET_SIGNING_CERTIFICATE:
setupOK([this, button] { emit accepted(button->certificateInfo()); });
ui->pageStack->setCurrentIndex(int(Page::SELECT_CERTIFICATE));
break;
case CommandType::AUTHENTICATE:
switch (currentCommand) {
case CommandType::GET_SIGNING_CERTIFICATE:
setupOK([this] {
if (CertificateButton* button =
qobject_cast<CertificateButton*>(ui->selectionGroup->checkedButton())) {

emit accepted(button->certificateInfo());
} else {
emit failure(QStringLiteral("CertificateButton not found"));
}
});
ui->pageStack->setCurrentIndex(int(Page::SELECT_CERTIFICATE));
break;
case CommandType::AUTHENTICATE:
setupOK([this, origin] {
// Authenticate continues with the selected certificate to onSingleCertificateReady().
onSingleCertificateReady(origin, button->certificateInfo());
break;
default:
emit failure(QStringLiteral("Command %1 not allowed here")
.arg(std::string(currentCommand).c_str()));
return;
}
} else {
emit failure(QStringLiteral("CertificateButton not found"));
if (CertificateButton* button =
qobject_cast<CertificateButton*>(ui->selectionGroup->checkedButton())) {

onSingleCertificateReady(origin, button->certificateInfo());
} else {
emit failure(QStringLiteral("CertificateButton not found"));
}
});
ui->pageStack->setCurrentIndex(int(Page::SELECT_CERTIFICATE));
break;
default:
emit failure(
QStringLiteral("Command %1 not allowed here").arg(std::string(currentCommand).c_str()));
}
}

Expand Down

0 comments on commit 591494c

Please sign in to comment.