Skip to content

Commit

Permalink
Corrected multiple Yubikey bugs
Browse files Browse the repository at this point in the history
* Fixed database not showing modified after failed save
* Fixed Yubikey not being redetected after replug
* Fixed single shot challenge resulting in failed saves
  • Loading branch information
droidmonkey committed Sep 17, 2017
1 parent 422bc4d commit c9b7ba6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/gui/DatabaseTabWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ bool DatabaseTabWidget::saveDatabase(Database* db)
emit messageDismissTab();
return true;
} else {
dbStruct.modified = true;
updateTabName(db);
emit messageTab(tr("Writing the database failed.").append("\n").append(errorMessage),
MessageWidget::Error);
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/keys/YkChallengeResponseKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ QByteArray YkChallengeResponseKey::rawKey() const
*/
bool YkChallengeResponseKey::challenge(const QByteArray& challenge)
{
return this->challenge(challenge, 1);
return this->challenge(challenge, 2);
}

bool YkChallengeResponseKey::challenge(const QByteArray& challenge, unsigned retries)
Expand All @@ -70,8 +70,8 @@ bool YkChallengeResponseKey::challenge(const QByteArray& challenge, unsigned ret

QEventLoop loop;
QFutureWatcher<YubiKey::ChallengeResult> watcher;
watcher.setFuture(future);
connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
watcher.setFuture(future);
loop.exec();

if (m_blocking) {
Expand Down
2 changes: 1 addition & 1 deletion src/keys/drivers/YubiKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ YubiKey::ChallengeResult YubiKey::challenge(int slot, bool mayBlock, const QByte
QByteArray paddedChallenge = challenge;

// ensure that YubiKey::init() succeeded
if (m_yk == NULL) {
if (!init()) {
m_mutex.unlock();
return ERROR;
}
Expand Down

0 comments on commit c9b7ba6

Please sign in to comment.