smartpgp-cli: set KDF-DO
This commit is contained in:
@@ -341,3 +341,10 @@ def decrypt_aes(connection, msg):
|
||||
(nres,sw1,sw2) = _raw_send_apdu(connection,"Receiving decrypted chunk",apdu)
|
||||
res = res + nres
|
||||
return (res,sw1,sw2)
|
||||
|
||||
|
||||
def put_kdf_do(connection, kdf_do):
|
||||
prefix = [0x00, 0xDA, 0x00, 0xF9]
|
||||
data = kdf_do
|
||||
apdu = assemble_with_len(prefix, data)
|
||||
_raw_send_apdu(connection,"Put KDF-DO",apdu)
|
||||
|
@@ -296,4 +296,16 @@ class CardConnectionContext:
|
||||
with open(self.output, 'w') as f:
|
||||
f.write(data)
|
||||
f.close()
|
||||
|
||||
def cmd_set_kdf(self):
|
||||
if self.input is None:
|
||||
print "No input KDF-DO"
|
||||
return
|
||||
f = open(self.input, 'r')
|
||||
kdf_do = f.read()
|
||||
kdf_do = [ord(c) for c in kdf_do]
|
||||
f.close()
|
||||
self.connect()
|
||||
self.verify_admin_pin()
|
||||
put_kdf_do(self.connection, kdf_do)
|
||||
|
||||
|
Reference in New Issue
Block a user