summaryrefslogtreecommitdiff
path: root/src/lib/libssl/Makefile
diff options
context:
space:
mode:
authorjsing <>2024-06-25 14:10:45 +0000
committerjsing <>2024-06-25 14:10:45 +0000
commitdd9ce93fac0548a1fd292d2d756a968f576f40de (patch)
tree63af5f2e95c5104b6713eeb3528306b47ecc203a /src/lib/libssl/Makefile
parent16d1647aeb8144aecd31b377e554c6f23fe7912a (diff)
downloadopenbsd-dd9ce93fac0548a1fd292d2d756a968f576f40de.tar.gz
openbsd-dd9ce93fac0548a1fd292d2d756a968f576f40de.tar.bz2
openbsd-dd9ce93fac0548a1fd292d2d756a968f576f40de.zip
Implement RSA key exchange in constant time.
RSA key exchange is known to have multiple security weaknesses, including being potentially susceptible to padding oracle and timing attacks. The RSA key exchange code that we inherited from OpenSSL was riddled with timing leaks, many of which we fixed (or minimised) early on. However, a number of issues still remained, particularly those related to libcrypto's RSA decryption and padding checks. Rework the RSA key exchange code such that we decrypt with RSA_NO_PADDING and then check the padding ourselves in constant time. In this case, the pre-master secret is of a known length, hence the padding is also a known length based on the size of the RSA key. This makes it easy to implement a check that is much safer than having RSA_private_decrypt() depad for us. Regardless, we still strongly recommend disabling RSA key exchange and using other key exchange methods that provide perfect forward secrecy and do not depend on client generated keys. Thanks to Marcel Maehren, Nurullah Erinola, Robert Merget, Juraj Somorovsky, Joerg Schwenk and Hubert Kario for raising these issues with us at various points in time. ok tb@
Diffstat (limited to 'src/lib/libssl/Makefile')
-rw-r--r--src/lib/libssl/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libssl/Makefile b/src/lib/libssl/Makefile
index 38e5ba30e0..a2b710922d 100644
--- a/src/lib/libssl/Makefile
+++ b/src/lib/libssl/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.81 2023/11/22 15:55:28 tb Exp $ 1# $OpenBSD: Makefile,v 1.82 2024/06/25 14:10:45 jsing Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4.ifndef NOMAN 4.ifndef NOMAN
@@ -23,6 +23,7 @@ CFLAGS+= -DLIBRESSL_NAMESPACE
23CFLAGS+= -DTLS13_DEBUG 23CFLAGS+= -DTLS13_DEBUG
24.endif 24.endif
25CFLAGS+= -I${.CURDIR} 25CFLAGS+= -I${.CURDIR}
26CFLAGS+= -I${.CURDIR}/../libcrypto
26CFLAGS+= -I${.CURDIR}/../libcrypto/hidden 27CFLAGS+= -I${.CURDIR}/../libcrypto/hidden
27CFLAGS+= -I${.CURDIR}/../libcrypto/bio 28CFLAGS+= -I${.CURDIR}/../libcrypto/bio
28CFLAGS+= -I${.CURDIR}/hidden 29CFLAGS+= -I${.CURDIR}/hidden