ruby-changes:40572
From: nagachika <ko1@a...>
Date: Thu, 19 Nov 2015 00:38:02 +0900 (JST)
Subject: [ruby-changes:40572] nagachika:r52651 (ruby_2_2): merge revision(s) 52556, 52557: [Backport #10735]
nagachika 2015-11-19 00:37:52 +0900 (Thu, 19 Nov 2015) New Revision: 52651 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52651 Log: merge revision(s) 52556,52557: [Backport #10735] * ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/ext/openssl/ossl_pkey.c branches/ruby_2_2/version.h Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 52650) +++ ruby_2_2/ChangeLog (revision 52651) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Thu Nov 19 00:15:23 2015 Zachary Scott <zzak@r...> + + * ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735] + Thu Nov 19 00:01:14 2015 Nobuyoshi Nakada <nobu@r...> * io.c (argf_next_argv): check ARGV element type, and try Index: ruby_2_2/ext/openssl/ossl_pkey.c =================================================================== --- ruby_2_2/ext/openssl/ossl_pkey.c (revision 52650) +++ ruby_2_2/ext/openssl/ossl_pkey.c (revision 52651) @@ -289,6 +289,7 @@ ossl_pkey_sign(VALUE self, VALUE digest, https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/openssl/ossl_pkey.c#L289 EVP_MD_CTX ctx; unsigned int buf_len; VALUE str; + int result; if (rb_funcall(self, id_private_q, 0, NULL) != Qtrue) { ossl_raise(rb_eArgError, "Private key is needed."); @@ -298,7 +299,9 @@ ossl_pkey_sign(VALUE self, VALUE digest, https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ext/openssl/ossl_pkey.c#L299 StringValue(data); EVP_SignUpdate(&ctx, RSTRING_PTR(data), RSTRING_LEN(data)); str = rb_str_new(0, EVP_PKEY_size(pkey)+16); - if (!EVP_SignFinal(&ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey)) + result = EVP_SignFinal(&ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey); + EVP_MD_CTX_cleanup(&ctx); + if (!result) ossl_raise(ePKeyError, NULL); assert((long)buf_len <= RSTRING_LEN(str)); rb_str_set_len(str, buf_len); Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 52650) +++ ruby_2_2/version.h (revision 52651) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.4" #define RUBY_RELEASE_DATE "2015-11-19" -#define RUBY_PATCHLEVEL 189 +#define RUBY_PATCHLEVEL 190 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 11 Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r52556-52557 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/