mirror of https://github.com/keeweb/keeweb.git
challenge-response calculation function
This commit is contained in:
parent
d8e49d993a
commit
8c386dbe57
|
@ -192,17 +192,26 @@ const YubiKey = {
|
|||
},
|
||||
|
||||
getOtp(serial, entry, callback) {
|
||||
if (this.process) {
|
||||
return callback('Already in progress');
|
||||
}
|
||||
this.aborted = false;
|
||||
|
||||
return Launcher.spawn({
|
||||
cmd: 'ykman',
|
||||
args: ['-d', serial, 'oath', 'code', '--single', entry],
|
||||
noStdOutLogging: true,
|
||||
complete: (err, stdout) => {
|
||||
this.process = null;
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
const otp = stdout.trim();
|
||||
callback(null, otp);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
calculateChalResp(serial, slot, challenge, callback) {
|
||||
return Launcher.spawn({
|
||||
cmd: 'ykman',
|
||||
args: ['-d', serial, 'otp', 'calculate', slot, challenge],
|
||||
noStdOutLogging: true,
|
||||
complete: (err, stdout) => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue