2003-10-17 10:15:50 +08:00
|
|
|
#! /bin/sh
|
|
|
|
# $OpenLDAP$
|
2003-11-29 04:00:23 +08:00
|
|
|
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
##
|
2015-02-12 05:36:57 +08:00
|
|
|
## Copyright 1998-2015 The OpenLDAP Foundation.
|
2003-11-29 04:00:23 +08:00
|
|
|
## All rights reserved.
|
|
|
|
##
|
|
|
|
## Redistribution and use in source and binary forms, with or without
|
|
|
|
## modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
## Public License.
|
|
|
|
##
|
|
|
|
## A copy of this license is available in the file LICENSE in the
|
|
|
|
## top-level directory of the distribution or, alternatively, at
|
|
|
|
## <http://www.OpenLDAP.org/license.html>.
|
2003-10-17 10:15:50 +08:00
|
|
|
|
|
|
|
echo "running defines.sh"
|
|
|
|
. $SRCDIR/scripts/defines.sh
|
|
|
|
|
2003-10-22 13:14:08 +08:00
|
|
|
mkdir -p $TESTDIR $DBDIR1
|
2003-10-17 10:15:50 +08:00
|
|
|
|
|
|
|
echo "Running slapadd to build slapd database..."
|
2003-10-22 13:14:08 +08:00
|
|
|
. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
|
2004-07-26 21:45:28 +08:00
|
|
|
#echo $SLAPADD -f $CONF1 -l $LDIFORDERED
|
2003-10-22 13:14:08 +08:00
|
|
|
$SLAPADD -f $CONF1 -l $LDIFORDERED
|
2003-10-17 10:15:50 +08:00
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "slapadd failed ($RC)!"
|
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
2003-10-22 13:14:08 +08:00
|
|
|
echo "Starting slapd on TCP/IP port $PORT1..."
|
2005-09-30 15:32:49 +08:00
|
|
|
#valgrind -v --gdb-attach=yes --logfile=info --num-callers=16 --leak-check=yes --leak-resolution=high $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING </dev/tty > $LOG1 2>&1 &
|
2003-10-22 13:14:08 +08:00
|
|
|
$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
|
2003-10-17 10:15:50 +08:00
|
|
|
PID=$!
|
|
|
|
if test $WAIT != 0 ; then
|
|
|
|
echo PID $PID
|
|
|
|
read foo
|
|
|
|
fi
|
2003-10-22 13:14:08 +08:00
|
|
|
KILLPIDS="$PID"
|
2003-10-17 10:15:50 +08:00
|
|
|
|
|
|
|
echo "Testing certificate handling..."
|
|
|
|
|
2005-09-30 15:32:49 +08:00
|
|
|
sleep 1
|
|
|
|
|
2003-10-17 10:15:50 +08:00
|
|
|
for i in 0 1 2 3 4 5; do
|
2003-10-22 13:14:08 +08:00
|
|
|
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
|
2003-10-17 10:15:50 +08:00
|
|
|
'objectclass=*' > /dev/null 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC = 0 ; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
echo "Waiting 5 seconds for slapd to start..."
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-17 10:15:50 +08:00
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Add certificates..."
|
2003-10-22 13:14:08 +08:00
|
|
|
$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
|
2003-10-17 10:15:50 +08:00
|
|
|
$TESTOUT 2>&1 << EOMODS
|
|
|
|
version: 1
|
|
|
|
|
|
|
|
# LEADING COMMENT AND WHITE SPACE
|
|
|
|
|
2003-10-18 10:39:08 +08:00
|
|
|
# should use certificationAuthority instead of extensibleObject
|
2004-04-22 06:14:01 +08:00
|
|
|
dn: dc=example,dc=com
|
2003-10-18 10:39:08 +08:00
|
|
|
changetype: modify
|
|
|
|
add: objectClass
|
|
|
|
objectClass: extensibleObject
|
|
|
|
-
|
2006-11-28 03:15:28 +08:00
|
|
|
add: cAcertificate;binary
|
2003-10-18 10:39:08 +08:00
|
|
|
cAcertificate;binary::
|
|
|
|
MIIDVDCCAr2gAwIBAgIBADANBgkqhkiG9w0BAQQFADB3MQswCQYDVQQGEwJVUzET
|
|
|
|
MBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAgRXhhbXBsZSwg
|
|
|
|
THRkLjETMBEGA1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYOY2FAZXhh
|
|
|
|
bXBsZS5jb20wHhcNMDMxMDE3MTYzMDQxWhcNMDQxMDE2MTYzMDQxWjB3MQswCQYD
|
|
|
|
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAg
|
|
|
|
RXhhbXBsZSwgTHRkLjETMBEGA1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJ
|
|
|
|
ARYOY2FAZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANlj
|
|
|
|
UGxiisAzEiALukzt3Gj/24MRw1J0AZx6GncXLhpNJsAFyA0bYZdAzgvydKeq/uX0
|
|
|
|
i5o/4Byc3G71XAAcbJZxDPtrLwpDAdMNOBvKV2r67yTgnpatFLfGRt/FWazj5EbF
|
|
|
|
YkorWWTe+4eEBd9VPzebHdIm+DPHipUfIAzRoNejAgMBAAGjge8wgewwHQYDVR0O
|
|
|
|
BBYEFEtvIRo2JNKQ+UOwU0ctfeHA5pgjMIGhBgNVHSMEgZkwgZaAFEtvIRo2JNKQ
|
|
|
|
+UOwU0ctfeHA5pgjoXukeTB3MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv
|
|
|
|
cm5pYTEfMB0GA1UEChMWT3BlbkxEQVAgRXhhbXBsZSwgTHRkLjETMBEGA1UEAxMK
|
|
|
|
RXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYOY2FAZXhhbXBsZS5jb22CAQAwDAYD
|
|
|
|
VR0TBAUwAwEB/zAZBgNVHREEEjAQgQ5jYUBleGFtcGxlLmNvbTANBgkqhkiG9w0B
|
|
|
|
AQQFAAOBgQCgXD/+28El3GXi/uxMNEKqtnIhQdTnNU4il0fZ6pcmHPFC+61Bddow
|
|
|
|
90ZZZh5Gbg5ZBxFRhDXN8K/fix3ewRSjASt40dGlEODkE+FsLMt04sYl6kX7RGKg
|
|
|
|
9a46DkeG+uzZnN/3252uCgh+rjNMFAglueUTERv3EtUB1iXEoU3GyA==
|
|
|
|
|
2004-04-22 06:14:01 +08:00
|
|
|
dn: cn=Ursula Hampster,ou=Alumni Association,ou=People,dc=example,dc=com
|
2003-10-17 10:15:50 +08:00
|
|
|
changetype: modify
|
2003-10-18 10:39:08 +08:00
|
|
|
add: objectClass
|
|
|
|
objectClass: strongAuthenticationUser
|
|
|
|
-
|
2006-11-28 03:15:28 +08:00
|
|
|
add: userCertificate;binary
|
2003-10-17 10:15:50 +08:00
|
|
|
userCertificate;binary::
|
2003-10-18 10:39:08 +08:00
|
|
|
MIIDazCCAtSgAwIBAgIBAjANBgkqhkiG9w0BAQQFADB3MQswCQYDVQQGEwJVUzET
|
|
|
|
MBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAgRXhhbXBsZSwg
|
|
|
|
THRkLjETMBEGA1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYOY2FAZXhh
|
|
|
|
bXBsZS5jb20wHhcNMDMxMDE3MTYzMzE5WhcNMDQxMDE2MTYzMzE5WjB+MQswCQYD
|
|
|
|
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAg
|
|
|
|
RXhhbXBsZSwgTHRkLjEYMBYGA1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
changetype: modify
|
2003-10-18 10:39:08 +08:00
|
|
|
add: objectClass
|
|
|
|
objectClass: strongAuthenticationUser
|
|
|
|
-
|
2006-11-28 03:15:28 +08:00
|
|
|
add: userCertificate;binary
|
2003-10-17 10:15:50 +08:00
|
|
|
userCertificate;binary::
|
2003-10-18 10:39:08 +08:00
|
|
|
MIIDcDCCAtmgAwIBAgIBATANBgkqhkiG9w0BAQQFADB3MQswCQYDVQQGEwJVUzET
|
|
|
|
MBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAgRXhhbXBsZSwg
|
|
|
|
THRkLjETMBEGA1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYOY2FAZXhh
|
|
|
|
bXBsZS5jb20wHhcNMDMxMDE3MTYzMTQwWhcNMDQxMDE2MTYzMTQwWjCBgjELMAkG
|
|
|
|
A1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExHzAdBgNVBAoTFk9wZW5MREFQ
|
|
|
|
IEV4YW1wbGUsIEx0ZC4xHTAbBgNVBAMUFEplbm5pZmVyICJKZW4iIFNtaXRoMR4w
|
|
|
|
HAYJKoZIhvcNAQkBFg9qZW5AZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD
|
|
|
|
gY0AMIGJAoGBANUgO8cP/SjqgCVxxsRYv36AP0+QL81iEkGvR4gG6jbtDDBdVYDC
|
|
|
|
YbS2oKKNJ5e99NxGMIjOYfmKcAwmkV46IhdzUtkutgjHEG9vl5ajSwc1KSsbTMTy
|
|
|
|
NtuG3k5k02JYFbP+FrGyUE8iPqK4+i7mVjW4bh/MBCHW88FptnpDJiuHAgMBAAGj
|
|
|
|
gf8wgfwwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0
|
|
|
|
ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFEdo4jpxCQXJ1sh/E1O3ZBkLTbHkMIGh
|
|
|
|
BgNVHSMEgZkwgZaAFEtvIRo2JNKQ+UOwU0ctfeHA5pgjoXukeTB3MQswCQYDVQQG
|
|
|
|
EwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAgRXhh
|
|
|
|
bXBsZSwgTHRkLjETMBEGA1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYO
|
|
|
|
Y2FAZXhhbXBsZS5jb22CAQAwDQYJKoZIhvcNAQEEBQADgYEAFpHsQUtSZQzmm9k2
|
|
|
|
Vrfs0h7tdkWF3LcHzHk4a/t3k4EXcqlHBxh4f0tmb4XNP9QupRgm6ggr8t3Rq0Vt
|
|
|
|
T8k50x4C7oE8HwZuEEB4FM7S1Zig3dfeJ8MJgdaLqt5/U9Ip/hZdzG2dsUsIceH/
|
|
|
|
5MCKLu9bGJUjsKnGdm/KpaNwaNo=
|
|
|
|
|
2004-04-22 06:14:01 +08:00
|
|
|
dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,dc=example,dc=com
|
2005-11-04 06:49:03 +08:00
|
|
|
changetype: modify
|
2003-10-18 10:39:08 +08:00
|
|
|
add: userCertificate;binary
|
|
|
|
userCertificate;binary::
|
|
|
|
MIIDjDCCAvWgAwIBAgIBAzANBgkqhkiG9w0BAQQFADB3MQswCQYDVQQGEwJVUzET
|
|
|
|
MBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAgRXhhbXBsZSwg
|
|
|
|
THRkLjETMBEGA1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYOY2FAZXhh
|
|
|
|
bXBsZS5jb20wHhcNMDMxMDE3MTYzNTM1WhcNMDQxMDE2MTYzNTM1WjCBnjELMAkG
|
|
|
|
A1UEBhMCVVMxETAPBgNVBAgTCE1pY2hpZ2FuMR8wHQYDVQQKExZPcGVuTERBUCBF
|
|
|
|
eGFtcGxlLCBMdGQuMRswGQYDVQQLExJBbHVt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A1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYO
|
|
|
|
Y2FAZXhhbXBsZS5jb22CAQAwDQYJKoZIhvcNAQEEBQADgYEAFpHsQUtSZQzmm9k2
|
|
|
|
Vrfs0h7tdkWF3LcHzHk4a/t3k4EXcqlHBxh4f0tmb4XNP9QupRgm6ggr8t3Rq0Vt
|
|
|
|
T8k50x4C7oE8HwZuEEB4FM7S1Zig3dfeJ8MJgdaLqt5/U9Ip/hZdzG2dsUsIceH/
|
|
|
|
5MCKLu9bGJUjsKnGdm/KpaNwaNo=
|
2003-10-17 10:15:50 +08:00
|
|
|
|
2005-11-04 06:49:03 +08:00
|
|
|
dn: cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com
|
|
|
|
changetype: modify
|
|
|
|
replace: userCertificate;binary
|
|
|
|
userCertificate;binary::
|
|
|
|
MIIDjDCCAvWgAwIBAgIBAzANBgkqhkiG9w0BAQQFADB3MQswCQYDVQQGEwJVUzET
|
|
|
|
MBEGA1UECBMKQ2FsaWZvcm5pYTEfMB0GA1UEChMWT3BlbkxEQVAgRXhhbXBsZSwg
|
|
|
|
THRkLjETMBEGA1UEAxMKRXhhbXBsZSBDQTEdMBsGCSqGSIb3DQEJARYOY2FAZXhh
|
|
|
|
bXBsZS5jb20wHhcNMDMxMDE3MTYzNTM1WhcNMDQxMDE2MTYzNTM1WjCBnjELMAkG
|
|
|
|
A1UEBhMCVVMxETAPBgNVBAgTCE1pY2hpZ2FuMR8wHQYDVQQKExZPcGVuTERBUCBF
|
|
|
|
eGFtcGxlLCBMdGQuMRswGQYDVQQLExJBbHVtbmkgQXNzb2ljYXRpb24xEjAQBgNV
|
|
|
|
BAMTCUplbiBTbWl0aDEqMCgGCSqGSIb3DQEJARYbamVuQG1haWwuYWx1bW5pLmV4
|
|
|
|
YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDpnXWAL0VkROGO
|
|
|
|
1Rg8J3u6F4F7yMqQCbUMsV9rxQisYj45+pmqiHV5urogvT4MGD6eLNFZKBn+0KRn
|
|
|
|
i++uu7gbartzpmBaHOlzRII9ZdVMFfrT2xYNgAlkne6pb6IZIN9UONuH/httENCD
|
|
|
|
J5WEpjZ48D1Lrml/HYO/W+SAMkpEqQIDAQABo4H/MIH8MAkGA1UdEwQCMAAwLAYJ
|
|
|
|
YIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1Ud
|
|
|
|
DgQWBBTB2saht/od/nis76b9m+pjxfhSPjCBoQYDVR0jBIGZMIGWgBRLbyEaNiTS
|
|
|
|
kPlDsFNHLX3hwOaYI6F7pHkwdzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlm
|
|
|
|
b3JuaWExHzAdBgNVBAoTFk9wZW5MREFQIEV4YW1wbGUsIEx0ZC4xEzARBgNVBAMT
|
|
|
|
CkV4YW1wbGUgQ0ExHTAbBgkqhkiG9w0BCQEWDmNhQGV4YW1wbGUuY29tggEAMA0G
|
|
|
|
CSqGSIb3DQEBBAUAA4GBAIoGPc/AS0cNkMRDNoMIzcFdF9lONMduKBiSuFvv+x8n
|
|
|
|
Cek+LUdXxF59V2NPKh2V5gFh5xbAchyv6FVBnpVtPdB5akCr5tdFQhuBLUXXDk/t
|
|
|
|
THGpIWt7OAjEmpuMzsz3GUB8Zf9rioHOs1DMw+GpzWdnFITxXhAqEDc3quqPrpxZ
|
|
|
|
-
|
|
|
|
delete: userCertificate;binary
|
|
|
|
|
2003-10-17 10:15:50 +08:00
|
|
|
EOMODS
|
|
|
|
|
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapmodify failed ($RC)!"
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-17 10:15:50 +08:00
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo 'Using ldapsearch to retrieve (userCertificate;binary=*) ...'
|
2003-10-18 10:39:08 +08:00
|
|
|
echo "# (userCertificate;binary=*)" > $SEARCHOUT
|
2003-10-22 13:14:08 +08:00
|
|
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
2003-10-18 10:39:08 +08:00
|
|
|
'(userCertificate;binary=*)' >> $SEARCHOUT 2>&1
|
2003-10-17 10:15:50 +08:00
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-17 10:15:50 +08:00
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
2003-10-18 10:39:08 +08:00
|
|
|
echo 'Using ldapsearch to retrieve (cAcertificate=*) ...'
|
|
|
|
echo "# (cAcertificate=*)" >> $SEARCHOUT
|
2003-10-22 13:14:08 +08:00
|
|
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
2003-10-18 10:39:08 +08:00
|
|
|
'(cAcertificate=*)' >> $SEARCHOUT 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-18 10:39:08 +08:00
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
|
|
|
SNAI='2$EMAIL=ca@example.com,CN=Example CA,O=Openldap Example\5C, Ltd.,ST=California,C=US'
|
|
|
|
|
2006-03-03 12:54:49 +08:00
|
|
|
echo 'Using ldapsearch to retrieve (userCertificate=serialNumberAndIssuer) [old format] ...'
|
|
|
|
echo "# (userCertificate=$SNAI)" >> $SEARCHOUT
|
|
|
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
|
|
|
"(userCertificate=$SNAI)" >> $SEARCHOUT 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
|
|
|
SNAI='{ serialNumber 2, issuer "EMAIL=ca@example.com,CN=Example CA,O=Openldap Example\5C, Ltd.,ST=California,C=US" }'
|
|
|
|
|
|
|
|
echo 'Using ldapsearch to retrieve (userCertificate=serialNumberAndIssuer) [new format] ...'
|
2003-10-18 10:39:08 +08:00
|
|
|
echo "# (userCertificate=$SNAI)" >> $SEARCHOUT
|
2003-10-22 13:14:08 +08:00
|
|
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
2003-10-18 10:39:08 +08:00
|
|
|
"(userCertificate=$SNAI)" >> $SEARCHOUT 2>&1
|
2003-10-17 10:15:50 +08:00
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-17 10:15:50 +08:00
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
2003-10-18 11:47:33 +08:00
|
|
|
SNAI='3$EMAIL=ca@example.com,CN=Example CA,O=Openldap Example\5C, Ltd.,ST=California,C=US'
|
|
|
|
|
2006-03-03 12:54:49 +08:00
|
|
|
echo 'Using ldapsearch to retrieve (userCertificate:certificateExactMatch:=serialNumberAndIssuer) [old format] ...'
|
2003-10-18 11:47:33 +08:00
|
|
|
echo "# (userCertificate:certificateExactMatch:=$SNAI)" >> $SEARCHOUT
|
2003-10-22 13:14:08 +08:00
|
|
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
2003-10-18 11:47:33 +08:00
|
|
|
"(userCertificate:certificateExactMatch:=$SNAI)" >> $SEARCHOUT 2>&1
|
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-18 11:47:33 +08:00
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
2006-03-03 12:54:49 +08:00
|
|
|
SNAI='{ issuer "EMAIL=ca@example.com,CN=Example CA,O=Openldap Example\5C, Ltd.,ST=California,C=US", serialNumber 3 }'
|
2003-10-18 12:20:19 +08:00
|
|
|
|
2006-03-03 12:54:49 +08:00
|
|
|
echo 'Using ldapsearch to retrieve (userCertificate:certificateExactMatch:=serialNumberAndIssuer) [new format]...'
|
|
|
|
echo "# (userCertificate:certificateExactMatch:=$SNAI)" >> $SEARCHOUT
|
2003-10-22 13:14:08 +08:00
|
|
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
|
2006-03-03 12:54:49 +08:00
|
|
|
"(userCertificate:certificateExactMatch:=$SNAI)" >> $SEARCHOUT 2>&1
|
2003-10-18 12:20:19 +08:00
|
|
|
RC=$?
|
|
|
|
if test $RC != 0 ; then
|
|
|
|
echo "ldapsearch failed ($RC)!"
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-18 12:20:19 +08:00
|
|
|
exit $RC
|
|
|
|
fi
|
|
|
|
|
2003-10-22 13:14:08 +08:00
|
|
|
test $KILLSERVERS != no && kill -HUP $KILLPIDS
|
2003-10-18 10:39:08 +08:00
|
|
|
|
2007-05-21 06:48:21 +08:00
|
|
|
LDIF=$CERTIFICATETLS
|
2003-10-17 10:15:50 +08:00
|
|
|
|
|
|
|
echo "Filtering ldapsearch results..."
|
2009-11-29 17:10:25 +08:00
|
|
|
$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
|
2003-10-17 10:15:50 +08:00
|
|
|
echo "Filtering original ldif used to create database..."
|
2009-11-29 17:10:25 +08:00
|
|
|
$LDIFFILTER < $LDIF > $LDIFFLT
|
2003-10-17 10:15:50 +08:00
|
|
|
echo "Comparing filter output..."
|
|
|
|
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
|
|
|
|
|
|
|
|
if test $? != 0 ; then
|
|
|
|
echo "comparison failed - certificate operations did not complete correctly"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ">>>>> Test succeeded"
|
2006-01-11 13:25:09 +08:00
|
|
|
|
|
|
|
test $KILLSERVERS != no && wait
|
|
|
|
|
2003-10-17 10:15:50 +08:00
|
|
|
exit 0
|