aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ext/openssl/lib/openssl/ssl.rb4
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ca6f444e09..e213daa084 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun Jun 10 10:48:15 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * lib/openssl/ssl.rb: Use a simple random number to generate the
+ session id. MD5, as was used before, causes problems when
+ using a FIPS version of OpenSSL. Issue was found by Jared
+ Jennings, thank you!
+ [ruby-trunk - Bug #6137]
+
Sun Jun 10 10:27:34 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
* NEWS: Add note about the new private key export behavior.
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index 70b27f4416..268e8e9d67 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -146,7 +146,9 @@ module OpenSSL
@svr = svr
@ctx = ctx
unless ctx.session_id_context
- session_id = OpenSSL::Digest::MD5.hexdigest($0)
+ # see #6137 - session id may not exceed 32 bytes
+ prng = ::Random.new($0.hash)
+ session_id = prng.bytes(16).unpack('H*')[0]
@ctx.session_id_context = session_id
end
@start_immediately = true