1 testing the NISCC test cases
3 -- testing client certs, use good server cert --------
7 % rm -f ~/Library/Keychains/nisccServer
8 % certtool i server_crt.pem k=nisccServer r=server_key.pem c
10 2. Run server (from testcases dir)
12 % sslServer l k=nisccServer P=1300 a rootca.crt u=t
14 -- not u=t --> try auth
18 % sv localhost P=1300 H a rootca.crt
20 -- note 'H' - disable host name verify since server common name =
23 4. Set up client keychain
25 % rm -f ~/Library/Keychains/nisccClient
26 % certtool i client_crt.pem k=nisccClient r=client_key.pem c
30 % sv localhost P=1300 H a rootca.crt k=nisccClient
35 % pemtool d client_key.pem client_key.der
37 % rm -f ~/Library/Keychains/nisccClient
38 % certtool i simple_client/00035377 k=nisccClient r=client_key.der c
39 % sv localhost P=1300 H k=nisccClient x
41 ...note 'x' avoids client checking its own bogus cert, and we don't have to specify
44 result on client side = errSSLPeerCertUnknown
45 clientCertState = ClientCertRejected
47 result on server side = errSSLXCertChainInvalid
48 clientCertState = ClientCertRejected
50 7. Mods needed to uses these certs
52 -- modified dbTool to allow importing a bad cert (via DL/DB, not Sec*)
53 -- wrote simple client app, clxutils/NISCC/TLS_SSL/nisccSimpleClient
55 -- also SecureTransport needs the following mod to ignore bad certs on client side
57 ===================================================================
58 RCS file: /cvs/root/Security/SecureTransport/sslKeychain.cpp,v
59 retrieving revision 1.5
60 diff -u -r1.5 sslKeychain.cpp
61 --- sslKeychain.cpp 2003/04/25 19:40:18 1.5
62 +++ sslKeychain.cpp 2003/11/10 21:20:14
64 /* FIXME = release keyRef? */
66 /* obtain public key from cert */
68 + * FIXME : THIS IS TOTALLY UNNECESSARY WHEN PARSING OUR OWN CERTS, except
69 + * for the "separate signing and encryptionj certs" case. For now, to
70 + * facilitate NISCC testing, we ignore errors here.
72 ortn = SecCertificateGetCLHandle(certRef, &clHand);
74 sslErrorLog("parseIncomingCerts: SecCertificateGetCLHandle err %d\n",
76 certData.Data = thisSslCert->derCert.data;
77 certData.Length = thisSslCert->derCert.length;
78 crtn = CSSM_CL_CertGetKeyInfo(clHand, &certData, pubKey);
81 sslErrorLog("parseIncomingCerts: CSSM_CL_CertGetKeyInfo err\n");
82 return (OSStatus)crtn;
86 /* obtain keychain from key, CSP handle from keychain */
87 ortn = SecKeychainItemCopyKeychain((SecKeychainItemRef)keyRef, &kcRef);
91 ...with this in place cert 00070004 causes anything parsing it to get a seg fault.
97 1. Processing SEC_ASN1_SAVE, the destination item is mallocd once, with the length
98 of the top-level item to be saved. However data gets added to this item on a
99 leaf-by-leaf basis so that if the sizes of the leaves adds up to greater than
100 the stated/mallocd len of the otp-level item, overflow.
102 -- verified by disabling the SAVE in TBS_Cert
103 -- fixed using sec_asn1d_state.dest_alloc_len field to track alloc size in
108 certs known to crash the Panther Security.framework: