{ APP_CALLBACK_STRING, 0 };
SSL_CTX *c_ctx = NULL;
const SSL_METHOD *meth = NULL;
- SSL *c_ssl, *s_ssl;
+ SSL *c_ssl = NULL;
+ SSL *s_ssl = NULL;
int number = 1, reuse = 0;
int should_reuse = -1;
int no_ticket = 0;
c_ssl = SSL_new(c_ctx);
s_ssl = SSL_new(s_ctx);
+ if (c_ssl == NULL || s_ssl == NULL)
+ goto end;
if (sn_client)
SSL_set_tlsext_host_name(c_ssl, sn_client);
case BIO_IPV4:
case BIO_IPV6:
ret = EXIT_FAILURE;
- goto err;
+ goto end;
#endif
}
- if (ret != EXIT_SUCCESS) break;
+ if (ret != EXIT_SUCCESS)
+ break;
}
if (should_negotiate && ret == EXIT_SUCCESS &&
if (version < 0) {
BIO_printf(bio_err, "Error parsing: %s\n", should_negotiate);
ret = EXIT_FAILURE;
- goto err;
+ goto end;
}
if (SSL_version(c_ssl) != version) {
BIO_printf(bio_err, "Unexpected version negotiated. "
"Expected: %s, got %s\n", should_negotiate, SSL_get_version(c_ssl));
ret = EXIT_FAILURE;
- goto err;
+ goto end;
}
}
"Expected: %d, server: %d, client: %d\n", should_reuse,
SSL_session_reused(s_ssl), SSL_session_reused(c_ssl));
ret = EXIT_FAILURE;
- goto err;
+ goto end;
}
}
if (server_sess_out != NULL) {
if (write_session(server_sess_out, SSL_get_session(s_ssl)) == 0) {
ret = EXIT_FAILURE;
- goto err;
+ goto end;
}
}
if (client_sess_out != NULL) {
if (write_session(client_sess_out, SSL_get_session(c_ssl)) == 0) {
ret = EXIT_FAILURE;
- goto err;
+ goto end;
}
}
#endif
}
- err:
+ end:
SSL_free(s_ssl);
SSL_free(c_ssl);
-
- end:
SSL_CTX_free(s_ctx);
SSL_CTX_free(s_ctx2);
SSL_CTX_free(c_ctx);