X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fhandshake_helper.c;h=c7023fe0f25fcc77b1fcb5a0267f3e8deaf6c8cd;hp=c4f298e9454f8cb2557ff01621a699d1883cb578;hb=620c6ad3125d7631f08c37033d1cb4302aef819a;hpb=590ed3d7ea555b877859f6b491020112588fe1be diff --git a/test/handshake_helper.c b/test/handshake_helper.c index c4f298e945..c7023fe0f2 100644 --- a/test/handshake_helper.c +++ b/test/handshake_helper.c @@ -164,6 +164,7 @@ static int do_not_call_session_ticket_cb(SSL *s, unsigned char *key_name, return 0; } +#ifndef OPENSSL_NO_NEXTPROTONEG /* Parse the comma-separated list into TLS format. */ static void parse_protos(const char *protos, unsigned char **out, size_t *outlen) { @@ -260,7 +261,7 @@ static int server_alpn_cb(SSL *s, const unsigned char **out, return ret == OPENSSL_NPN_NEGOTIATED ? SSL_TLSEXT_ERR_OK : SSL_TLSEXT_ERR_NOACK; } - +#endif /* * Configure callbacks and other properties that can't be set directly @@ -315,6 +316,7 @@ static void configure_handshake_ctx(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, if (test_ctx->session_ticket_expected == SSL_TEST_SESSION_TICKET_BROKEN) { SSL_CTX_set_tlsext_ticket_key_cb(server_ctx, broken_session_ticket_cb); } +#ifndef OPENSSL_NO_NEXTPROTONEG if (test_ctx->server_npn_protocols != NULL) { parse_protos(test_ctx->server_npn_protocols, &server_ctx_data->npn_protocols, @@ -360,6 +362,7 @@ static void configure_handshake_ctx(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, alpn_protos_len) == 0); OPENSSL_free(alpn_protos); } +#endif /* * Use fixed session ticket keys so that we can decrypt a ticket created with * one CTX in another CTX. Don't address server2 for the moment. @@ -496,6 +499,7 @@ static handshake_status_t handshake_status(peer_status_t last_status, return INTERNAL_ERROR; } +#ifndef OPENSSL_NO_NEXTPROTONEG /* Convert unsigned char buf's that shouldn't contain any NUL-bytes to char. */ static char *dup_str(const unsigned char *in, size_t len) { @@ -510,6 +514,7 @@ static char *dup_str(const unsigned char *in, size_t len) OPENSSL_assert(ret != NULL); return ret; } +#endif static HANDSHAKE_RESULT *do_handshake_internal( SSL_CTX *server_ctx, SSL_CTX *server2_ctx, SSL_CTX *client_ctx, @@ -527,9 +532,11 @@ static HANDSHAKE_RESULT *do_handshake_internal( unsigned char* tick = NULL; size_t tick_len = 0; SSL_SESSION* sess = NULL; +#ifndef OPENSSL_NO_NEXTPROTONEG const unsigned char *proto = NULL; /* API dictates unsigned int rather than size_t. */ unsigned int proto_len = 0; +#endif memset(&server_ctx_data, 0, sizeof(server_ctx_data)); memset(&server2_ctx_data, 0, sizeof(server2_ctx_data)); @@ -644,6 +651,7 @@ static HANDSHAKE_RESULT *do_handshake_internal( ret->session_ticket = SSL_TEST_SESSION_TICKET_YES; ret->session_ticket_do_not_call = server_ex_data.session_ticket_do_not_call; +#ifndef OPENSSL_NO_NEXTPROTONEG SSL_get0_next_proto_negotiated(client, &proto, &proto_len); ret->client_npn_negotiated = dup_str(proto, proto_len); @@ -655,6 +663,7 @@ static HANDSHAKE_RESULT *do_handshake_internal( SSL_get0_alpn_selected(server, &proto, &proto_len); ret->server_alpn_negotiated = dup_str(proto, proto_len); +#endif ret->client_resumed = SSL_session_reused(client); ret->server_resumed = SSL_session_reused(server); @@ -673,6 +682,7 @@ static HANDSHAKE_RESULT *do_handshake_internal( HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, SSL_CTX *client_ctx, SSL_CTX *resume_server_ctx, + SSL_CTX *resume_client_ctx, const SSL_TEST_CTX *test_ctx) { HANDSHAKE_RESULT *result; @@ -692,8 +702,8 @@ HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, HANDSHAKE_RESULT_free(result); /* We don't support SNI on second handshake yet, so server2_ctx is NULL. */ - result = do_handshake_internal(resume_server_ctx, NULL, client_ctx, test_ctx, - session, NULL); + result = do_handshake_internal(resume_server_ctx, NULL, resume_client_ctx, + test_ctx, session, NULL); end: SSL_SESSION_free(session); return result;