Fixes #22.
SC-HSM returns the result with a 0x04 prepended. This comes from OpenSC but it is not clear the exact reason. 0x04 is usually for encoding uncompressed EC points but in that case it does not seem to make sense. Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -411,7 +411,7 @@ class Device:
|
||||
|
||||
def exchange(self, keyid, pubkey):
|
||||
resp = self.send(cla=0x80, command=0x62, p1=keyid, p2=Algorithm.ALGO_EC_ECDH.value, data=pubkey.public_bytes(Encoding.X962, PublicFormat.UncompressedPoint))
|
||||
return resp
|
||||
return resp[1:]
|
||||
|
||||
def parse_cvc(self, data):
|
||||
car = CVC().decode(data).car()
|
||||
|
||||
Reference in New Issue
Block a user