diff options
author | info@vircon.nl <info@vircon.nl@fbcee277-3294-991b-8290-beb7048acdd6> | 2011-03-24 11:15:15 +0000 |
---|---|---|
committer | info@vircon.nl <info@vircon.nl@fbcee277-3294-991b-8290-beb7048acdd6> | 2011-03-24 11:15:15 +0000 |
commit | 8f4396e2fe24b18ae85eda5fd5b5c2327fb8bddf (patch) | |
tree | eed8907dc86ab09151aa61f9f25c10b6146a03e9 | |
parent | 3.0 Release, added MySQL support, various fixes. (diff) | |
download | yubico-yubiserve-8f4396e2fe24b18ae85eda5fd5b5c2327fb8bddf.tar.gz yubico-yubiserve-8f4396e2fe24b18ae85eda5fd5b5c2327fb8bddf.tar.bz2 yubico-yubiserve-8f4396e2fe24b18ae85eda5fd5b5c2327fb8bddf.zip |
Version 3.1: 24/03/2011
+ Fixed issue #3, #4, #5, #6
git-svn-id: http://yubico-yubiserve.googlecode.com/svn/trunk@38 fbcee277-3294-991b-8290-beb7048acdd6
-rw-r--r-- | README | 2 | ||||
-rwxr-xr-x | dbconf.py | 10 |
2 files changed, 7 insertions, 5 deletions
@@ -4,6 +4,8 @@ Version 1.0: 21/05/2010 Version 2.0: 19/11/2010 Version 2.9: 13/12/2010 Version 3.0: 14/12/2010 +Version 3.1: 24/03/2011 ++ Fixed issue #3, #4, #5, #6 == Description == This simple service allows to authenticate Yubikeys and OATH Tokens using @@ -123,7 +123,7 @@ else: if ((len(argv[2])<=16) and (len(argv[3]) <= 16) and (len(argv[4]) <= 12) and (len(argv[5])<=32)): cur.execute("SELECT * FROM yubikeys WHERE nickname = '" + argv[2] + "' OR publicname = '" + argv[3] + "'") if (cur.rowcount == 0): - cur.execute("INSERT INTO yubikeys VALUES ('" + argv[2] + "', '" + argv[3] + "', '" + time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + "', '" + argv[4] + "', '" + argv[5] + "', 'true', 1, 1)") + cur.execute("INSERT INTO yubikeys VALUES ('" + argv[2] + "', '" + argv[3] + "', '" + time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + "', '" + argv[4] + "', '" + argv[5] + "', 1, 1, 1)") con.commit() print "Key '" + argv[2] + "' added to database." else: @@ -133,13 +133,13 @@ else: print 'Secretid must be 12 characters max, aeskey must be 32 characters max.\n' quit() elif (argv[1][2] == 'l'): - cur.execute('SELECT nickname, publicname FROM yubikeys') + cur.execute('SELECT nickname, publicname, active FROM yubikeys') if cur.rowcount != 0: print " " + str(cur.rowcount) + " keys into database:" print '[Nickname]\t\t>> [PublicID]' for i in range(0, cur.rowcount): - (nickname, publicname) = cur.fetchone() - print ' ' + nickname + ' ' * (23-len(nickname)) + ">> " + publicname + (nickname, publicname, active) = cur.fetchone() + print ' ' + nickname + ' ' * (23-len(nickname)) + ">> " + publicname + ' ' * (21-len(publicname)) + ">> " + active print '' else: print 'No keys in database\n' @@ -187,7 +187,7 @@ else: if (len(argv[2])<=16) and (len(argv[3]) <= 16) and (len(argv[4]) <= 40): cur.execute("SELECT * FROM oathtokens WHERE nickname = '" + argv[2] + "' OR publicname = '" + argv[3] + "'") if (cur.rowcount == 0): - cur.execute("INSERT INTO oathtokens VALUES ('" + nickname + "', '" + argv[3] + "', '" + time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + "', '" + argv[4] + "', 'true', 1)") + cur.execute("INSERT INTO oathtokens VALUES ('" + nickname + "', '" + argv[3] + "', '" + time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + "', '" + argv[4] + "', 1, 1)") con.commit() print "Key '" + argv[2] + "' added to database." else: |