mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
Fix nc_email to check ASN1 strings with NULL byte in the middle
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16524)
This commit is contained in:
parent
cc0d1b03a9
commit
485d0790ac
@ -714,6 +714,9 @@ static int nc_email(ASN1_IA5STRING *eml, ASN1_IA5STRING *base)
|
|||||||
if (baseat != baseptr) {
|
if (baseat != baseptr) {
|
||||||
if ((baseat - baseptr) != (emlat - emlptr))
|
if ((baseat - baseptr) != (emlat - emlptr))
|
||||||
return X509_V_ERR_PERMITTED_VIOLATION;
|
return X509_V_ERR_PERMITTED_VIOLATION;
|
||||||
|
if (memchr(baseptr, 0, baseat - baseptr) ||
|
||||||
|
memchr(emlptr, 0, emlat - emlptr))
|
||||||
|
return X509_V_ERR_UNSUPPORTED_NAME_SYNTAX;
|
||||||
/* Case sensitive match of local part */
|
/* Case sensitive match of local part */
|
||||||
if (strncmp(baseptr, emlptr, emlat - emlptr))
|
if (strncmp(baseptr, emlptr, emlat - emlptr))
|
||||||
return X509_V_ERR_PERMITTED_VIOLATION;
|
return X509_V_ERR_PERMITTED_VIOLATION;
|
||||||
|
Loading…
Reference in New Issue
Block a user