1
0
mirror of https://github.com/Yubico/yubikey-ksm.git synced 2025-02-26 21:54:17 +01:00

Drop accessed field.

This commit is contained in:
Simon Josefsson 2009-03-18 14:53:46 +00:00
parent 348399df50
commit 521b41bde9
4 changed files with 4 additions and 16 deletions

3
TODO
View File

@ -1,3 +0,0 @@
- Do we really need the 'accessed' column? It leads to database
writes, and it seems this information could be stored on the
validation server anyway.

View File

@ -11,7 +11,6 @@ create table yubikeys (
-- timestamps:
created datetime not null,
accessed datetime,
-- the data:
internalName varchar(12) not null,
@ -34,5 +33,5 @@ create table yubikeys (
drop user ykksmreader;
create user ykksmreader;
grant select, update(accessed) on ykksm.yubikeys to 'ykksmreader'@'localhost';
grant select on ykksm.yubikeys to 'ykksmreader'@'localhost';
flush privileges;

View File

@ -92,14 +92,6 @@ if (strcmp(substr($plaintext, 0, 12), $internalName) != 0) {
die("ERR Corrupt OTP\n");;
}
$sql = "UPDATE yubikeys SET accessed = NOW() " .
"WHERE publicName = '$id'";
$result = mysql_query($sql);
if (!$result) {
syslog(LOG_ERR, "Database update error: " . mysql_error());
die("ERR Database error\n");
}
# Mask out interesting fields
$counter = substr($plaintext, 14, 2) . substr($plaintext, 12, 2);

View File

@ -117,9 +117,9 @@ die "Input not signed?" if !$signed_by;
my $dbh = DBI->connect($db, $dbuser, $dbpasswd, {'RaiseError' => 1});
my $inserth = $dbh->prepare_cached(qq{
INSERT INTO yubikeys (creator, created, accessed, serialNr,
INSERT INTO yubikeys (creator, created, serialNr,
publicName, internalName, aesKey, lockCode)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
VALUES (?, ?, ?, ?, ?, ?, ?)
});
my $now = strftime "%Y-%m-%dT%H:%M:%S", localtime;
@ -147,7 +147,7 @@ while (<GPGV>) {
$created = $now if !$created;
$accessed = "NULL" if !$accessed;
$inserth->execute($creator, $created, $accessed, $serialNr,
$inserth->execute($creator, $created, $serialNr,
$publicName, $internalName,
$aesKey, $lockCode)
or die "Database insert error: " . $dbh->errstr;