blob: d410f67a6710b9162f6832efc2a1e3ee68f0047d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)
|