-/* $OpenBSD: ssl_lib.c,v 1.297 2022/07/20 13:57:49 tb Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.298 2022/07/20 14:08:49 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include "dtls_locl.h"
#include "ssl_locl.h"
#include "ssl_sigalgs.h"
+#include "ssl_tlsext.h"
const char *SSL_version_str = OPENSSL_VERSION_TEXT;
CBS_init(&cbs, protos, protos_len);
+ if (protos_len > 0) {
+ if (!tlsext_alpn_check_format(&cbs))
+ goto err;
+ }
+
if (!CBS_stow(&cbs, &ctx->internal->alpn_client_proto_list,
&ctx->internal->alpn_client_proto_list_len))
goto err;
CBS_init(&cbs, protos, protos_len);
+ if (protos_len > 0) {
+ if (!tlsext_alpn_check_format(&cbs))
+ goto err;
+ }
+
if (!CBS_stow(&cbs, &ssl->internal->alpn_client_proto_list,
&ssl->internal->alpn_client_proto_list_len))
goto err;