[前][次][番号順一覧][スレッド一覧]

ruby-changes:20562

From: emboss <ko1@a...>
Date: Fri, 22 Jul 2011 13:17:49 +0900 (JST)
Subject: [ruby-changes:20562] emboss:r32610 (ruby_1_9_3): * backport r32609 from trunk.

emboss	2011-07-22 13:17:39 +0900 (Fri, 22 Jul 2011)

  New Revision: 32610

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32610

  Log:
    * backport r32609 from trunk.
    
    * ext/openssl/ossl_hmac.c: Revert checking return type of
      HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/openssl/ossl_hmac.c

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 32609)
+++ ruby_1_9_3/ChangeLog	(revision 32610)
@@ -1,3 +1,10 @@
+Fri Jul 22 13:03:12 2011  Martin Bosslet  <Martin.Bosslet@g...>
+
+	* backport r32609 from trunk.
+
+	* ext/openssl/ossl_hmac.c: Revert checking return type of
+	  HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0.
+
 Fri Jul 22 11:22:20 2011  Martin Bosslet  <Martin.Bosslet@g...>
 
 	* backport r32606 from trunk.
Index: ruby_1_9_3/ext/openssl/ossl_hmac.c
===================================================================
--- ruby_1_9_3/ext/openssl/ossl_hmac.c	(revision 32609)
+++ ruby_1_9_3/ext/openssl/ossl_hmac.c	(revision 32610)
@@ -70,10 +70,8 @@
 
     StringValue(key);
     GetHMAC(self, ctx);
-    if (HMAC_Init_ex(ctx, RSTRING_PTR(key), RSTRING_LENINT(key),
-		 GetDigestPtr(digest), NULL) != 1) {
-	ossl_raise(eHMACError, "HMAC initialization failed.");
-    }
+    HMAC_Init(ctx, RSTRING_PTR(key), RSTRING_LENINT(key),
+		 GetDigestPtr(digest));
 
     return self;
 }
@@ -182,9 +180,7 @@
     HMAC_CTX *ctx;
 
     GetHMAC(self, ctx);
-    if (HMAC_Init_ex(ctx, NULL, 0, NULL, NULL) != 1) {
-	ossl_raise(eHMACError, "HMAC initialization failed");
-    }
+    HMAC_Init(ctx, NULL, 0, NULL);
 
     return self;
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]