Cannot search usercertificate binary data with raw data

Luis Neves <[email protected]> Fri, 7 May 2010 12:33:10 +0000
Newsgroups gmane.network.openldap.general
Message-ID <[email protected]>
--_32f1f261-29a0-4615-b3c0-2c8f01d983a2_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable


Hi

I ve imported to my openldap directory a x509 user certificate to the userc=
ertificate=3Bbinary attribute

(using and ldif and also using the import option from the GC ldap browser)

if i make a simple query like this
ldapsearch -x -h 10.15.254.148 -p 389 -D "cn=3Droot=2Cdc=3Dcm-lisboa=2Cdc=
=3Dpt" -w ***** -s sub -b "ou=3DAuthzLDAPCertmap=2Cdc=3Dcm-lisboa=2Cdc=3Dpt=
" '(&(userCertificate=3Bbinary=3D*)(objectClass=3DstrongAuthenticationUser)=
)'

i get all the data ok:

dn: uid=3Dluisneves=2Cou=3DAuthzLDAPCertmap=2Cdc=3Dcm-lisboa=2Cdc=3Dpt
objectClass: authzLDAPmap
objectClass: top
objectClass: account
objectClass: strongAuthenticationUser
uid: luisneves
serialNumber: 1234567890
issuerDN: /C=3DCountry/ST=3DLocality/L=3DLocality/O=3DCOMPANY/OU=3DDepartme=
nt/CN=3DCompani
 es Root Certification Authority/[email protected]
subjectDN: /C=3DCountry/ST=3DLocality/L=3DLocality/O=3DCompany/OU=3DDepartm=
ent/CN=3Duid@Co
 mpany.com/[email protected]
owner: uid=3Dluisneves=2Cou=3Dpeople=2Cdc=3Dcm-lisboa=2Cdc=3Dpt
userCertificate=3Bbinary:: MIIHODCCBiCgAwIBAgIIX9kz4PL5XQ8wDQYJKoZIhvcNAQEF=
BQAwf
 DELMAkGA1UEBhMCUFQxHDAaBgNVBAoME0NhcnTDo28gZGUgQ2lkYWTDo28xFDASBgNVBAsMC3N=
1Yk
 VDRXN0YWRvMTkwNwYDVQQDDDBFQyBkZSBBdXRlbnRpY2HDp8OjbyBkbyBDYXJ0w6NvIGRlIENp=
ZGF
 etc etc

but i want to specifie a raw filter to the userCertificate atribute:
Ive uuencoded the original DER certificate and used the result as a search =
filter

ldapsearch -x -h 10.15.254.148 -p 389 -D "cn=3Droot=2Cdc=3Dcm-lisboa=2Cdc=
=3Dpt" -w ***** -s sub -b "ou=3DAuthzLDAPCertmap=2Cdc=3Dcm-lisboa=2Cdc=3Dpt=
" '(&(userCertificate=3Bbinary=3D\\30\\82\\07\\38\\30\\82\\06\\20\\a0\\03\\=
02\\01\\02\\02\\08\\d9\\33\\e0\\f2\\f9\\5d\\0f\\30\\0d\\06\\09\\2a\\86\\48\=
\86 etc etc etc )(objectClass=3DstrongAuthenticationUser))'

and nothing is returned=2C never

Ive tryied also to swap first and second bytes (eg=2C instead of \\30\\82 u=
se instead \\82\\30) and still nothing returns.....

Why? Why a cant get any result on this query?...
Best regards=2C
Luis
 		 	   		 =20
_________________________________________________________________
Hotmail: Trusted email with Microsoft=92s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=3D60969=

--_32f1f261-29a0-4615-b3c0-2c8f01d983a2_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 10pt=3B
font-family:Verdana
}
--></style>
</head>
<body class=3D'hmmessage'>
Hi<br><br>I ve imported to my openldap directory a x509 user certificate to=
 the usercertificate=3Bbinary attribute<br><br>(using and ldif and also usi=
ng the import option from the GC ldap browser)<br><br>if i make a simple qu=
ery like this<br>ldapsearch -x -h 10.15.254.148 -p 389 -D "cn=3Droot=2Cdc=
=3Dcm-lisboa=2Cdc=3Dpt" -w ***** -s sub -b "ou=3DAuthzLDAPCertmap=2Cdc=3Dcm=
-lisboa=2Cdc=3Dpt" '(&amp=3B(userCertificate=3Bbinary=3D*)(objectClass=3Dst=
rongAuthenticationUser))'<br><br>i get all the data ok:<br><br>dn: uid=3Dlu=
isneves=2Cou=3DAuthzLDAPCertmap=2Cdc=3Dcm-lisboa=2Cdc=3Dpt<br>objectClass: =
authzLDAPmap<br>objectClass: top<br>objectClass: account<br>objectClass: st=
rongAuthenticationUser<br>uid: luisneves<br>serialNumber: 1234567890<br>iss=
uerDN: /C=3DCountry/ST=3DLocality/L=3DLocality/O=3DCOMPANY/OU=3DDepartment/=
CN=3DCompani<br>&nbsp=3Bes Root Certification Authority/emailAddress=3Dmail=
@Company.com<br>subjectDN: /C=3DCountry/ST=3DLocality/L=3DLocality/O=3DComp=
any/OU=3DDepartment/CN=3Duid@Co<br>&nbsp=3Bmpany.com/emailAddress=3DUID@Com=
pany.com<br>owner: uid=3Dluisneves=2Cou=3Dpeople=2Cdc=3Dcm-lisboa=2Cdc=3Dpt=
<br>userCertificate=3Bbinary:: MIIHODCCBiCgAwIBAgIIX9kz4PL5XQ8wDQYJKoZIhvcN=
AQEFBQAwf<br>&nbsp=3BDELMAkGA1UEBhMCUFQxHDAaBgNVBAoME0NhcnTDo28gZGUgQ2lkYWT=
Do28xFDASBgNVBAsMC3N1Yk<br>&nbsp=3BVDRXN0YWRvMTkwNwYDVQQDDDBFQyBkZSBBdXRlbn=
RpY2HDp8OjbyBkbyBDYXJ0w6NvIGRlIENpZGF<br>&nbsp=3Betc etc<br><br>but i want =
to specifie a raw filter to the userCertificate atribute:<br>Ive uuencoded =
the original DER certificate and used the result as a search filter<br><br>=
ldapsearch -x -h 10.15.254.148 -p 389 -D "cn=3Droot=2Cdc=3Dcm-lisboa=2Cdc=
=3Dpt" -w ***** -s sub -b "ou=3DAuthzLDAPCertmap=2Cdc=3Dcm-lisboa=2Cdc=3Dpt=
" '(&amp=3B(userCertificate=3Bbinary=3D\\30\\82\\07\\38\\30\\82\\06\\20\\a0=
\\03\\02\\01\\02\\02\\08\\d9\\33\\e0\\f2\\f9\\5d\\0f\\30\\0d\\06\\09\\2a\\8=
6\\48\\86 etc etc etc )(objectClass=3DstrongAuthenticationUser))'<br><br>an=
d nothing is returned=2C never<br><br>Ive tryied also to swap first and sec=
ond bytes (eg=2C instead of \\30\\82 use instead \\82\\30) and still nothin=
g returns.....<br><br>Why? Why a cant get any result on this query?...<br>B=
est regards=2C<br>Luis<br> 		 	   		  <br /><hr />Hotmail: Trusted email wi=
th Microsoft=92s powerful SPAM protection. <a href=3D'https://signup.live.c=
om/signup.aspx?id=3D60969' target=3D'_new'>Sign up now.</a></body>
</html>=

--_32f1f261-29a0-4615-b3c0-2c8f01d983a2_--