separate allow scr and force client scr in example client

This commit is contained in:
toddouska
2014-09-29 15:32:41 -07:00
parent dcde28db51
commit f81f22799a

View File

@@ -136,7 +136,8 @@ static void Usage(void)
printf("-N Use Non-blocking sockets\n"); printf("-N Use Non-blocking sockets\n");
printf("-r Resume session\n"); printf("-r Resume session\n");
#ifdef HAVE_SECURE_RENEGOTIATION #ifdef HAVE_SECURE_RENEGOTIATION
printf("-R Secure Renegotiation\n"); printf("-R Allow Secure Renegotiation\n");
printf("-i Force client Initiated Secure Renegotiation\n");
#endif #endif
printf("-f Fewer packets/group messages\n"); printf("-f Fewer packets/group messages\n");
printf("-x Disable client cert/key loading\n"); printf("-x Disable client cert/key loading\n");
@@ -196,7 +197,8 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args)
int doPeerCheck = 1; int doPeerCheck = 1;
int nonBlocking = 0; int nonBlocking = 0;
int resumeSession = 0; int resumeSession = 0;
int scr = 0; /* secure renegotiation */ int scr = 0; /* allow secure renegotiation */
int forceScr = 0; /* force client initiaed scr */
int trackMemory = 0; int trackMemory = 0;
int useClientCert = 1; int useClientCert = 1;
int fewerPackets = 0; int fewerPackets = 0;
@@ -241,11 +243,12 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args)
(void)atomicUser; (void)atomicUser;
(void)pkCallbacks; (void)pkCallbacks;
(void)scr; (void)scr;
(void)forceScr;
StackTrap(); StackTrap();
while ((ch = mygetopt(argc, argv, while ((ch = mygetopt(argc, argv,
"?gdDusmNrRtfxUPh:p:v:l:A:c:k:b:zS:L:ToO:")) != -1) { "?gdDusmNrRitfxUPh:p:v:l:A:c:k:b:zS:L:ToO:")) != -1) {
switch (ch) { switch (ch) {
case '?' : case '?' :
Usage(); Usage();
@@ -360,6 +363,13 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args)
#endif #endif
break; break;
case 'i' :
#ifdef HAVE_SECURE_RENEGOTIATION
scr = 1;
forceScr = 1;
#endif
break;
case 'z' : case 'z' :
#ifndef CYASSL_LEANPSK #ifndef CYASSL_LEANPSK
CyaSSL_GetObjectSize(); CyaSSL_GetObjectSize();
@@ -690,7 +700,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args)
showPeer(ssl); showPeer(ssl);
#ifdef HAVE_SECURE_RENEGOTIATION #ifdef HAVE_SECURE_RENEGOTIATION
if (scr) { if (scr && forceScr) {
if (nonBlocking) { if (nonBlocking) {
printf("not doing secure renegotiation on example with" printf("not doing secure renegotiation on example with"
" nonblocking yet"); " nonblocking yet");