aboutsummaryrefslogtreecommitdiff
path: root/crypto/params_from_text.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2024-02-02 04:39:16 +0000
committerCy Schubert <cy@FreeBSD.org>2024-02-02 09:48:38 +0000
commit9dd13e84fa8eca8f3462bd55485aa3da8c37f54a (patch)
tree588240aeb9a7363618b8a687c72588bd74948634 /crypto/params_from_text.c
parent825caf7e12445fa4818413cc37c8b45bebb6c3a9 (diff)
OpenSSL: Vendor import of OpenSSL 3.0.13vendor/openssl/3.0.13
* Fixed PKCS12 Decoding crashes ([CVE-2024-0727]) * Fixed Excessive time spent checking invalid RSA public keys ([CVE-2023-6237]) * Fixed POLY1305 MAC implementation corrupting vector registers on PowerPC CPUs which support PowerISA 2.07 ([CVE-2023-6129]) * Fix excessive time spent in DH check / generation with large Q parameter value ([CVE-2023-5678]) Release notes can be found at https://www.openssl.org/news/openssl-3.0-notes.html.
Diffstat (limited to 'crypto/params_from_text.c')
-rw-r--r--crypto/params_from_text.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/params_from_text.c b/crypto/params_from_text.c
index 360f8933e135..a323bf2616ad 100644
--- a/crypto/params_from_text.c
+++ b/crypto/params_from_text.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -118,7 +118,13 @@ static int prepare_from_text(const OSSL_PARAM *paramdefs, const char *key,
break;
case OSSL_PARAM_OCTET_STRING:
if (*ishex) {
- *buf_n = strlen(value) >> 1;
+ size_t hexdigits = strlen(value);
+ if ((hexdigits % 2) != 0) {
+ /* We don't accept an odd number of hex digits */
+ ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS);
+ return 0;
+ }
+ *buf_n = hexdigits >> 1;
} else {
*buf_n = value_n;
}