File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1299,15 +1299,14 @@ def set_serial_number(self, serial):
1299
1299
raise TypeError ("serial must be an integer" )
1300
1300
1301
1301
hex_serial = hex (serial )[2 :]
1302
- if not isinstance (hex_serial , bytes ):
1303
- hex_serial = hex_serial .encode ("ascii" )
1302
+ hex_serial_bytes = hex_serial .encode ("ascii" )
1304
1303
1305
1304
bignum_serial = _ffi .new ("BIGNUM**" )
1306
1305
1307
1306
# BN_hex2bn stores the result in &bignum. Unless it doesn't feel like
1308
1307
# it. If bignum is still NULL after this call, then the return value
1309
1308
# is actually the result. I hope. -exarkun
1310
- small_serial = _lib .BN_hex2bn (bignum_serial , hex_serial )
1309
+ small_serial = _lib .BN_hex2bn (bignum_serial , hex_serial_bytes )
1311
1310
1312
1311
if bignum_serial [0 ] == _ffi .NULL :
1313
1312
set_result = _lib .ASN1_INTEGER_set (
You can’t perform that action at this time.
0 commit comments