1
0
mirror of https://github.com/Yubico/yubikey-ksm.git synced 2025-01-31 16:52:12 +01:00

Don't use PDO rowCount. Issue #2.

This commit is contained in:
Simon Josefsson 2010-09-14 19:05:22 +00:00
parent ffe6234b3d
commit 950530219b
2 changed files with 10 additions and 6 deletions

4
NEWS
View File

@ -1,5 +1,9 @@
* Version 1.4 unreleased
* Don't use PDO rowCount, it is not portable.
Issue #2 reported by arte42.ripe, see:
http://code.google.com/p/yubikey-ksm/issues/detail?id=2>.
* Fixed perl warning in ykksm-gen-keys.
Issue #3 reported by toddejohnson, see:
http://code.google.com/p/yubikey-ksm/issues/detail?id=3>.

View File

@ -1,7 +1,7 @@
<?php
# Written by Simon Josefsson <simon@josefsson.org>.
# Copyright (c) 2009 Yubico AB
# Copyright (c) 2009, 2010 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -64,15 +64,15 @@ if (!$result) {
die("ERR Database error\n");
}
if ($result->rowCount() != 1) {
syslog(LOG_INFO, "Unknown yubikey: " . $otp);
die("ERR Unknown yubikey\n");
}
$row = $result->fetch(PDO::FETCH_ASSOC);
$aeskey = $row['aeskey'];
$internalname = $row['internalname'];
if (!$aeskey) {
syslog(LOG_INFO, "Unknown yubikey: " . $otp);
die("ERR Unknown yubikey\n");
}
$ciphertext = modhex2hex($modhex_ciphertext);
$plaintext = aes128ecb_decrypt($aeskey, $ciphertext);