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

View File

@ -1239,7 +1239,7 @@ int basic_read(SSL *ssl, uint8_t **in_data)
ssl->dc->bm_proc_index = 0;
ret = do_handshake(ssl, buf, read_len);
}
else /* no client renogiation allowed */
else /* no client renegotiation allowed */
{
ret = SSL_ERROR_NO_CLIENT_RENOG;
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:
ret = process_finished(ssl, hs_len);
disposable_free(ssl); /* free up some memory */
/* note: client renogiation is not allowed after this */
/* note: client renegotiation is not allowed after this */
break;
case HS_HELLO_REQUEST:
@ -146,7 +146,6 @@ int do_client_connect(SSL *ssl)
ssl->bm_read_index = 0;
ssl->next_state = HS_SERVER_HELLO;
ssl->hs_status = SSL_NOT_OK; /* not connected */
x509_free(ssl->x509_ctx);
/* sit in a loop until it all looks good */
while (ssl->hs_status != SSL_OK)