summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2023-02-27 13:48:24 +1000
committerPauli <pauli@openssl.org>2023-03-01 09:22:53 +1100
commit5a53d73f1f97684a60ab4a80058c7da16b744f54 (patch)
tree66b1952f26b38bc5a8b95cc80073861e526d1d32 /include
parent01e3041b5716382f653c49538389230a8475f574 (diff)
Fix infinite loops in DSA sign code.
Fixes #20268 Values such as q=1 or priv=0 caused infinite loops when calling DSA_sign() without these changes. There are other cases where bad domain parameters may have caused infinite loops where the retry counter has been added. The simpler case of priv=0 also hits this case. q=1 caused an infinite loop in the setup. The max retry value has been set to an arbitrary value of 8 (it is unlikely to ever do a single retry for valid values). The minimum q bits was set to an arbitrary value of 128 (160 is still used for legacy reasons when using 512 bit keys). Thanks @guidovranken for detecting this, and @davidben for his insightful analysis. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20384) (cherry picked from commit 3a4e09ab42654b3d223f0f8dd1a9c58b2902ddcc)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/dsaerr.h2
-rw-r--r--include/openssl/dsaerr.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/crypto/dsaerr.h b/include/crypto/dsaerr.h
index 9898097d0d..fde8358fc9 100644
--- a/include/crypto/dsaerr.h
+++ b/include/crypto/dsaerr.h
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
diff --git a/include/openssl/dsaerr.h b/include/openssl/dsaerr.h
index 5f0ca8d12a..26ada57d80 100644
--- a/include/openssl/dsaerr.h
+++ b/include/openssl/dsaerr.h
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -38,6 +38,7 @@
# define DSA_R_P_NOT_PRIME 115
# define DSA_R_Q_NOT_PRIME 113
# define DSA_R_SEED_LEN_SMALL 110
+# define DSA_R_TOO_MANY_RETRIES 116
# endif
#endif