]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_init.c
reduce code duplication
[openldap] / servers / slapd / schema_init.c
index 68e6d282d470977feae00e1b87bcab60e9792ec3..dc7fb9c5838b550c89fa17bc040c5235ded40f72 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2009 The OpenLDAP Foundation.
+ * Copyright 1998-2010 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -326,9 +326,12 @@ certificateListValidate( Syntax *syntax, struct berval *in )
        /* revokedCertificates - Sequence of Sequence, Optional */
        if ( tag == LBER_SEQUENCE ) {
                ber_len_t seqlen;
-               if ( ber_peek_tag( ber, &seqlen ) == LBER_SEQUENCE ) {
-                       /* Should NOT be empty */
-                       ber_skip_data( ber, len );
+               ber_tag_t stag;
+               stag = ber_peek_tag( ber, &seqlen );
+               if ( stag == LBER_SEQUENCE || !len ) {
+                       /* RFC5280 requires non-empty, but X.509(2005) allows empty. */
+                       if ( len )
+                               ber_skip_data( ber, len );
                        tag = ber_skip_tag( ber, &len );
                }
        }