summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-03 01:14:56 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-03 01:14:56 +0000
commit2758be26bb21be9acfd8720bb8160dab2ddc363e (patch)
treefaf9fc1ecdb5549df051148a5fd7c55360199a3f
parentf661c0be4465ba257c4d5472d09ffe742a8e2f3f (diff)
* ext/openssl/ossl.h: Make `SSL_SESSION_cmp` use `CRYPTO_memcmp`
[fix GH-591] Patch by @PiPeep * ext/openssl/ossl_ssl_session.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/openssl/ossl.h1
-rw-r--r--ext/openssl/ossl_ssl_session.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fd0fdd..e4fa3c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jan 3 10:14:51 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * ext/openssl/ossl.h: Make `SSL_SESSION_cmp` use `CRYPTO_memcmp`
+ [fix GH-591] Patch by @PiPeep
+ * ext/openssl/ossl_ssl_session.c: ditto.
+
Sat Jan 3 09:54:32 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* ext/fiddle/lib/fiddle/cparser.rb: Support for Fiddle::CParser
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index c843c06..fd7c840 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -64,6 +64,7 @@ extern "C" {
#include <openssl/rand.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
+#include <openssl/crypto.h>
#undef X509_NAME
#undef PKCS7_SIGNER_INFO
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c
index 5318f1a..2fd853f 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -79,7 +79,7 @@ int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b)
if (a->ssl_version != b->ssl_version ||
a->session_id_length != b->session_id_length)
return 1;
- return memcmp(a->session_id,b-> session_id, a->session_id_length);
+ return CRYPTO_memcmp(a->session_id, b->session_id, a->session_id_length);
}
#endif