summaryrefslogtreecommitdiff
path: root/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2020-08-09 16:25:55 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2020-08-09 16:25:55 +0000
commit50e74fde85cc9e0c1c37f9ba212f06c367d220ba (patch)
tree8e588b10c9bb709024b7eb179a6b4f74e346a0ca /lib/libssl/t1_lib.c
parent30891c8bee6b18e32011392886614a14f2545182 (diff)
Add P-521 to the list of curves supported by default in the client.
A certain VPN provider appears to have configured their servers to only accept P-521 for TLSv1.3 key exchange. The particular VPN software in use also does not currently allow for the TLSv1.3 key share groups to be configured, which means that there is no way to easily use LibreSSL in this situation. Include P-521 in the list of curves that are supported by default in the client, in order to increase interoperability. Discussed at length with beck@, inoguchi@ and tb@. ok tb@
Diffstat (limited to 'lib/libssl/t1_lib.c')
-rw-r--r--lib/libssl/t1_lib.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c
index 6a2b082d021..1191f9201e9 100644
--- a/lib/libssl/t1_lib.c
+++ b/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t1_lib.c,v 1.168 2020/07/07 19:31:11 jsing Exp $ */
+/* $OpenBSD: t1_lib.c,v 1.169 2020/08/09 16:25:54 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -242,7 +242,14 @@ static const uint16_t eccurves_list[] = {
};
#endif
-static const uint16_t eccurves_default[] = {
+static const uint16_t eccurves_client_default[] = {
+ 29, /* X25519 (29) */
+ 23, /* secp256r1 (23) */
+ 24, /* secp384r1 (24) */
+ 25, /* secp521r1 (25) */
+};
+
+static const uint16_t eccurves_server_default[] = {
29, /* X25519 (29) */
23, /* secp256r1 (23) */
24, /* secp384r1 (24) */
@@ -366,9 +373,15 @@ tls1_get_group_list(SSL *s, int client_groups, const uint16_t **pgroups,
*pgroups = s->internal->tlsext_supportedgroups;
*pgroupslen = s->internal->tlsext_supportedgroups_length;
- if (*pgroups == NULL) {
- *pgroups = eccurves_default;
- *pgroupslen = sizeof(eccurves_default) / 2;
+ if (*pgroups != NULL)
+ return;
+
+ if (!s->server) {
+ *pgroups = eccurves_client_default;
+ *pgroupslen = sizeof(eccurves_client_default) / 2;
+ } else {
+ *pgroups = eccurves_server_default;
+ *pgroupslen = sizeof(eccurves_server_default) / 2;
}
}