DRAFT Test Cases for String Representation of LDAP Search Filters Implementation Report DRAFT The String Representation of LDAP Search Filters is specified in draft-ietf-ldapbis-filter-01.txt (is intended to replace RFC 2255). This document provides test cases to determine if there are multiple interoperable independently developed implementations [RFC 2026] of this technical specification. Implementations of this technical specification are encouraged run these test cases and report findings (success and failure) to . Please include a brief description of your application and details regarding how your implementation differs from test case. Technical specification issues should be raised to the LDAPbis Working Group . New test cases may be added from time to time during the drafting of this report. Suggestions may be sent to . [...] interoperable independently-developed implementations, Legend: o OpenLDAP Client C API [parser] O OpenLDAP Server [generator] n Novell JLDAP (Client) [parser] Valid Filters Each filter consists of a UTF-8 string representation and a BER encoding (in hex) of a filter. Parsers should be able to convert the string to the BER. Generators should be be able to convert the BER to a string. (attr=*) [oOn] 0000: 87 04 61 74 74 72 ..attr (attr;x-tag=*) [oOn] 0000: 87 0a 61 74 74 72 3b 78 2d 74 61 67 ..attr;x-tag (attr=) [oOn] 0000: a3 08 04 04 61 74 74 72 04 00 ....attr.. (1.2.3.4.5=) [oOn] 0000: a3 0d 04 09 31 2e 32 2e 33 2e 34 2e 35 04 00 ....1.2.3.4.5.. (1.2.3.4.5;x-tag=) [oOn] 0000: a3 13 04 0f 31 2e 32 2e 33 2e 34 2e 35 3b 78 2d ....1.2.3.4.5;x- 0010: 74 61 67 04 00 tag.. (attr=value) [oOn] 0000: a3 0d 04 04 61 74 74 72 04 05 76 61 6c 75 65 ....attr..value (space= ) [oOn] 0000: a3 0a 04 05 73 70 61 63 65 04 01 20 ....space.. (null=\00) [oOn] 0000: a3 09 04 04 6e 75 6c 6c 04 01 00 ....null... (bell=\07) [oOn] 0000: a3 09 04 04 62 65 6c 6c 04 01 07 ....bell... (bell=) [oOn] 0000: a3 09 04 04 62 65 6c 6c 04 01 07 ....bell... (attr;x-star=\2a) [oOn] 0000: a3 10 04 0b 61 74 74 72 3b 78 2d 73 74 61 72 04 ....attr;x-star. 0010: 01 2a .* (attr;x-escape=\5C) [oOn] 0000: a3 12 04 0d 61 74 74 72 3b 78 2d 65 73 63 61 70 ....attr;x-escap 0010: 65 04 01 5c e..\ (attr=initial*) [oOn] 0000: a4 11 04 04 61 74 74 72 30 09 80 07 69 6e 69 74 ....attr0...init 0010: 69 61 6c ial (attr=*any*) [oOn] 0000: a4 0d 04 04 61 74 74 72 30 05 81 03 61 6e 79 ....attr0...any (attr=*final) [oOn] 0000: a4 0f 04 04 61 74 74 72 30 07 82 05 66 69 6e 61 ....attr0...fina 0010: 6c l (attr=initial*final) [oOn] 0000: a4 18 04 04 61 74 74 72 30 10 80 07 69 6e 69 74 ....attr0...init 0010: 69 61 6c 82 05 66 69 6e 61 6c ial..final (attr=initial*any*any*final) [oOn] 0000: a4 22 04 04 61 74 74 72 30 1a 80 07 69 6e 69 74 ."..attr0...init 0010: 69 61 6c 81 03 61 6e 79 81 03 61 6e 79 82 05 66 ial..any..any..f 0020: 69 6e 61 6c inal (attr=initial*any*) [oOn] 0000: a4 16 04 04 61 74 74 72 30 0e 80 07 69 6e 69 74 ....attr0...init 0010: 69 61 6c 81 03 61 6e 79 ial..any (attr=*any*final) [oOn] 0000: a4 14 04 04 61 74 74 72 30 0c 81 03 61 6e 79 82 ....attr0...any. 0010: 05 66 69 6e 61 6c .final (attr=*any*any*) [oOn] 0000: a4 12 04 04 61 74 74 72 30 0a 81 03 61 6e 79 81 ....attr0...any. 0010: 03 61 6e 79 .any (attr=**) [oOn] 0000: a4 0a 04 04 61 74 74 72 30 02 81 00 ....attr0... (attr=initial**) [oOn] 0000: a4 13 04 04 61 74 74 72 30 0b 80 07 69 6e 69 74 ....attr0...init 0010: 69 61 6c 81 00 ial.. (attr=**final) [oOn] 0000: a4 11 04 04 61 74 74 72 30 09 81 00 82 05 66 69 ....attr0.....fi 0010: 6e 61 6c nal (attr=initial**final) [oOn] 0000: a4 1a 04 04 61 74 74 72 30 12 80 07 69 6e 69 74 ....attr0...init 0010: 69 61 6c 81 00 82 05 66 69 6e 61 6c ial....final (attr=initial***final) [oOn] 0000: a4 1c 04 04 61 74 74 72 30 14 80 07 69 6e 69 74 ....attr0...init 0010: 69 61 6c 81 00 81 00 82 05 66 69 6e 61 6c ial......final (attr~=) [oOn] 0000: a8 08 04 04 61 74 74 72 04 00 ....attr.. (attr~=fubar) [oOn] 0000: a8 0d 04 04 61 74 74 72 04 05 66 75 62 61 72 ....attr..fubar (attr>=fubar) [oOn] 0000: a5 0d 04 04 61 74 74 72 04 05 66 75 62 61 72 ....attr..fubar (attr<=fubar) [oOn] 0000: a6 0d 04 04 61 74 74 72 04 05 66 75 62 61 72 ....attr..fubar (attr:1.2.3:=fubar) [on] 0000: a9 14 81 05 31 2e 32 2e 33 82 04 61 74 74 72 83 ....1.2.3..attr. 0010: 05 66 75 62 61 72 .fubar (attr:dn:=fubar) [on] 0000: a9 10 82 04 61 74 74 72 83 05 66 75 62 61 72 84 ....attr..fubar. 0010: 01 ff .. (attr:DN:=fubar) [oOn] 0000: a9 11 81 02 44 4e 82 04 61 74 74 72 83 05 66 75 ....DN..attr..fu 0010: 62 61 72 bar (attr:dn:1.2.3:=fubar) [on] 0000: a9 17 81 05 31 2e 32 2e 33 82 04 61 74 74 72 83 ....1.2.3..attr. 0010: 05 66 75 62 61 72 84 01 ff .fubar... (:1.2.3:=fubar) [on] 0000: a9 0e 81 05 31 2e 32 2e 33 83 05 66 75 62 61 72 ....1.2.3..fubar (:caseExactMatch:=fubar) [on] 0000: a9 17 81 0e 63 61 73 65 45 78 61 63 74 4d 61 74 ....caseExactMat 0010: 63 68 83 05 66 75 62 61 72 ch..fubar (:dn:1.2.3:=fubar) [on] 0000: a9 11 81 05 31 2e 32 2e 33 83 05 66 75 62 61 72 ....1.2.3..fubar 0010: 84 01 ff ... (:dn:caseIgnoreMatch:=fubar) [on] 0000: a9 1b 81 0f 63 61 73 65 49 67 6e 6f 72 65 4d 61 ....caseIgnoreMa 0010: 74 63 68 83 05 66 75 62 61 72 84 01 ff tch..fubar... (!(objectClass=*)) [oOn] 0000: a2 0d 87 0b 6f 62 6a 65 63 74 43 6c 61 73 73 ....objectClass (!(|(&(!(objectClass=*))))) [oOn] 0000: a2 13 a1 11 a0 0f a2 0d 87 0b 6f 62 6a 65 63 74 ..........object 0010: 43 6c 61 73 73 Class (&(objectClass=*)) [oOn] 0000: a0 0d 87 0b 6f 62 6a 65 63 74 43 6c 61 73 73 ....objectClass (&(objectClass=*)(name~=)) [oOn] 0000: a0 17 87 0b 6f 62 6a 65 63 74 43 6c 61 73 73 a8 ....objectClass. 0010: 08 04 04 6e 61 6d 65 04 00 ...name.. (|(objectClass=*)) [oOn] 0000: a1 0d 87 0b 6f 62 6a 65 63 74 43 6c 61 73 73 ....objectClass (|(objectClass=*)(name~=)) [oOn] 0000: a1 17 87 0b 6f 62 6a 65 63 74 43 6c 61 73 73 a8 ....objectClass. 0010: 08 04 04 6e 61 6d 65 04 00 ...name.. Invalid string representations (parser only cases) // Parsers should detect the string is invalid and not encodable // Note: parsers may be liberal in what they accept attr=* // no parens some implementation treat this as (attr=*) [on] per historical usage (attr=* // no closing paren [on] attr=*) // no opening paren [on] (attr~=*) // unescaped * [on] (attr=) // unescaped NUL in valueencoding [on] (attr=() // unescaped opening paren in valueencoding [on] (attr=)) // unescaped closing paren in valueencoding [on] (attr=\) // unescaped backslash in valueencoding [on] (attr=\GG) // invalid hex character [on] (attr=\F) // invalid escaping (single hex character) [on] (attr=\*) // invalid escaping of * some implementation treat this as (attr=\2a) [on] per RFC 1960 (attr=\() // invalid escaping of ( some implementation treat this as (attr=\28) [on] per RFC 1960 (attr=\)) // invalid escaping of ) some implementation treat this as (attr=\29) [on] per RFC 1960 (attr=\\) // invalid escaping of \ some implementation treat this as (attr=\5c) [on] per historical usage (attr=\x) // invalid escaping of x [on] (attr>0) // invalid, no = [on] (attr<0) // invalid, no = [on] (attr?=value) // invalid filter type [on] // empty [on] () // empty [on] (=) // no attr [on] (;option=*) // no attribute type [on] (attr;=*) // no option [on] (at_tr=*) // invalid attribute type [on] (attr;opt_=*) // invalid option [on] (attr\3Boption=*) // invalid escaping [on] (:=) // no matching rule [on] (::=) // no "dn" nor matching rule [on] (:::=) // no "dn" nor matching rule [on] (!) // no inner filter [on] (!(attr=TRUE)(attr=FALSE)) // multiple inner filter [on] (|) // empty filter set [n] some implementation treat this as an absolute [o] true filter ala LDAPv2 and DAP. see draft-zeilenga-ldap-t-f.txt (&) // empty filter set [n] some implementation treat this as an absolute [o] true filter ala LDAPv2 and DAP. see draft-zeilenga-ldap-t-f-xx.txt BER encodings with no filter representation (generator only cases) // The following BER data cannot be converted to a valid string // representation. Strings (provided for discussion purposes) // are invalid. // Note: parsers may be liberal in what they accept (&) // empty AND set 0000: a0 00 .. some implementation treat this as an absolute [O] true filter ala LDAPv2 and DAP. see draft-zeilenga-ldap-t-f-xx.txt (|) // empty ORset 0000: a1 00 .. some implementation treat this as an absolute [O] true filter ala LDAPv2 and DAP. see draft-zeilenga-ldap-t-f-xx.txt (attr=X*) // where X is empty [O] 0000: a4 0a 04 04 61 74 74 72 30 02 80 00 ....attr0... (attr=*X) // where X is empty [O] 0000: a4 0a 04 04 61 74 74 72 30 02 82 00 ....attr0.... (attr=X*X) // where X is empty [O] 0000: a4 0c 04 04 61 74 74 72 30 04 80 00 82 00 ....attr0..... (attr?=) // invalid tag [O] 0000: aa 08 04 04 61 74 74 72 04 00 ....attr.. --- $OpenLDAP$