]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_init.c
note about OpenSSL being more liberal than OpenLDAP when there is garbage past the...
[openldap] / servers / slapd / schema_init.c
index bb027823ecf971351b06f02531f0ddc1e9b4e014..95d108f6a5f294bd53777cfff0a7aa8d0742a708 100644 (file)
@@ -319,10 +319,11 @@ certificateListValidate( Syntax *syntax, struct berval *in )
                        tag = ber_skip_tag( ber, &len );
                }
        }
-       /* Optional Extensions */
+       /* Optional Extensions - Sequence of Sequence */
        if ( tag == SLAP_X509_OPT_CL_CRLEXTENSIONS ) { /* ? */
+               ber_len_t seqlen;
                if ( version != SLAP_X509_V2 ) return LDAP_INVALID_SYNTAX;
-               tag = ber_skip_tag( ber, &len );
+               tag = ber_peek_tag( ber, &seqlen );
                if ( tag != LBER_SEQUENCE ) return LDAP_INVALID_SYNTAX;
                ber_skip_data( ber, len );
                tag = ber_skip_tag( ber, &len );
@@ -336,6 +337,7 @@ certificateListValidate( Syntax *syntax, struct berval *in )
        ber_skip_data( ber, len );
        tag = ber_skip_tag( ber, &len );
        /* Must be at end now */
+       /* NOTE: OpenSSL tolerates CL with garbage past the end */
        if ( len || tag != LBER_DEFAULT ) return LDAP_INVALID_SYNTAX;
        return LDAP_SUCCESS;
 }
@@ -388,7 +390,7 @@ attributeCertificateValidate( Syntax *syntax, struct berval *in )
        if ( tag != LBER_SEQUENCE ) return LDAP_INVALID_SYNTAX;
        ber_skip_data( ber, len );
 
-       ber_peek_tag( ber, &len );
+       tag = ber_peek_tag( ber, &len );
 
        if ( tag == LBER_BITSTRING ) {  /* issuerUniqueID */
                tag = ber_skip_tag( ber, &len );