#include "utilities/fileIo.h"
#include "utilities/SecCFWrappers.h"
#include "utilities/SecIOFormat.h"
-#include "SecurityTool/print_cert.h"
+#include "SecurityTool/sharedTool/print_cert.h"
#define DEFAULT_GETMSG "GET"
#define DEFAULT_PATH "/"
}
SecTrustResultType secTrustResult;
- ortn = SecTrustEvaluate(secTrust, &secTrustResult);
+ ortn = SecTrustGetTrustResult(secTrust, &secTrustResult); // implicitly does trust evaluate
if(ortn) {
printf("\n***Error on SecTrustEvaluate: %d\n", (int)ortn);
return ortn;
}
}
} else {
- SSLSetProtocolVersionMax(ctx, pargs->tryVersion);
+ ortn = SSLSetProtocolVersionMax(ctx, pargs->tryVersion);
+ if(ortn) {
+ printSslErrStr("SSLSetProtocolVersionMax", ortn);
+ goto cleanup;
+ }
}
if(pargs->resumableEnable) {
/*
* always do close, even on error - to flush outgoing write queue
*/
- OSStatus cerr = SSLClose(ctx);
+ OSStatus cerr = errSecParam;
+ if (ctx) {
+ cerr = SSLClose(ctx);
+ }
if(ortn == errSecSuccess) {
ortn = cerr;
}
sslGetProtocolVersionString(pargs->negVersion));
printf(" Negotiated CipherSuite : %s\n",
sslGetCipherSuiteString(pargs->negCipher));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if(pargs->certState != kSSLClientCertNone) {
printf(" Client Cert State : %s\n",
sslGetClientCertStateString(pargs->certState));
}
+#pragma clang diagnostic pop
if(pargs->verbose) {
printf(" Resumed Session : ");
if(pargs->sessionWasResumed) {
char c, // 2, 3, t
char **argv)
{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
switch(c) {
case '2':
return kSSLProtocol2;
default:
usage(argv);
}
+#pragma clang diagnostic pop
}
int main(int argc, char **argv)
bool doPause = false;
bool pauseFirstLoop = false;
bool verifyProt = false;
- SSLProtocol maxProtocol = kTLSProtocol12; // for verifying negotiated
- // protocol
char *acceptedProts = NULL;
char *keyChainName = NULL;
char *getMsgSpec = NULL;
bool vfyCertState = false;
- SSLClientCertificateState expectCertState = kSSLClientCertNone;
bool displayHandshakeTimes = false;
bool completeCertChain = false;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ SSLClientCertificateState expectCertState = kSSLClientCertNone;
+ SSLProtocol maxProtocol = kTLSProtocol12; // for verifying negotiated protocol
+#pragma clang diagnostic pop
/* special case - one arg of "h" or "-h" or "hv" */
if(argc == 2) {
usage(argv);
}
vfyCertState = true;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
switch(argp[2]) {
case 'n':
expectCertState = kSSLClientCertNone;
default:
usage(argv);
}
+#pragma clang diagnostic pop
break;
case 'z':
pargs.password = &argp[2];
sigaction(SIGPIPE, &sa, NULL);
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
for(loop=0; loop<loopCount; loop++) {
/*
* One pass for each protocol version, skipping any explicit version if
}
}
} /* main loop */
+#pragma clang diagnostic pop
+
if(displayHandshakeTimes) {
CFAbsoluteTime totalTime;
unsigned numHandshakes;