1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

removed redundant x509_free() in do_client_connect()

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@176 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich 2010-08-07 07:34:41 +00:00
parent 09e79822d5
commit c69b6901fb
3 changed files with 15 additions and 16 deletions

View File

@ -1352,8 +1352,12 @@ static int SSL_client_test(
/* renegotiate client */ /* renegotiate client */
if (sess_resume && sess_resume->do_reneg) if (sess_resume && sess_resume->do_reneg)
{ {
if ((ret = ssl_renegotiate(ssl)) < 0) if (ssl_renegotiate(ssl) == -SSL_ALERT_NO_RENEGOTIATION)
goto client_test_exit; ret = 0;
else
ret = -SSL_ALERT_NO_RENEGOTIATION;
goto client_test_exit;
} }
if (sess_resume) if (sess_resume)
@ -1450,16 +1454,13 @@ int SSL_client_tests(void)
goto cleanup; goto cleanup;
// no client renegotiation // no client renegotiation
//sess_resume.do_reneg = 1; sess_resume.do_reneg = 1;
//if ((ret = SSL_client_test("Client renegotiation", // test relies on openssl killing the call
// &ssl_ctx, NULL, &sess_resume, if ((ret = SSL_client_test("Client renegotiation",
// DEFAULT_CLNT_OPTION, NULL, NULL, NULL)) != &ssl_ctx, NULL, &sess_resume,
// -SSL_ALERT_NO_RENEGOTIATION) DEFAULT_CLNT_OPTION, NULL, NULL, NULL)))
//{ goto cleanup;
// printf("*** Error: %d\n", ret); TTY_FLUSH(); sess_resume.do_reneg = 0;
// goto cleanup;
//}
//sess_resume.do_reneg = 0;
sess_resume.stop_server = 1; sess_resume.stop_server = 1;
if ((ret = SSL_client_test("Client session resumption #2", if ((ret = SSL_client_test("Client session resumption #2",
@ -1579,7 +1580,6 @@ static void do_basic(void)
/* check the return status */ /* check the return status */
if (ssl_handshake_status(ssl_clnt) < 0) if (ssl_handshake_status(ssl_clnt) < 0)
{ {
printf("YA YA\n");
ssl_display_error(ssl_handshake_status(ssl_clnt)); ssl_display_error(ssl_handshake_status(ssl_clnt));
goto error; goto error;
} }

View File

@ -1239,7 +1239,7 @@ int basic_read(SSL *ssl, uint8_t **in_data)
ssl->dc->bm_proc_index = 0; ssl->dc->bm_proc_index = 0;
ret = do_handshake(ssl, buf, read_len); ret = do_handshake(ssl, buf, read_len);
} }
else /* no client renogiation allowed */ else /* no client renegotiation allowed */
{ {
ret = SSL_ERROR_NO_CLIENT_RENOG; ret = SSL_ERROR_NO_CLIENT_RENOG;
goto error; goto error;

View File

@ -123,7 +123,7 @@ int do_clnt_handshake(SSL *ssl, int handshake_type, uint8_t *buf, int hs_len)
case HS_FINISHED: case HS_FINISHED:
ret = process_finished(ssl, hs_len); ret = process_finished(ssl, hs_len);
disposable_free(ssl); /* free up some memory */ disposable_free(ssl); /* free up some memory */
/* note: client renogiation is not allowed after this */ /* note: client renegotiation is not allowed after this */
break; break;
case HS_HELLO_REQUEST: case HS_HELLO_REQUEST:
@ -146,7 +146,6 @@ int do_client_connect(SSL *ssl)
ssl->bm_read_index = 0; ssl->bm_read_index = 0;
ssl->next_state = HS_SERVER_HELLO; ssl->next_state = HS_SERVER_HELLO;
ssl->hs_status = SSL_NOT_OK; /* not connected */ ssl->hs_status = SSL_NOT_OK; /* not connected */
x509_free(ssl->x509_ctx);
/* sit in a loop until it all looks good */ /* sit in a loop until it all looks good */
while (ssl->hs_status != SSL_OK) while (ssl->hs_status != SSL_OK)