summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2017-02-05 15:06:05 +0000
committerjsing <>2017-02-05 15:06:05 +0000
commit8a1ec4c748b269fba0669ee71234ec9a0f128613 (patch)
treebf5d2956b9ee9caaa9c5a5e3dadb7cdc46f9c246
parent2456f6b516587fa3037de7c682735305ed02d053 (diff)
downloadopenbsd-8a1ec4c748b269fba0669ee71234ec9a0f128613.tar.gz
openbsd-8a1ec4c748b269fba0669ee71234ec9a0f128613.tar.bz2
openbsd-8a1ec4c748b269fba0669ee71234ec9a0f128613.zip
Define values for SSL_CTRL_SET_GROUPS{,_LIST} and wire them up to the
SSL_{,CTX_}ctrl() functions. As crazy as it is, some software appears to call the control functions directly rather than using the macros (or functions) provided by the library. Discussed with beck@ and sthen@
-rw-r--r--src/lib/libssl/s3_lib.c14
-rw-r--r--src/lib/libssl/ssl.h20
2 files changed, 19 insertions, 15 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c
index 108cc9f71e..fbc2d511d3 100644
--- a/src/lib/libssl/s3_lib.c
+++ b/src/lib/libssl/s3_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_lib.c,v 1.133 2017/01/26 12:16:13 beck Exp $ */ 1/* $OpenBSD: s3_lib.c,v 1.134 2017/02/05 15:06:05 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -2135,6 +2135,12 @@ ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
2135 ret = 1; 2135 ret = 1;
2136 break; 2136 break;
2137 2137
2138 case SSL_CTRL_SET_GROUPS:
2139 return SSL_set1_groups(s, parg, larg);
2140
2141 case SSL_CTRL_SET_GROUPS_LIST:
2142 return SSL_set1_groups_list(s, parg);
2143
2138 case SSL_CTRL_GET_SERVER_TMP_KEY: 2144 case SSL_CTRL_GET_SERVER_TMP_KEY:
2139 ret = ssl_ctrl_get_server_tmp_key(s, parg); 2145 ret = ssl_ctrl_get_server_tmp_key(s, parg);
2140 break; 2146 break;
@@ -2315,6 +2321,12 @@ ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
2315 ctx->extra_certs = NULL; 2321 ctx->extra_certs = NULL;
2316 break; 2322 break;
2317 2323
2324 case SSL_CTRL_SET_GROUPS:
2325 return SSL_CTX_set1_groups(ctx, parg, larg);
2326
2327 case SSL_CTRL_SET_GROUPS_LIST:
2328 return SSL_CTX_set1_groups_list(ctx, parg);
2329
2318 default: 2330 default:
2319 return (0); 2331 return (0);
2320 } 2332 }
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h
index 72de5c15a9..0789b914b7 100644
--- a/src/lib/libssl/ssl.h
+++ b/src/lib/libssl/ssl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl.h,v 1.126 2017/01/31 15:35:46 jsing Exp $ */ 1/* $OpenBSD: ssl.h,v 1.127 2017/02/05 15:06:05 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1120,6 +1120,9 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x);
1120#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82 1120#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
1121#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83 1121#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
1122 1122
1123#define SSL_CTRL_SET_GROUPS 91
1124#define SSL_CTRL_SET_GROUPS_LIST 92
1125
1123#define SSL_CTRL_SET_ECDH_AUTO 94 1126#define SSL_CTRL_SET_ECDH_AUTO 94
1124 1127
1125#define SSL_CTRL_GET_SERVER_TMP_KEY 109 1128#define SSL_CTRL_GET_SERVER_TMP_KEY 109
@@ -1175,19 +1178,8 @@ int SSL_set1_groups(SSL *ssl, const int *groups, size_t groups_len);
1175int SSL_set1_groups_list(SSL *ssl, const char *groups); 1178int SSL_set1_groups_list(SSL *ssl, const char *groups);
1176 1179
1177#ifndef LIBRESSL_INTERNAL 1180#ifndef LIBRESSL_INTERNAL
1178/* 1181#define SSL_CTRL_SET_CURVES SSL_CTRL_SET_GROUPS
1179 * Preprocessor compatibility section. 1182#define SSL_CTRL_SET_CURVES_LIST SSL_CTRL_SET_GROUPS_LIST
1180 *
1181 * Historically, a number of APIs were implemented in OpenSSL as macros and
1182 * constants to 'ctrl' functions. To avoid breaking #ifdefs in consumers, this
1183 * section defines a number of legacy macros.
1184 *
1185 * Although using either the CTRL values or their wrapper macros in #ifdefs is
1186 * still supported, the CTRL values may not be passed to SSL_ctrl and
1187 * SSL_CTX_ctrl. Call the functions (previously wrapper macros) instead.
1188 */
1189#define SSL_CTRL_SET_CURVES doesnt_exist
1190#define SSL_CTRL_SET_CURVES_LIST doesnt_exist
1191 1183
1192#define SSL_CTX_set1_curves SSL_CTX_set1_groups 1184#define SSL_CTX_set1_curves SSL_CTX_set1_groups
1193#define SSL_CTX_set1_curves_list SSL_CTX_set1_groups_list 1185#define SSL_CTX_set1_curves_list SSL_CTX_set1_groups_list