1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-01-20 01:52:15 +01:00
This commit is contained in:
Paul Chen 2008-12-11 17:53:14 +00:00
parent 43aa2029a8
commit 0d50871a72

View File

@ -72,11 +72,16 @@ if ($reqHash != $h) {
$tokenId = base64_encode(genRandRaw(6));
$secret = base64_encode(genRandRaw(16));
$a = addNewKey($tokenId, 1, $secret, '', $client);
$keyid = $sn = $a['keyid'];
if (($a=addNewKey($tokenId, 1, $secret, '', $client)) == null) {
$keyid = -1;
}
$keyid = $a['keyid'];
$sn = $a['sn'];
$usrid = $a['usrid'];
if ($keyid > 0) {
debug('Key '.$keyid.' added');
debug('Key '.$keyid.' added. sn='.$sn.', usrid='.$usrid);
reply(S_OK, $ci['secret'], $client, $nonce, $sn);
} else {
reply(S_BACKEND_ERROR, $ci['secret'], $client, $nonce);