mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
certificateExactNormalize - only check serial encoding if len > 1
This commit is contained in:
parent
05d2ce40b9
commit
925e92dcc9
@ -3045,14 +3045,14 @@ certificateExactNormalize(
|
||||
ber_skip_data( ber, len );
|
||||
|
||||
/* Check for minimal encodings */
|
||||
if ( ptr[0] & 0x80 ) {
|
||||
if (( ptr[0] == 0xff ) && ( ptr[1] & 0x80 ))
|
||||
return LDAP_INVALID_SYNTAX;
|
||||
} else if ( ptr[0] == 0 ) {
|
||||
if (!( ptr[1] & 0x80 ))
|
||||
return LDAP_INVALID_SYNTAX;
|
||||
ptr++;
|
||||
len--;
|
||||
if ( len > 1 ) {
|
||||
if ( ptr[0] & 0x80 ) {
|
||||
if (( ptr[0] == 0xff ) && ( ptr[1] & 0x80 ))
|
||||
return LDAP_INVALID_SYNTAX;
|
||||
} else if ( ptr[0] == 0 ) {
|
||||
if (!( ptr[1] & 0x80 ))
|
||||
return LDAP_INVALID_SYNTAX;
|
||||
}
|
||||
}
|
||||
|
||||
seriallen = len * 2 + 4; /* quotes, H, NUL */
|
||||
|
Loading…
Reference in New Issue
Block a user