You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ossl_verifyhost assumes OpenSSL ASN1_STRING to be null terminated #22822
ossl_verifyhost assumes OpenSSL ASN1_STRING to be null terminated, but OpenSSL docs say:
In general it cannot be assumed that the data returned by ASN1_STRING_data() is null terminated or does not contain embedded nulls. The actual format of the data will depend on the actual string type itself: for example for an IA5String the data will be ASCII, for a BMPString two bytes per character in big endian format, and for a UTF8String it will be in UTF8 format.
I verified this by making a local change to BoringSSL to no longer null terminate ASN1_STRING objects, and tests found one more affected place. Note that this may not be exhaustive yet, but a larger code base works fine after fixing this one function in curl at HEAD.
Impact of the bug is:
Error: "SSL: illegal cert name field"
Sometimes even: "SSL: certificate subject name 'serverRANDOMUNPRINTABLESTUFF' does not match target hostname 'localhost'"
Will send a PR to fix it.
I expected the following
Host name comparison keeps working when the SSL library does not null terminate ASN1_STRING objects.
Activity
ossl_verifyhost: remove assumption of null termination of ASN1_STRING.
ossl_verifyhost: remove assumption of null termination of ASN1_STRING.
ossl_verifyhost: remove assumption of null termination of ASN1_STRING.
ossl_verifyhost: remove assumption of null termination of ASN1_STRING.