1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-01-20 10:52:15 +01:00

Use -1 in yk_counter etc. to indicate yubikey discovered in protocol

This commit is contained in:
Olov Danielson 2010-01-25 14:55:05 +00:00
parent 03bcd4b2e8
commit 888a372f64

View File

@ -80,8 +80,16 @@ $sync->addField('otp', $syncParams['otp']);
# Verify correctness of input parameters
#
foreach (array('modified', 'yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param) {
if (preg_match("/^[0-9]*$/", $syncParams[$param])==0) {
foreach (array('modified') as $param) {
if (preg_match("/^[0-9]+$/", $syncParams[$param])==0) {
$myLog->log(LOG_NOTICE, 'Input parameters ' . $param . ' not correct');
sendResp(S_MISSING_PARAMETER, $apiKey);
exit;
}
}
foreach (array('yk_counter', 'yk_use', 'yk_high', 'yk_low') as $param) {
if (preg_match("/^(-1|[0-9]+)$/", $syncParams[$param])==0) {
$myLog->log(LOG_NOTICE, 'Input parameters ' . $param . ' not correct');
sendResp(S_MISSING_PARAMETER, $apiKey);
exit;