summarylogtreecommitdiffstats
path: root/CVE-2015-2141.patch
diff options
context:
space:
mode:
authorAlfonso Saavedra Son2016-03-07 14:37:21 +0100
committerAlfonso Saavedra Son2016-03-07 14:37:21 +0100
commitfc08a43f84844c4f522033848297fb7760776f19 (patch)
tree62fc1137fd99b00c0251e8df36b8be2349e2bfe2 /CVE-2015-2141.patch
downloadaur-crypto++-562.tar.gz
Firts commit
Diffstat (limited to 'CVE-2015-2141.patch')
-rw-r--r--CVE-2015-2141.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/CVE-2015-2141.patch b/CVE-2015-2141.patch
new file mode 100644
index 000000000000..32c5164609e9
--- /dev/null
+++ b/CVE-2015-2141.patch
@@ -0,0 +1,32 @@
+From 9425e16437439e68c7d96abef922167d68fafaff Mon Sep 17 00:00:00 2001
+From: Jeffrey Walton <noloader@gmail.com>
+Date: Sat, 27 Jun 2015 17:56:01 -0400
+Subject: [PATCH] Fix for CVE-2015-2141. Thanks to Evgeny Sidorov for
+ reporting. Squaring to satisfy Jacobi requirements suggested by JPM.
+
+---
+ rw.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/rw.cpp b/rw.cpp
+index cdd9f2d..0b9318b 100644
+--- a/rw.cpp
++++ b/rw.cpp
+@@ -126,10 +126,16 @@ Integer InvertibleRWFunction::CalculateInverse(RandomNumberGenerator &rng, const
+ DoQuickSanityCheck();
+ ModularArithmetic modn(m_n);
+ Integer r, rInv;
+- do { // do this in a loop for people using small numbers for testing
++
++ // do this in a loop for people using small numbers for testing
++ do {
+ r.Randomize(rng, Integer::One(), m_n - Integer::One());
++ // Fix for CVE-2015-2141. Thanks to Evgeny Sidorov for reporting.
++ // Squaring to satisfy Jacobi requirements suggested by JPM.
++ r = modn.Square(r);
+ rInv = modn.MultiplicativeInverse(r);
+ } while (rInv.IsZero());
++
+ Integer re = modn.Square(r);
+ re = modn.Multiply(re, x); // blind
+