From 15dc6d0938826d99a66fc912e821a8ec5c52f7e6 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Sun, 22 Jan 2017 08:19:37 +0000 Subject: Update the TLS ALPN unit tests to work with internal/opaque data. --- regress/lib/libssl/unit/Makefile | 3 ++- regress/lib/libssl/unit/tls_ext_alpn.c | 21 +++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'regress/lib') diff --git a/regress/lib/libssl/unit/Makefile b/regress/lib/libssl/unit/Makefile index 48ae3963273..264bd2c3db3 100644 --- a/regress/lib/libssl/unit/Makefile +++ b/regress/lib/libssl/unit/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2016/12/30 16:58:12 jsing Exp $ +# $OpenBSD: Makefile,v 1.8 2017/01/22 08:19:36 jsing Exp $ TEST_CASES+= cipher_list TEST_CASES+= ssl_versions @@ -9,6 +9,7 @@ REGRESS_TARGETS= all_tests WARNINGS= Yes LDLIBS= ${SSL_INT} -lcrypto CFLAGS+= -DLIBRESSL_INTERNAL -Wall -Wundef -Werror +CFLAGS+= -I${.CURDIR}/../../../../lib/libssl CLEANFILES+= ${TEST_CASES} diff --git a/regress/lib/libssl/unit/tls_ext_alpn.c b/regress/lib/libssl/unit/tls_ext_alpn.c index e4ad2c5fd4f..7fd7afac5ac 100644 --- a/regress/lib/libssl/unit/tls_ext_alpn.c +++ b/regress/lib/libssl/unit/tls_ext_alpn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_ext_alpn.c,v 1.2 2016/12/18 13:54:15 jsing Exp $ */ +/* $OpenBSD: tls_ext_alpn.c,v 1.3 2017/01/22 08:19:36 jsing Exp $ */ /* * Copyright (c) 2015 Doug Hogan * @@ -21,12 +21,9 @@ #include #include -#include "tests.h" +#include "ssl_locl.h" -extern int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, - unsigned char *d, int n, int *al); -extern int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, - int n, int *al); +#include "tests.h" /* * In the ProtocolNameList, ProtocolNames must not include empty strings and @@ -346,9 +343,9 @@ check_valid_alpn(SSL *s) SSL_CTX_set_alpn_select_cb(s->ctx, dummy_alpn_cb, NULL); /* Prerequisites to test these. */ - CHECK(s->alpn_client_proto_list != NULL); - CHECK(s->ctx->alpn_select_cb != NULL); - CHECK(s->s3->tmp.finish_md_len == 0); + CHECK(s->internal->alpn_client_proto_list != NULL); + CHECK(s->ctx->internal->alpn_select_cb != NULL); + //CHECK(s->s3->tmp.finish_md_len == 0); CHECK_BOTH(1, 1, proto_single); CHECK_BOTH(1, 1, proto_empty); @@ -378,9 +375,9 @@ check_invalid_alpn(SSL *s) SSL_CTX_set_alpn_select_cb(s->ctx, dummy_alpn_cb, NULL); /* Prerequisites to test these. */ - CHECK(s->alpn_client_proto_list != NULL); - CHECK(s->ctx->alpn_select_cb != NULL); - CHECK(s->s3->tmp.finish_md_len == 0); + CHECK(s->internal->alpn_client_proto_list != NULL); + CHECK(s->ctx->internal->alpn_select_cb != NULL); + //CHECK(s->s3->tmp.finish_md_len == 0); /* None of these are valid for client or server */ CHECK_BOTH(0, 0, proto_invalid_len1); -- cgit v1.2.3