summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-10-20 15:18:54 +0000
committertb <>2022-10-20 15:18:54 +0000
commit06d46a56a0e6f5c4b81f1aee0f3f5d2b1d7dd107 (patch)
treea21f86416f0f025c43281497d27f32c9b182114b /src
parent4ec7d3d391f9e006f388e4e281fb789c8fc3ff62 (diff)
downloadopenbsd-06d46a56a0e6f5c4b81f1aee0f3f5d2b1d7dd107.tar.gz
openbsd-06d46a56a0e6f5c4b81f1aee0f3f5d2b1d7dd107.tar.bz2
openbsd-06d46a56a0e6f5c4b81f1aee0f3f5d2b1d7dd107.zip
Annotate misuse of EVP_Digest()
The session_id member of SSL_SESSION has 32 bytes for historical reasons. This precisely accommodates a SHA-256 and is currently computed using this hash. If the hash function is ever changed, this will likely overflow. This should be fixed in code. Leave it at an XXX comment for now. Pointed out by jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl_clnt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index d5791e3ffc..9cedc084ab 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.155 2022/10/02 16:36:41 jsing Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.156 2022/10/20 15:18:54 tb 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 *
@@ -1647,6 +1647,7 @@ ssl3_get_new_session_ticket(SSL *s)
1647 * assumptions elsewhere in OpenSSL. The session ID is set 1647 * assumptions elsewhere in OpenSSL. The session ID is set
1648 * to the SHA256 hash of the ticket. 1648 * to the SHA256 hash of the ticket.
1649 */ 1649 */
1650 /* XXX - ensure this doesn't overflow session_id if hash is changed. */
1650 if (!EVP_Digest(CBS_data(&session_ticket), CBS_len(&session_ticket), 1651 if (!EVP_Digest(CBS_data(&session_ticket), CBS_len(&session_ticket),
1651 s->session->session_id, &session_id_length, EVP_sha256(), NULL)) { 1652 s->session->session_id, &session_id_length, EVP_sha256(), NULL)) {
1652 al = SSL_AD_INTERNAL_ERROR; 1653 al = SSL_AD_INTERNAL_ERROR;