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):
12991299 raise TypeError ("serial must be an integer" )
13001300
13011301 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" )
13041303
13051304 bignum_serial = _ffi .new ("BIGNUM**" )
13061305
13071306 # BN_hex2bn stores the result in &bignum. Unless it doesn't feel like
13081307 # it. If bignum is still NULL after this call, then the return value
13091308 # 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 )
13111310
13121311 if bignum_serial [0 ] == _ffi .NULL :
13131312 set_result = _lib .ASN1_INTEGER_set (
You can’t perform that action at this time.
0 commit comments