Currently the random seed function _digits is not python3 compatible as it passes a unicode string to the sha1 function. It generates the following exception:
Using PC/SC reader interface
Card programming failed with an execption: ---------------------8<--------------------- Traceback (most recent call last): File "./pySim-prog.py", line 718, in <module> rc = process_card(opts, first, card_handler) File "./pySim-prog.py", line 643, in process_card cp = gen_parameters(opts) File "./pySim-prog.py", line 342, in gen_parameters iccid += _digits(opts.secret, 'ccid', ml, opts.num) File "./pySim-prog.py", line 228, in _digits s = hashlib.sha1(secret + usage + '%d' % num) TypeError: Unicode-objects must be encoded before hashing ---------------------8<---------------------
This patch fixes this problem.
Jeremy Herbert (1): make random seed function python3 compatible
pySim-prog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)