summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_sigalgs.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2019-01-23 18:39:28 +0000
committerbeck <beck@openbsd.org>2019-01-23 18:39:28 +0000
commit3e29903be5b61a4761d342f40d46936168baf59e (patch)
tree1c7d27a837601d150475c88fe2121c6774331db0 /lib/libssl/ssl_sigalgs.c
parentrevert previous, accidentally contained another diff in addition (diff)
downloadwireguard-openbsd-3e29903be5b61a4761d342f40d46936168baf59e.tar.xz
wireguard-openbsd-3e29903be5b61a4761d342f40d46936168baf59e.zip
Modify sigalgs extension processing to accomodate TLS 1.3.
- Make a separate sigalgs list for TLS 1.3 including only modern algorithm choices which we use when the handshake will not negotiate TLS 1.2. - Modify the legacy sigalgs for TLS 1.2 to include the RSA PSS algorithms as mandated by RFC8446 when the handshake will permit negotiation of TLS 1.2 from a 1.3 handshake. ok jsing@ tb@
Diffstat (limited to 'lib/libssl/ssl_sigalgs.c')
-rw-r--r--lib/libssl/ssl_sigalgs.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/libssl/ssl_sigalgs.c b/lib/libssl/ssl_sigalgs.c
index 182ea1edaae..041e940d8e6 100644
--- a/lib/libssl/ssl_sigalgs.c
+++ b/lib/libssl/ssl_sigalgs.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: ssl_sigalgs.c,v 1.13 2019/01/23 18:24:40 beck Exp $ */
+/* $OpenBSD: ssl_sigalgs.c,v 1.14 2019/01/23 18:39:28 beck Exp $ */
/*
- * Copyright (c) 2018, Bob Beck <beck@openbsd.org>
+ * Copyright (c) 2018-2019 Bob Beck <beck@openbsd.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -163,13 +163,30 @@ const struct ssl_sigalg sigalgs[] = {
},
};
+/* Sigalgs for tls 1.3, in preference order, */
+uint16_t tls13_sigalgs[] = {
+ SIGALG_RSA_PSS_RSAE_SHA512,
+ SIGALG_RSA_PKCS1_SHA512,
+ SIGALG_ECDSA_SECP512R1_SHA512,
+ SIGALG_RSA_PSS_RSAE_SHA384,
+ SIGALG_RSA_PKCS1_SHA384,
+ SIGALG_ECDSA_SECP384R1_SHA384,
+ SIGALG_RSA_PSS_RSAE_SHA256,
+ SIGALG_RSA_PKCS1_SHA256,
+ SIGALG_ECDSA_SECP256R1_SHA256,
+};
+size_t tls13_sigalgs_len = (sizeof(tls13_sigalgs) / sizeof(tls13_sigalgs[0]));
+
/* Sigalgs for tls 1.2, in preference order, */
uint16_t tls12_sigalgs[] = {
+ SIGALG_RSA_PSS_RSAE_SHA512,
SIGALG_RSA_PKCS1_SHA512,
SIGALG_ECDSA_SECP512R1_SHA512,
SIGALG_GOSTR12_512_STREEBOG_512,
+ SIGALG_RSA_PSS_RSAE_SHA384,
SIGALG_RSA_PKCS1_SHA384,
SIGALG_ECDSA_SECP384R1_SHA384,
+ SIGALG_RSA_PSS_RSAE_SHA256,
SIGALG_RSA_PKCS1_SHA256,
SIGALG_ECDSA_SECP256R1_SHA256,
SIGALG_GOSTR12_256_STREEBOG_256,