mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-01-20 10:52:15 +01:00
Fix modified/nonce.
This commit is contained in:
parent
c6e7ce2ae4
commit
03bcd4b2e8
@ -136,14 +136,14 @@ class SyncLib
|
|||||||
$this->log(LOG_NOTICE, 'Discovered new identity ' . $yk_publicname);
|
$this->log(LOG_NOTICE, 'Discovered new identity ' . $yk_publicname);
|
||||||
$this->db->save('yubikeys', array('active'=>1,
|
$this->db->save('yubikeys', array('active'=>1,
|
||||||
'created'=>time(),
|
'created'=>time(),
|
||||||
'modified'=>0,
|
'modified'=>-1,
|
||||||
'yk_publicname'=>$yk_publicname,
|
'yk_publicname'=>$yk_publicname,
|
||||||
'yk_internalname'=>'not set',
|
'yk_internalname'=>'not set',
|
||||||
'yk_counter'=>-1,
|
'yk_counter'=>-1,
|
||||||
'yk_use'=>-1,
|
'yk_use'=>-1,
|
||||||
'yk_low'=>-1,
|
'yk_low'=>-1,
|
||||||
'yk_high'=>-1,
|
'yk_high'=>-1,
|
||||||
'nonce'=>'',
|
'nonce'=> md5(uniqid(rand())),
|
||||||
'notes'=>''));
|
'notes'=>''));
|
||||||
$res=$this->db->findBy('yubikeys', 'yk_publicname', $yk_publicname,1);
|
$res=$this->db->findBy('yubikeys', 'yk_publicname', $yk_publicname,1);
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ class SyncLib
|
|||||||
|
|
||||||
private function parseParamsFromMultiLineString($str)
|
private function parseParamsFromMultiLineString($str)
|
||||||
{
|
{
|
||||||
$i = preg_match("/^modified=([0-9]+)/m", $str, $out);
|
$i = preg_match("/^modified=(-1|[0-9]+)/m", $str, $out);
|
||||||
if ($i != 1) {
|
if ($i != 1) {
|
||||||
$this->log(LOG_ALERT, "cannot parse modified value: $str");
|
$this->log(LOG_ALERT, "cannot parse modified value: $str");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user