From 1b6ff71b2a946cae5bc66d35e353ac5efc5de815 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 17 Aug 2022 18:43:17 +0000 Subject: [PATCH] Add SSL_get_shared_{curve,group}() These are wrappers of SSL_ctrl() using the SSL_CTRL_GET_SHARED_GROUP control. Do not provide SSL_CTRL_GET_SHARED_CURVE since that is only mentioned in Net::SSLeay docs according to codesearch.debian.net. ok jsing --- lib/libssl/ssl.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h index 14fb094e712..e649a6972ee 100644 --- a/lib/libssl/ssl.h +++ b/lib/libssl/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.222 2022/07/24 14:16:29 jsing Exp $ */ +/* $OpenBSD: ssl.h,v 1.223 2022/08/17 18:43:17 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -930,7 +930,9 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x); #define SSL_CTRL_SET_GROUPS 91 #define SSL_CTRL_SET_GROUPS_LIST 92 - +#if defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL) +#define SSL_CTRL_GET_SHARED_GROUP 93 +#endif #define SSL_CTRL_SET_ECDH_AUTO 94 #if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) @@ -1047,6 +1049,12 @@ const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx); #define SSL_CTX_clear_extra_chain_certs(ctx) \ SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS, 0, NULL) +#if defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL) +#define SSL_get_shared_group(s, n) \ + SSL_ctrl((s), SSL_CTRL_GET_SHARED_GROUP, (n), NULL) +#define SSL_get_shared_curve SSL_get_shared_group +#endif + #define SSL_get_server_tmp_key(s, pk) \ SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk) -- 2.20.1