-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I am currently using PyCryptoki 2.5.23
I have an IV that the HSM randomly generates. I call other functions such as a mechanism. It eventually funnels down to to_byte_array().
Works great most of the time. It seems about 1 out 500,000 calls to the HSM I get some random byte string such as b'UvG;H&,TGi*2' which doesn't meet any of checks for a byte string. It thus tries the value as a Hex String val = int(val, 16) which it isn't and then a ValueError exception is thrown. On the current master branch this is occurring on line 305.
I added in my usage a check if all the values are Hex and if they are then I say val = int(val, 16) otherwise I assume it is a standard bytestring like in this check 'if "\x" in repr(val):'
Just wanted to let you know about this low rate exception issue I have seen.