diff options
author | Ben Laurie <ben@links.org> | 2016-07-31 11:42:04 +0100 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2016-08-01 11:30:33 +0100 |
commit | 620c6ad3125d7631f08c37033d1cb4302aef819a (patch) | |
tree | 27e39f0292c5566f0d2887e38fe8126bce5b66b6 /test/handshake_helper.c | |
parent | 087d3e89932e00eede95353fbd988e2752bc2468 (diff) |
Fix various no-*s.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/handshake_helper.c')
-rw-r--r-- | test/handshake_helper.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/handshake_helper.c b/test/handshake_helper.c index eecc6f762c..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); |