From 92b07bc18d2af04ab6c259d7550c9281ce53f388 Mon Sep 17 00:00:00 2001 From: cameronrich Date: Sun, 9 May 2010 09:18:03 +0000 Subject: [PATCH] changed test for ssl_renegotiation failure git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@173 9a5d90b5-6617-0410-8a86-bb477d3ed2e3 --- ssl/test/ssltest.c | 20 ++++++++++++-------- ssl/x509.c | 1 - 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ssl/test/ssltest.c b/ssl/test/ssltest.c index bdc3f8d36..2ea473fba 100644 --- a/ssl/test/ssltest.c +++ b/ssl/test/ssltest.c @@ -1352,7 +1352,7 @@ static int SSL_client_test( /* renegotiate client */ if (sess_resume && sess_resume->do_reneg) { - if (ssl_renegotiate(ssl) < 0) + if ((ret = ssl_renegotiate(ssl)) < 0) goto client_test_exit; } @@ -1451,12 +1451,16 @@ int SSL_client_tests(void) // no client renegotiation // TODO: this was causing a lock-up on x509_free() -// sess_resume.do_reneg = 1; -// if ((ret = SSL_client_test("Client renegotiation", -// &ssl_ctx, NULL, &sess_resume, -// DEFAULT_CLNT_OPTION, NULL, NULL, NULL))) -// goto cleanup; -// sess_resume.do_reneg = 0; + sess_resume.do_reneg = 1; + if ((ret = SSL_client_test("Client renegotiation", + &ssl_ctx, NULL, &sess_resume, + DEFAULT_CLNT_OPTION, NULL, NULL, NULL)) != + -SSL_ALERT_NO_RENEGOTIATION) + { + printf("*** Error: %d\n", ret); TTY_FLUSH(); + goto cleanup; + } + sess_resume.do_reneg = 0; sess_resume.stop_server = 1; if ((ret = SSL_client_test("Client session resumption #2", @@ -1527,7 +1531,7 @@ int SSL_client_tests(void) DEFAULT_CLNT_OPTION|SSL_SERVER_VERIFY_LATER, NULL, NULL, NULL)) != SSL_X509_ERROR(X509_VFY_ERROR_EXPIRED)) { - printf("*** Error: %d\n", ret); + printf("*** Error: %d\n", ret); TTY_FLUSH(); goto cleanup; } diff --git a/ssl/x509.c b/ssl/x509.c index 595585b55..dcdea04f1 100644 --- a/ssl/x509.c +++ b/ssl/x509.c @@ -252,7 +252,6 @@ void x509_free(X509_CTX *x509_ctx) #endif RSA_free(x509_ctx->rsa_ctx); - next = x509_ctx->next; free(x509_ctx); x509_free(next); /* clear the chain */