From 1f6cefea4f228e49469a7db287ee0e4aa4ad9a0b Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Tue, 21 Nov 2017 17:25:55 +0100 Subject: [PATCH] Generate codes 10s into the future for touch credentials --- qml/YubiKey.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qml/YubiKey.qml b/qml/YubiKey.qml index 4db65206..4b03d398 100644 --- a/qml/YubiKey.qml +++ b/qml/YubiKey.qml @@ -205,7 +205,8 @@ Python { function calculate(entry, copyAfterUpdate) { var now = Math.floor(Date.now() / 1000) - do_call('yubikey.controller.calculate', [entry.credential, now], + var margin = entry.credential.touch ? 10 : 0; + do_call('yubikey.controller.calculate', [entry.credential, now + margin], function (code) { updateSingleCredential(entry.credential, code, copyAfterUpdate) }) @@ -213,7 +214,8 @@ Python { function calculateSlotMode(slot, digits, copyAfterUpdate) { var now = Math.floor(Date.now() / 1000) - do_call('yubikey.controller.calculate_slot_mode', [slot, digits, now], + var margin = entry.credential.touch ? 10 : 0; + do_call('yubikey.controller.calculate_slot_mode', [slot, digits, now + margin], function (entry) { updateSingleCredential(entry.credential, entry.code, copyAfterUpdate) })