2017-03-07 11:10:22 +03:00
|
|
|
import QtQuick 2.5
|
|
|
|
import io.thp.pyotherside 1.4
|
2018-01-15 12:28:02 +03:00
|
|
|
import "utils.js" as Utils
|
2017-01-27 15:55:38 +03:00
|
|
|
|
|
|
|
// @disable-check M300
|
|
|
|
Python {
|
|
|
|
id: py
|
|
|
|
|
2018-02-07 17:18:53 +03:00
|
|
|
property bool yubikeyModuleLoaded: false
|
2017-12-01 14:25:04 +03:00
|
|
|
property bool yubikeyReady: false
|
2017-01-27 15:55:38 +03:00
|
|
|
property var queue: []
|
2019-09-09 15:12:58 +03:00
|
|
|
|
|
|
|
property var availableDevices: []
|
|
|
|
property var availableReaders: []
|
|
|
|
|
|
|
|
property var currentDevice
|
|
|
|
property bool currentDeviceValidated
|
|
|
|
|
2018-02-07 20:24:51 +03:00
|
|
|
signal enableLogging(string logLevel, string logFile)
|
2018-02-14 17:09:00 +03:00
|
|
|
signal disableLogging
|
2017-01-27 15:55:38 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
// Timestamp in seconds for when it's time for the
|
|
|
|
// next calculateAll call. -1 means never
|
|
|
|
property int nextCalculateAll: -1
|
|
|
|
|
2017-01-27 15:55:38 +03:00
|
|
|
Component.onCompleted: {
|
2018-02-01 18:53:36 +03:00
|
|
|
importModule('site', function () {
|
|
|
|
call('site.addsitedir', [appDir + '/pymodules'], function () {
|
|
|
|
addImportPath(urlPrefix + '/py')
|
2018-02-07 17:18:53 +03:00
|
|
|
importModule('yubikey', function () {
|
|
|
|
yubikeyModuleLoaded = true
|
|
|
|
})
|
|
|
|
})
|
2018-02-02 16:05:21 +03:00
|
|
|
})
|
|
|
|
}
|
2017-02-09 14:45:04 +03:00
|
|
|
|
2017-12-01 14:25:04 +03:00
|
|
|
onEnableLogging: {
|
2019-09-09 15:12:58 +03:00
|
|
|
doCall('yubikey.init_with_logging',
|
|
|
|
[logLevel || 'DEBUG', logFile || null], function () {
|
|
|
|
yubikeyReady = true
|
|
|
|
})
|
2018-01-31 15:53:50 +03:00
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
|
2018-01-31 15:53:50 +03:00
|
|
|
onDisableLogging: {
|
2019-09-09 15:12:58 +03:00
|
|
|
doCall('yubikey.init', [], function () {
|
2018-02-02 16:32:14 +03:00
|
|
|
yubikeyReady = true
|
|
|
|
})
|
2018-01-31 15:53:50 +03:00
|
|
|
}
|
2018-02-07 17:18:53 +03:00
|
|
|
|
|
|
|
onYubikeyModuleLoadedChanged: runQueue()
|
2018-02-07 18:42:07 +03:00
|
|
|
onYubikeyReadyChanged: runQueue()
|
2018-01-31 15:53:50 +03:00
|
|
|
|
2018-02-07 17:18:53 +03:00
|
|
|
function isPythonReady(funcName) {
|
2019-09-09 15:12:58 +03:00
|
|
|
if (funcName.startsWith("yubikey.init")) {
|
2018-02-07 17:18:53 +03:00
|
|
|
return yubikeyModuleLoaded
|
2018-01-31 15:53:50 +03:00
|
|
|
} else {
|
|
|
|
return yubikeyReady
|
2018-01-31 15:48:28 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function runQueue() {
|
|
|
|
var oldQueue = queue
|
|
|
|
queue = []
|
|
|
|
for (var i in oldQueue) {
|
2019-09-09 15:12:58 +03:00
|
|
|
doCall(oldQueue[i][0], oldQueue[i][1], oldQueue[i][2])
|
2017-12-01 14:25:04 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function doCall(func, args, cb) {
|
2018-02-07 17:18:53 +03:00
|
|
|
if (!isPythonReady(func)) {
|
2017-01-27 15:55:38 +03:00
|
|
|
queue.push([func, args, cb])
|
|
|
|
} else {
|
2017-02-01 18:51:02 +03:00
|
|
|
call(func, args.map(JSON.stringify), function (json) {
|
2017-01-27 15:55:38 +03:00
|
|
|
if (cb) {
|
2017-11-07 12:34:42 +03:00
|
|
|
try {
|
|
|
|
cb(json ? JSON.parse(json) : undefined)
|
2018-01-15 11:43:02 +03:00
|
|
|
} catch (err) {
|
2017-11-07 12:34:42 +03:00
|
|
|
console.log(err, json)
|
|
|
|
}
|
2017-01-27 15:55:38 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function isNEO(device) {
|
|
|
|
return device.name === 'YubiKey NEO'
|
2017-01-30 16:59:58 +03:00
|
|
|
}
|
2017-01-27 15:55:38 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function isYubiKeyEdge(device) {
|
|
|
|
return device.name === 'YubiKey Edge'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKey4(device) {
|
|
|
|
return device.name === 'YubiKey 4'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isSecurityKeyNfc(device) {
|
|
|
|
return device.name === 'Security Key NFC'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isSecurityKeyByYubico(device) {
|
|
|
|
return device.name === 'Security Key by Yubico'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isFidoU2fSecurityKey(device) {
|
|
|
|
return device.name === 'FIDO U2F Security Key'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKeyStandard(device) {
|
|
|
|
return device.name === 'YubiKey Standard'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKeyPreview(device) {
|
|
|
|
return device.name === 'YubiKey Preview'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKey5NFC(device) {
|
|
|
|
return device.name === 'YubiKey 5 NFC'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKey5Nano(device) {
|
|
|
|
return device.name === 'YubiKey 5 Nano'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKey5C(device) {
|
|
|
|
return device.name === 'YubiKey 5C'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKey5CNano(device) {
|
|
|
|
return device.name === 'YubiKey 5C Nano'
|
|
|
|
}
|
|
|
|
|
2020-03-16 13:24:45 +03:00
|
|
|
function isYubiKey5CNFC(device) {
|
|
|
|
return device.name === 'YubiKey 5C NFC'
|
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function isYubiKey5A(device) {
|
|
|
|
return device.name === 'YubiKey 5A'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKey5Ci(device) {
|
|
|
|
return device.name === 'YubiKey 5Ci'
|
|
|
|
}
|
|
|
|
|
|
|
|
function isYubiKey5Family(device) {
|
|
|
|
return device.name.startsWith('YubiKey 5')
|
|
|
|
}
|
|
|
|
|
2019-09-09 16:36:29 +03:00
|
|
|
function isYubiKeyFIPS(device) {
|
|
|
|
return device.name === 'YubiKey FIPS'
|
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function getYubiKeyImageSource(currentDevice) {
|
|
|
|
if (isYubiKey4(currentDevice)) {
|
|
|
|
return "../images/yk4series.png"
|
|
|
|
}
|
|
|
|
if (isYubiKeyEdge(currentDevice)) {
|
|
|
|
return "../images/ykedge.png"
|
|
|
|
}
|
|
|
|
if (isSecurityKeyNfc(currentDevice)) {
|
|
|
|
return "../images/sky3.png"
|
|
|
|
}
|
|
|
|
if (isSecurityKeyByYubico(currentDevice)) {
|
|
|
|
return "../images/sky2.png"
|
|
|
|
}
|
|
|
|
if (isFidoU2fSecurityKey(currentDevice)) {
|
|
|
|
return "../images/sky1.png"
|
2017-02-23 12:40:24 +03:00
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
if (isNEO(currentDevice)) {
|
|
|
|
return "../images/neo.png"
|
|
|
|
}
|
|
|
|
if (isYubiKeyStandard(currentDevice)) {
|
|
|
|
return "../images/standard.png"
|
|
|
|
}
|
|
|
|
if (isYubiKeyPreview(currentDevice)) {
|
|
|
|
return "../images/yk5nfc.png"
|
|
|
|
}
|
|
|
|
if (isYubiKey5NFC(currentDevice)) {
|
|
|
|
return "../images/yk5nfc.png"
|
|
|
|
}
|
|
|
|
if (isYubiKey5Nano(currentDevice)) {
|
|
|
|
return "../images/yk5nano.png"
|
|
|
|
}
|
|
|
|
if (isYubiKey5C(currentDevice)) {
|
|
|
|
return "../images/yk5c.png"
|
|
|
|
}
|
|
|
|
if (isYubiKey5CNano(currentDevice)) {
|
|
|
|
return "../images/yk5cnano.png"
|
|
|
|
}
|
2020-03-16 13:24:45 +03:00
|
|
|
if (isYubiKey5CNFC(currentDevice)) {
|
|
|
|
return "../images/yk5cnfc.png"
|
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
if (isYubiKey5A(currentDevice)) {
|
|
|
|
return "../images/yk4.png"
|
|
|
|
}
|
|
|
|
if (isYubiKey5Ci(currentDevice)) {
|
|
|
|
return "../images/yk5ci.png"
|
|
|
|
}
|
|
|
|
if (isYubiKey5Family(currentDevice)) {
|
|
|
|
return "../images/yk5series.png"
|
|
|
|
}
|
|
|
|
return "../images/yk5series.png" //default for now
|
2017-02-23 12:40:24 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function getCurrentDeviceImage() {
|
|
|
|
if (!!currentDevice) {
|
|
|
|
return getYubiKeyImageSource(currentDevice)
|
|
|
|
} else {
|
|
|
|
return ""
|
2017-02-23 12:40:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
|
|
|
|
function checkDescriptors(cb) {
|
|
|
|
doCall('yubikey.controller.check_descriptors', [], cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkReaders(filter, cb) {
|
|
|
|
doCall('yubikey.controller.check_readers', [filter], cb)
|
2017-03-01 13:57:40 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function clearCurrentDeviceAndEntries() {
|
|
|
|
currentDevice = null
|
|
|
|
entries.clear()
|
|
|
|
nextCalculateAll = -1
|
2019-09-25 10:22:25 +03:00
|
|
|
currentDeviceValidated = false
|
2019-09-09 15:12:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function refreshReaders() {
|
|
|
|
yubiKey.getConnectedReaders(function(resp) {
|
|
|
|
if (resp.success) {
|
|
|
|
availableReaders = resp.readers
|
2017-11-07 12:34:42 +03:00
|
|
|
} else {
|
2019-09-09 15:12:58 +03:00
|
|
|
console.log("failed to update readers:", resp.error_id)
|
2017-03-01 13:57:40 +03:00
|
|
|
}
|
2017-02-28 17:07:43 +03:00
|
|
|
})
|
2017-02-01 18:27:45 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function refreshDevicesDefault() {
|
|
|
|
poller.running = false
|
|
|
|
let customReaderName = settings.useCustomReader ? settings.customReaderName : null
|
|
|
|
refreshDevices(settings.otpMode, customReaderName, function (resp) {
|
|
|
|
if (resp.success) {
|
|
|
|
availableDevices = resp.devices
|
|
|
|
// no current device, or current device is no longer available, pick a new one
|
|
|
|
if (!currentDevice || !availableDevices.some(dev => dev.serial === currentDevice.serial)) {
|
2019-10-09 14:07:47 +03:00
|
|
|
// new device is being loaded, clear any old device
|
|
|
|
clearCurrentDeviceAndEntries()
|
2019-09-09 15:12:58 +03:00
|
|
|
if (availableDevices.some(dev => dev.selectable)) {
|
|
|
|
// pick the first selectable device
|
|
|
|
currentDevice = resp.devices.find(dev => dev.selectable)
|
|
|
|
calculateAll(navigator.goToCredentialsIfNotInSettings)
|
|
|
|
} else {
|
2019-10-09 14:07:47 +03:00
|
|
|
// no selectable device (will land in no Insert YubiKey view)
|
2019-09-09 15:12:58 +03:00
|
|
|
navigator.goToCredentialsIfNotInSettings()
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// the same one but potentially updated
|
|
|
|
currentDevice = resp.devices.find(dev => dev.serial === currentDevice.serial)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
console.log("refreshing devices failed:", resp.error_id)
|
|
|
|
availableDevices = []
|
|
|
|
availableReaders = []
|
|
|
|
clearCurrentDeviceAndEntries()
|
|
|
|
navigator.goToCredentialsIfNotInSettings()
|
|
|
|
}
|
|
|
|
poller.running = true
|
|
|
|
})
|
2017-02-10 16:01:49 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function poll() {
|
|
|
|
|
|
|
|
function callback(resp) {
|
|
|
|
if (resp.success) {
|
|
|
|
if (resp.needToRefresh) {
|
|
|
|
refreshDevicesDefault()
|
|
|
|
}
|
|
|
|
if (timeToCalculateAll() && !!currentDevice
|
|
|
|
&& currentDeviceValidated) {
|
|
|
|
calculateAll()
|
2017-07-05 11:15:57 +03:00
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
} else {
|
|
|
|
console.log("check descriptors failed:", resp.error_id)
|
|
|
|
clearCurrentDeviceAndEntries()
|
2017-07-05 11:15:57 +03:00
|
|
|
}
|
2017-01-31 11:57:44 +03:00
|
|
|
}
|
2017-11-29 00:20:20 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
if (settings.useCustomReader && !settings.otpMode) {
|
|
|
|
checkReaders(settings.customReaderName, callback)
|
|
|
|
} else {
|
|
|
|
checkDescriptors(callback)
|
|
|
|
}
|
2017-01-31 11:57:44 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
if (!settings.otpMode) {
|
|
|
|
refreshReaders()
|
|
|
|
}
|
2017-11-29 15:18:47 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function calculateAll(cb) {
|
2019-09-25 10:22:25 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function callback(resp) {
|
2019-09-25 10:22:25 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
if (resp.success) {
|
2019-09-25 10:22:25 +03:00
|
|
|
entries.updateEntries(resp.entries, function() {
|
|
|
|
updateNextCalculateAll()
|
|
|
|
currentDeviceValidated = true
|
|
|
|
if (cb) {
|
|
|
|
cb()
|
|
|
|
}
|
|
|
|
})
|
2019-09-09 15:12:58 +03:00
|
|
|
} else {
|
|
|
|
if (resp.error_id === 'access_denied') {
|
|
|
|
entries.clear()
|
|
|
|
currentDevice.hasPassword = true
|
|
|
|
currentDeviceValidated = false
|
|
|
|
navigator.goToEnterPasswordIfNotInSettings()
|
|
|
|
} else {
|
|
|
|
clearCurrentDeviceAndEntries()
|
|
|
|
console.log("calculateAll failed:", resp.error_id)
|
|
|
|
refreshDevicesDefault()
|
|
|
|
}
|
2017-02-03 15:58:22 +03:00
|
|
|
}
|
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
|
|
|
|
if (settings.otpMode) {
|
|
|
|
otpCalculateAll(callback)
|
|
|
|
} else {
|
|
|
|
ccidCalculateAll(callback)
|
|
|
|
}
|
2017-02-03 15:58:22 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function updateNextCalculateAll() {
|
|
|
|
// Next calculateAll should be when a default TOTP cred expires.
|
|
|
|
for (var i = 0; i < entries.count; i++) {
|
|
|
|
var entry = entries.get(i)
|
|
|
|
if (entry.code && entry.credential.period === 30) {
|
|
|
|
// Just use the first default one
|
|
|
|
nextCalculateAll = entry.code.valid_to
|
|
|
|
return
|
2017-02-03 15:58:22 +03:00
|
|
|
}
|
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
// No default TOTP cred found, don't set a time for nextCalculateAll
|
|
|
|
nextCalculateAll = -1
|
2017-02-03 15:58:22 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function timeToCalculateAll() {
|
|
|
|
return nextCalculateAll !== -1 && nextCalculateAll <= Utils.getNow()
|
2018-01-15 11:27:14 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function supportsTouchCredentials() {
|
|
|
|
return !!currentDevice && !!currentDevice.version && parseInt(
|
|
|
|
currentDevice.version.split('.').join("")) >= 426
|
2017-03-13 16:51:14 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function supportsOathSha512() {
|
|
|
|
return !!currentDevice && !!currentDevice.version && parseInt(
|
|
|
|
currentDevice.version.split('.').join("")) >= 431
|
2019-09-09 16:36:29 +03:00
|
|
|
&& !isYubiKeyFIPS(currentDevice)
|
2019-09-09 15:12:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function scanQr(toastIfError) {
|
2019-11-05 18:43:17 +03:00
|
|
|
currentCredentialCard = null
|
2019-09-09 15:12:58 +03:00
|
|
|
navigator.goToLoading()
|
|
|
|
parseQr(ScreenShot.capture(), function (resp) {
|
|
|
|
if (resp.success) {
|
|
|
|
navigator.goToNewCredentialAuto(resp)
|
|
|
|
} else {
|
|
|
|
if (toastIfError) {
|
|
|
|
navigator.snackBarError(navigator.getErrorMessage(
|
|
|
|
resp.error_id))
|
2017-02-28 15:20:44 +03:00
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
navigator.goToNewCredentialManual()
|
2017-02-28 15:20:44 +03:00
|
|
|
}
|
2019-09-09 15:12:58 +03:00
|
|
|
})
|
2017-03-01 13:57:40 +03:00
|
|
|
}
|
2017-02-28 15:20:44 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function ccidCalculateAll(cb) {
|
2017-02-07 16:17:54 +03:00
|
|
|
var now = Math.floor(Date.now() / 1000)
|
2019-09-09 15:12:58 +03:00
|
|
|
doCall('yubikey.controller.ccid_calculate_all', [now], cb)
|
2017-02-07 16:17:54 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function otpCalculateAll(cb) {
|
|
|
|
var now = Utils.getNow()
|
|
|
|
doCall('yubikey.controller.otp_calculate_all',
|
|
|
|
[settings.slot1digits, settings.slot2digits, now], cb)
|
2017-02-23 15:51:44 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function refreshDevices(otpMode, customReader, cb) {
|
|
|
|
doCall('yubikey.controller.refresh_devices', [otpMode, customReader], cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
function selectCurrentSerial(serial, cb) {
|
|
|
|
doCall('yubikey.controller.select_current_serial', [serial], cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
function calculate(credential, cb) {
|
|
|
|
var margin = credential.touch ? 10 : 0
|
|
|
|
var nowAndMargin = Utils.getNow() + margin
|
|
|
|
doCall('yubikey.controller.ccid_calculate',
|
|
|
|
[credential, nowAndMargin], cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
function otpCalculate(credential, cb) {
|
|
|
|
var margin = credential.touch ? 10 : 0
|
|
|
|
var nowAndMargin = Utils.getNow() + margin
|
|
|
|
var slot = (credential.key === "Slot 1") ? 1 : 2
|
|
|
|
var digits = (slot === 1) ? settings.slot1digits : settings.slot2digits
|
|
|
|
doCall('yubikey.controller.otp_calculate',
|
|
|
|
[slot, digits, credential, nowAndMargin], cb)
|
2017-02-07 16:17:54 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function otpDeleteCredential(credential, cb) {
|
|
|
|
var slot = (credential.key === "Slot 1") ? 1 : 2
|
|
|
|
doCall('yubikey.controller.otp_delete_credential', [slot], cb)
|
2017-02-03 14:24:41 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function otpAddCredential(slot, key, touch, cb) {
|
|
|
|
doCall('yubikey.controller.otp_add_credential', [slot, key, touch], cb)
|
2017-02-27 16:13:54 +03:00
|
|
|
}
|
|
|
|
|
2019-09-18 11:48:42 +03:00
|
|
|
function ccidAddCredential(name, key, issuer, oathType, algo, digits, period, touch, overwrite, cb) {
|
2019-09-09 15:12:58 +03:00
|
|
|
doCall('yubikey.controller.ccid_add_credential',
|
2019-09-18 11:48:42 +03:00
|
|
|
[name, key, issuer, oathType, algo, digits, period, touch, overwrite], cb)
|
2017-01-27 15:55:38 +03:00
|
|
|
}
|
2017-02-14 15:12:24 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function deleteCredential(credential, cb) {
|
|
|
|
doCall('yubikey.controller.ccid_delete_credential', [credential], cb)
|
2017-02-23 18:00:17 +03:00
|
|
|
}
|
|
|
|
|
2017-02-16 16:14:14 +03:00
|
|
|
function parseQr(screenShots, cb) {
|
2019-09-09 15:12:58 +03:00
|
|
|
doCall('yubikey.controller.parse_qr', [screenShots], cb)
|
2017-02-14 15:12:24 +03:00
|
|
|
}
|
2017-02-17 10:52:34 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function reset(cb) {
|
|
|
|
doCall('yubikey.controller.ccid_reset', [], cb)
|
2017-02-17 10:52:34 +03:00
|
|
|
}
|
2017-03-08 18:07:12 +03:00
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function otpSlotStatus(cb) {
|
|
|
|
doCall('yubikey.controller.otp_slot_status', [], cb)
|
2018-05-03 11:44:43 +03:00
|
|
|
}
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function setPassword(password, remember, cb) {
|
|
|
|
doCall('yubikey.controller.ccid_set_password', [password, remember], cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
function removePassword(cb) {
|
|
|
|
doCall('yubikey.controller.ccid_remove_password', [], cb)
|
|
|
|
}
|
|
|
|
|
2020-01-14 18:48:26 +03:00
|
|
|
function clearLocalPasswords(cb) {
|
|
|
|
doCall('yubikey.controller.ccid_clear_local_passwords', [], cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-09-09 15:12:58 +03:00
|
|
|
function validate(password, remember, cb) {
|
|
|
|
doCall('yubikey.controller.ccid_validate', [password, remember], cb)
|
|
|
|
}
|
|
|
|
|
|
|
|
function getConnectedReaders(cb) {
|
|
|
|
doCall('yubikey.controller.get_connected_readers', [], cb)
|
2017-03-08 18:07:12 +03:00
|
|
|
}
|
2017-01-27 15:55:38 +03:00
|
|
|
}
|