Show error message when trying to use challenge response without YubiKey

This commit is contained in:
Janek Bevendorff 2017-02-20 22:50:12 +01:00
parent c7defdc06f
commit c49aa6beef
No known key found for this signature in database
GPG Key ID: CFEC2F6850BFFA53

View File

@ -145,6 +145,13 @@ void ChangeMasterKeyWidget::generateKey()
if (m_ui->challengeResponseGroup->isChecked()) {
int i = m_ui->comboChallengeResponse->currentIndex();
i = m_ui->comboChallengeResponse->itemData(i).toInt();
if (0 == i) {
m_ui->messageWidget->showMessage(tr("Changing master key failed: no YubiKey inserted."),
MessageWidget::Error);
return;
}
YkChallengeResponseKey key(i);
m_key.addChallengeResponseKey(key);