noxxi / p5-io-socket-ssl

IO::Socket::SSL Perl Module
36 stars 59 forks source link

Decode the serial number the right way #47

Closed odenbach closed 7 years ago

odenbach commented 7 years ago

Hi,

for certificates with really large serial numbers CERT_asHash returned -1 as serial number. After reading the Net::SSLeay documentation I changed the decoding function to P_ASN1_INTEGER_get_dec:

BEWARE: If the value stored in ASN1_INTEGER is greater than max. integer that can be stored in 'long' type (usually 32bit but may vary according to platform) then this function will return -1. For getting large ASN1_INTEGER values consider using "P_ASN1_INTEGER_get_dec" or "P_ASN1_INTEGER_get_hex".

Cheers,

Christopher

noxxi commented 7 years ago

Thanks for the patches. They will be included in the next version of IO::Socket::SSL.

odenbach commented 7 years ago

Thanks. Any idea when this will be? Just curious.

noxxi commented 7 years ago

Version 2.040 is now released which includes these changes.