diff options
author | Erich Eckner <git@eckner.net> | 2024-11-03 17:19:54 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2024-11-03 17:19:54 +0100 |
commit | 55f1535ade21a4f313ef39fd403025e1bc0f5178 (patch) | |
tree | ef4ca9fc1bf97a9df7e06de9c1d973cdf5abf120 /verify.py | |
download | ykverify-55f1535ade21a4f313ef39fd403025e1bc0f5178.tar.xz |
static, but works
Diffstat (limited to 'verify.py')
-rwxr-xr-x | verify.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/verify.py b/verify.py new file mode 100755 index 0000000..d410f67 --- /dev/null +++ b/verify.py @@ -0,0 +1,20 @@ +#!/bin/python + +import binascii +import codecs +import hashlib +import hmac +import subprocess +import sys + +ssh = b'840fedcacdb9e86f1ae1e6a0060de471d4f5fb35' +ss = codecs.decode(ssh, 'hex') + +actual = subprocess.check_output(['ykchalresp', '-2', 'deadbeef']).strip().decode() + +expected = hmac.new(ss, b'deadbeef', hashlib.sha1).hexdigest() + +if actual == expected: + sys.exit(0) +else + sys.exit(1) |