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

build up the array to sign by taking $_GET or $_POST and remove the h key

This commit is contained in:
Klas Lindfors 2012-05-16 13:45:08 +02:00
parent fb01829487
commit 2e0dbfa2c3

View File

@ -166,14 +166,16 @@ $apiKey = base64_decode($cd['secret']);
if ($h != '') {
// Create the signature using the API key
$a = array ();
$a['id'] = $client;
$a['otp'] = $otp;
// include timestamp,sl and timeout in signature if it exists
if ($timestamp) $a['timestamp'] = $timestamp;
if ($sl) $a['sl'] = $sl;
if ($timeout) $a['timeout'] = $timeout;
if ($nonce) $a['nonce'] = $nonce;
$a;
if($_GET) {
$a = $_GET;
} elseif($_POST) {
$a = $_POST;
} else {
sendRest(S_BACKEND_ERROR);
exit;
}
unset($a['h']);
$hmac = sign($a, $apiKey);
// Compare it