fix tests bu not setting the string instance on the frozen object

OpenSSL [copies the string returned by the pointe](9f040d6dec/ssl/t1_lib.c (L1800-1809)), so it should be safe to just return a pointer to the string object and not set an instance variable on the already frozen object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2015-07-22 19:04:58 +00:00
parent 5326593a8b
commit 28e866d7bb
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Thu Jul 23 04:03:03 2015 Aaron Patterson <tenderlove@ruby-lang.org>
* ext/openssl/ossl_ssl.c: fix tests by not setting the instance
variable on the frozen ssl instance.
Thu Jul 23 03:32:26 2015 Aaron Patterson <tenderlove@ruby-lang.org> Thu Jul 23 03:32:26 2015 Aaron Patterson <tenderlove@ruby-lang.org>
* ext/openssl/ossl_ssl.c: add ECDH callback support. [Feature #11356] * ext/openssl/ossl_ssl.c: add ECDH callback support. [Feature #11356]

View File

@ -707,7 +707,6 @@ ssl_alpn_select_cb(SSL *ssl, const unsigned char **out, unsigned char *outlen, c
selected = rb_funcall(cb, rb_intern("call"), 1, protocols); selected = rb_funcall(cb, rb_intern("call"), 1, protocols);
*out = (unsigned char *) StringValuePtr(selected); *out = (unsigned char *) StringValuePtr(selected);
*outlen = RSTRING_LENINT(selected); *outlen = RSTRING_LENINT(selected);
rb_iv_set(sslctx_obj, "@_alpn_selected", selected);
return SSL_TLSEXT_ERR_OK; return SSL_TLSEXT_ERR_OK;
} }