const char *acceptedProts,
CFArrayRef serverCerts, // required
char *password, // optional
- CFArrayRef encryptServerCerts, // optional
bool allowExpired,
bool allowAnyRoot,
bool allowExpiredRoot,
goto cleanup;
}
}
- if(encryptServerCerts) {
- ortn = SSLSetEncryptionCertificate(ctx, encryptServerCerts);
- if(ortn) {
- printSslErrStr("SSLSetEncryptionCertificate", ortn);
- goto cleanup;
- }
- }
if(allowExpiredRoot) {
ortn = SSLSetAllowsExpiredRoots(ctx, true);
if(ortn) {
for(i=0; i<numCerts; i++) {
sprintf(fileName, "%s%02d.cer", fileBase, (int)i);
certRef = (SecCertificateRef)CFArrayGetValueAtIndex(peerCerts, i);
- writeFile(fileName, SecCertificateGetBytePtr(certRef),
+ writeFileSizet(fileName, SecCertificateGetBytePtr(certRef),
SecCertificateGetLength(certRef));
}
printf("...wrote %lu certs to fileBase %s\n", numCerts, fileBase);
char *argp;
otSocket listenSock;
CFArrayRef serverCerts = nil; // required
- CFArrayRef encryptCerts = nil; // optional
SecKeychainRef serverKc = nil;
- SecKeychainRef encryptKc = nil;
int loopNum;
int errCount = 0;
SSLClientCertificateState certState; // obtained from sslServe
bool resumableEnable = true;
bool pause = false;
char *keyChainName = NULL;
- char *encryptKeyChainName = NULL;
int loops = 1;
SSLAuthenticate authenticate = kNeverAuthenticate;
bool nonBlocking = false;
case 'k':
keyChainName = &argp[2];
break;
- case 'y':
- encryptKeyChainName = &argp[2];
- break;
case 'e':
allowExpired = true;
break;
/* oh well */
}
}
- if(encryptKeyChainName) {
- encryptCerts = getSslCerts(encryptKeyChainName, true, completeCertChain,
- anchorFile, &encryptKc);
- if(encryptCerts == nil) {
- exit(1);
- }
- }
#else
(void) doIdSearch;
- (void) encryptKeyChainName;
#endif
if(protXOnly) {
switch(attemptProt) {
acceptedProts,
serverCerts,
password,
- encryptCerts,
allowExpired,
allowAnyRoot,
allowExpiredRoot,
if(serverKc) {
CFRelease(serverKc);
}
- if(encryptKc) {
- CFRelease(encryptKc);
- }
return errCount;
}