mlen = strlen( mr->smr_oid );
for( i=0; values[i] != NULL; i++ ) {
- struct berval *value = values[i];
+ struct berval *value;
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( values[i]->bv_val, UTF8_NOCASEFOLD ) );
+#else
+ value = values[i];
+#endif
HASH_Init( &HASHcontext );
if( prefix != NULL && prefix->bv_len > 0 ) {
value->bv_val, value->bv_len );
HASH_Final( HASHdigest, &HASHcontext );
+#if UTF8MATCH
+ ber_bvfree( value );
+#endif
+
keys[i] = ber_bvdup( &digest );
}
slen = strlen( syntax->ssyn_oid );
mlen = strlen( mr->smr_oid );
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( ((struct berval *) assertValue)->bv_val, UTF8_NOCASEFOLD ) );
+#else
value = (struct berval *) assertValue;
+#endif
keys = ch_malloc( sizeof( struct berval * ) * 2 );
keys[0] = ber_bvdup( &digest );
keys[1] = NULL;
+#if UTF8MATCH
+ ber_bvfree( value );
+#endif
+
*keysp = keys;
return LDAP_SUCCESS;
}
ber_len_t j,max;
struct berval *value;
+ if( values[i]->bv_len < SLAP_INDEX_SUBSTR_MINLEN ) continue;
+
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( values[i]->bv_val, UTF8_NOCASEFOLD ) );
+#else
value = values[i];
- if( value->bv_len < SLAP_INDEX_SUBSTR_MINLEN ) continue;
+#endif
if( ( flags & SLAP_INDEX_SUBSTR_ANY ) &&
( value->bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) )
}
}
+
+#if UTF8MATCH
+ ber_bvfree( value );
+#endif
+
}
if( nkeys > 0 ) {
sa->sa_initial->bv_len >= SLAP_INDEX_SUBSTR_MINLEN )
{
pre = SLAP_INDEX_SUBSTR_INITIAL_PREFIX;
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( sa->sa_initial->bv_val, UTF8_NOCASEFOLD ) );
+#else
value = sa->sa_initial;
+#endif
klen = SLAP_INDEX_SUBSTR_MAXLEN < value->bv_len
? SLAP_INDEX_SUBSTR_MAXLEN : value->bv_len;
value->bv_val, klen );
HASH_Final( HASHdigest, &HASHcontext );
+#if UTF8MATCH
+ ber_bvfree( value );
+#endif
keys[nkeys++] = ber_bvdup( &digest );
}
continue;
}
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( sa->sa_any[i]->bv_val, UTF8_NOCASEFOLD ) );
+#else
value = sa->sa_any[i];
+#endif
for(j=0;
j <= value->bv_len - SLAP_INDEX_SUBSTR_MAXLEN;
keys[nkeys++] = ber_bvdup( &digest );
}
+
+#if UTF8MATCH
+ ber_bvfree( value );
+#endif
}
}
sa->sa_final->bv_len >= SLAP_INDEX_SUBSTR_MINLEN )
{
pre = SLAP_INDEX_SUBSTR_FINAL_PREFIX;
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( sa->sa_final->bv_val, UTF8_NOCASEFOLD ) );
+#else
value = sa->sa_final;
+#endif
klen = SLAP_INDEX_SUBSTR_MAXLEN < value->bv_len
? SLAP_INDEX_SUBSTR_MAXLEN : value->bv_len;
&value->bv_val[value->bv_len-klen], klen );
HASH_Final( HASHdigest, &HASHcontext );
+#if UTF8MATCH
+ ber_bvfree( value );
+#endif
keys[nkeys++] = ber_bvdup( &digest );
}
mlen = strlen( mr->smr_oid );
for( i=0; values[i] != NULL; i++ ) {
- struct berval *value = ber_bvdup( values[i] );
+ struct berval *value;
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( values[i]->bv_val, UTF8_CASEFOLD ) );
+#else
+ value = ber_bvdup( values[i] );
ldap_pvt_str2upper( value->bv_val );
-
+#endif
HASH_Init( &HASHcontext );
if( prefix != NULL && prefix->bv_len > 0 ) {
HASH_Update( &HASHcontext,
slen = strlen( syntax->ssyn_oid );
mlen = strlen( mr->smr_oid );
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( ((struct berval *) assertValue)->bv_val, UTF8_CASEFOLD ) );
+#else
value = ber_bvdup( (struct berval *) assertValue );
ldap_pvt_str2upper( value->bv_val );
+#endif
keys = ch_malloc( sizeof( struct berval * ) * 2 );
if( values[i]->bv_len < SLAP_INDEX_SUBSTR_MINLEN ) continue;
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( values[i]->bv_val, UTF8_CASEFOLD ) );
+#else
value = ber_bvdup( values[i] );
ldap_pvt_str2upper( value->bv_val );
+#endif
if( ( flags & SLAP_INDEX_SUBSTR_ANY ) &&
( value->bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) )
sa->sa_initial->bv_len >= SLAP_INDEX_SUBSTR_MINLEN )
{
pre = SLAP_INDEX_SUBSTR_INITIAL_PREFIX;
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( sa->sa_initial->bv_val, UTF8_CASEFOLD ) );
+#else
value = ber_bvdup( sa->sa_initial );
ldap_pvt_str2upper( value->bv_val );
+#endif
klen = SLAP_INDEX_SUBSTR_MAXLEN < value->bv_len
? SLAP_INDEX_SUBSTR_MAXLEN : value->bv_len;
continue;
}
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( sa->sa_any[i]->bv_val, UTF8_CASEFOLD ) );
+#else
value = ber_bvdup( sa->sa_any[i] );
ldap_pvt_str2upper( value->bv_val );
+#endif
for(j=0;
j <= value->bv_len - SLAP_INDEX_SUBSTR_MAXLEN;
sa->sa_final->bv_len >= SLAP_INDEX_SUBSTR_MINLEN )
{
pre = SLAP_INDEX_SUBSTR_FINAL_PREFIX;
+#if UTF8MATCH
+ value = ber_bvstr( UTF8normalize( sa->sa_final->bv_val, UTF8_CASEFOLD ) );
+#else
value = ber_bvdup( sa->sa_final );
ldap_pvt_str2upper( value->bv_val );
+#endif
klen = SLAP_INDEX_SUBSTR_MAXLEN < value->bv_len
? SLAP_INDEX_SUBSTR_MAXLEN : value->bv_len;