mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-02-01 01:52:18 +01:00
Add sn
This commit is contained in:
parent
43aa2029a8
commit
0d50871a72
11
addKey.php
11
addKey.php
@ -72,11 +72,16 @@ if ($reqHash != $h) {
|
|||||||
$tokenId = base64_encode(genRandRaw(6));
|
$tokenId = base64_encode(genRandRaw(6));
|
||||||
$secret = base64_encode(genRandRaw(16));
|
$secret = base64_encode(genRandRaw(16));
|
||||||
|
|
||||||
$a = addNewKey($tokenId, 1, $secret, '', $client);
|
if (($a=addNewKey($tokenId, 1, $secret, '', $client)) == null) {
|
||||||
$keyid = $sn = $a['keyid'];
|
$keyid = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$keyid = $a['keyid'];
|
||||||
|
$sn = $a['sn'];
|
||||||
|
$usrid = $a['usrid'];
|
||||||
|
|
||||||
if ($keyid > 0) {
|
if ($keyid > 0) {
|
||||||
debug('Key '.$keyid.' added');
|
debug('Key '.$keyid.' added. sn='.$sn.', usrid='.$usrid);
|
||||||
reply(S_OK, $ci['secret'], $client, $nonce, $sn);
|
reply(S_OK, $ci['secret'], $client, $nonce, $sn);
|
||||||
} else {
|
} else {
|
||||||
reply(S_BACKEND_ERROR, $ci['secret'], $client, $nonce);
|
reply(S_BACKEND_ERROR, $ci['secret'], $client, $nonce);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user