mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-04 22:20:28 -05:00
allow validation/normalization of x509 v1 (default) certs
This commit is contained in:
parent
973a2b41b7
commit
6a4dd27158
1 changed files with 8 additions and 4 deletions
|
|
@ -112,8 +112,10 @@ static int certificateValidate( Syntax *syntax, struct berval *in )
|
|||
if ( tag != LBER_SEQUENCE ) return LDAP_INVALID_SYNTAX;
|
||||
tag = ber_skip_tag( ber, &len ); /* Sequence */
|
||||
if ( tag != LBER_SEQUENCE ) return LDAP_INVALID_SYNTAX;
|
||||
tag = ber_skip_tag( ber, &len );
|
||||
if ( tag == 0xa0 ) { /* Optional version */
|
||||
tag = ber_peek_tag( ber, &len );
|
||||
/* Optional version */
|
||||
if ( tag == 0xa0 ) {
|
||||
tag = ber_skip_tag( ber, &len );
|
||||
tag = ber_get_int( ber, &version );
|
||||
if ( tag != LBER_INTEGER ) return LDAP_INVALID_SYNTAX;
|
||||
}
|
||||
|
|
@ -3277,9 +3279,11 @@ certificateExactNormalize(
|
|||
ber_init2( ber, val, LBER_USE_DER );
|
||||
tag = ber_skip_tag( ber, &len ); /* Signed Sequence */
|
||||
tag = ber_skip_tag( ber, &len ); /* Sequence */
|
||||
tag = ber_skip_tag( ber, &len ); /* Optional version? */
|
||||
if ( tag == 0xa0 )
|
||||
tag = ber_peek_tag( ber, &len ); /* Optional version? */
|
||||
if ( tag == 0xa0 ) {
|
||||
tag = ber_skip_tag( ber, &len );
|
||||
tag = ber_get_int( ber, &i ); /* version */
|
||||
}
|
||||
ber_get_int( ber, &i ); /* serial */
|
||||
|
||||
seriallen = snprintf( serial, sizeof(serial), "%d", i );
|
||||
|
|
|
|||
Loading…
Reference in a new issue