return LDAP_SUCCESS;
}
+#define berValidate blobValidate
+
static int
octetStringMatch(
int *matchp,
struct berval *value,
void *assertedValue )
{
- int match = value->bv_len - ((struct berval *) assertedValue)->bv_len;
+ struct berval *asserted = (struct berval *) assertedValue;
+ int match = value->bv_len - asserted->bv_len;
if( match == 0 ) {
- match = memcmp( value->bv_val,
- ((struct berval *) assertedValue)->bv_val,
- value->bv_len );
+ match = memcmp( value->bv_val, asserted->bv_val, value->bv_len );
}
*matchp = match;
struct berval *value,
void *assertedValue )
{
+ struct berval *asserted = (struct berval *) assertedValue;
ber_len_t v_len = value->bv_len;
- ber_len_t av_len = ((struct berval *) assertedValue)->bv_len;
+ ber_len_t av_len = asserted->bv_len;
- int match = memcmp( value->bv_val,
- ((struct berval *) assertedValue)->bv_val,
+ int match = memcmp( value->bv_val, asserted->bv_val,
(v_len < av_len ? v_len : av_len) );
if( match == 0 ) match = v_len - av_len;
int i;
size_t slen, mlen;
BerVarray keys;
- HASH_CONTEXT HASHcontext;
- unsigned char HASHdigest[HASH_BYTES];
+ HASH_CONTEXT HASHcontext;
+ unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
digest.bv_val = HASHdigest;
digest.bv_len = sizeof(HASHdigest);
{
size_t slen, mlen;
BerVarray keys;
- HASH_CONTEXT HASHcontext;
- unsigned char HASHdigest[HASH_BYTES];
+ HASH_CONTEXT HASHcontext;
+ unsigned char HASHdigest[HASH_BYTES];
struct berval *value = (struct berval *) assertedValue;
struct berval digest;
digest.bv_val = HASHdigest;
}
static int
-octetStringSubstringsMatch (
+octetStringSubstringsMatch(
int *matchp,
slap_mask_t flags,
Syntax *syntax,
SubstringsAssertion *sub = assertedValue;
struct berval left = *value;
int i;
- ber_len_t inlen=0;
+ ber_len_t inlen = 0;
/* Add up asserted input length */
if( sub->sa_initial.bv_val ) {
/* Substrings Index generation function */
static int
-octetStringSubstringsIndexer (
+octetStringSubstringsIndexer(
slap_mask_t use,
slap_mask_t flags,
Syntax *syntax,
size_t slen, mlen;
BerVarray keys;
- HASH_CONTEXT HASHcontext;
- unsigned char HASHdigest[HASH_BYTES];
+ HASH_CONTEXT HASHcontext;
+ unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
digest.bv_val = HASHdigest;
digest.bv_len = sizeof(HASHdigest);
if( flags & SLAP_INDEX_SUBSTR_INITIAL ) {
if( values[i].bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) {
nkeys += SLAP_INDEX_SUBSTR_MAXLEN -
- ( SLAP_INDEX_SUBSTR_MINLEN - 1);
+ (SLAP_INDEX_SUBSTR_MINLEN - 1);
} else {
- nkeys += values[i].bv_len - ( SLAP_INDEX_SUBSTR_MINLEN - 1 );
+ nkeys += values[i].bv_len - (SLAP_INDEX_SUBSTR_MINLEN - 1);
}
}
if( flags & SLAP_INDEX_SUBSTR_ANY ) {
if( values[i].bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) {
- nkeys += values[i].bv_len - ( SLAP_INDEX_SUBSTR_MAXLEN - 1 );
+ nkeys += values[i].bv_len - (SLAP_INDEX_SUBSTR_MAXLEN - 1);
}
}
nkeys += SLAP_INDEX_SUBSTR_MAXLEN -
( SLAP_INDEX_SUBSTR_MINLEN - 1);
} else {
- nkeys += values[i].bv_len - ( SLAP_INDEX_SUBSTR_MINLEN - 1 );
+ nkeys += values[i].bv_len - (SLAP_INDEX_SUBSTR_MINLEN - 1);
}
}
}
( values[i].bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) )
{
char pre = SLAP_INDEX_SUBSTR_PREFIX;
- max = values[i].bv_len - ( SLAP_INDEX_SUBSTR_MAXLEN - 1);
+ max = values[i].bv_len - (SLAP_INDEX_SUBSTR_MAXLEN - 1);
for( j=0; j<max; j++ ) {
HASH_Init( &HASHcontext );
ber_len_t nkeys = 0;
size_t slen, mlen, klen;
BerVarray keys;
- HASH_CONTEXT HASHcontext;
- unsigned char HASHdigest[HASH_BYTES];
+ HASH_CONTEXT HASHcontext;
+ unsigned char HASHdigest[HASH_BYTES];
struct berval *value;
struct berval digest;
ber_dupbv( &keys[nkeys++], &digest );
}
-
}
}
}
/*
- * rfc 2252 section 6.3 Bit String
- * bitstring = "'" *binary-digit "'"
- * binary-digit = "0" / "1"
+ * RFC 2252 section 6.3 Bit String
+ * bitstring = "'" *binary-digit "'B"
+ * binary-digit = "0" / "1"
* example: '0101111101'B
*/
ber_len_t i;
for(i=dn.bv_len-3; i>1; i--) {
- if( dn.bv_val[i] != '0' && dn.bv_val[i] != '1' ) {
+ if( dn.bv_val[i] != '0' && dn.bv_val[i] != '1' ) {
break;
}
}
DirectoryString CHOICE UTF8 i/e + ignore insignificant spaces
PrintableString subset subset i/e + ignore insignificant spaces
PrintableString subset subset i/e + ignore insignificant spaces
- NumericString subset subset ignore all spaces
+ NumericString subset subset ignore all spaces
IA5String ASCII ASCII i/e + ignore insignificant spaces
TeletexString T.61 T.61 i/e + ignore insignificant spaces
- TelephoneNumber subset subset i + ignore all spaces and "-"
+ TelephoneNumber subset subset i + ignore all spaces and "-"
See draft-ietf-ldapbis-strpro for details (once published).
match = vsign - avsign;
if( match == 0 ) {
match = (vlen != avlen
- ? ( vlen < avlen ? -1 : 1 )
- : memcmp( v, av, vlen ));
- if( vsign < 0 )
- match = -match;
+ ? ( vlen < avlen ? -1 : 1 )
+ : memcmp( v, av, vlen ));
+ if( vsign < 0 ) match = -match;
}
*matchp = match;
int negative=0;
ber_len_t len;
-
p = val->bv_val;
len = val->bv_len;
serial_and_issuer_parse(
struct berval *assertion,
struct berval *serial,
- struct berval *issuer_dn
-)
+ struct berval *issuer_dn )
{
char *begin;
char *end;
struct berval *in )
{
int parts[9];
-
return check_time_syntax(in, 1, parts);
}
#endif
struct berval *in )
{
int parts[9];
-
return check_time_syntax(in, 0, parts);
}
SLAP_SYNTAX_BLOB, blobValidate, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' "
X_NOT_H_R ")",
-#define berValidate blobValidate
SLAP_SYNTAX_BER, berValidate, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )",
0, bitStringValidate, NULL },
slap_schema_init( void )
{
int res;
- int i = 0;
+ int i;
/* we should only be called once (from main) */
assert( schema_init_done == 0 );
void
schema_destroy( void )
{
- int i;
oidm_destroy();
oc_destroy();
at_destroy();