diff options
author | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-05 15:35:12 +0000 |
---|---|---|
committer | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-05 15:35:12 +0000 |
commit | 5625fdeaae46f80e5673d8863319b2abfdc4ccf7 (patch) | |
tree | 0fedb8288600b5a5810fdbf88ad5df61a6642901 /ext/openssl/ossl_x509name.c | |
parent | 6ae6719b81980c5ea1782e6e5ef8e6d58e875341 (diff) | |
download | ruby-5625fdeaae46f80e5673d8863319b2abfdc4ccf7.tar.gz |
openssl: adapt to OpenSSL 1.1.0 opaque structs
* ext/openssl/extconf.rb: Check existence of accessor functions that
don't exist in OpenSSL 0.9.8. OpenSSL 1.1.0 made most of its
structures opaque and requires use of these accessor functions.
[ruby-core:75225] [Feature #12324]
* ext/openssl/openssl_missing.[ch]: Implement them if missing.
* ext/openssl/ossl*.c: Use these accessor functions.
* test/openssl/test_hmac.rb: Add missing test for HMAC#reset.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_x509name.c')
-rw-r--r-- | ext/openssl/ossl_x509name.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c index a0e28e29ec..ff307c0626 100644 --- a/ext/openssl/ossl_x509name.c +++ b/ext/openssl/ossl_x509name.c @@ -282,6 +282,7 @@ ossl_x509name_to_a(VALUE self) char long_name[512]; const char *short_name; VALUE ary, vname, ret; + ASN1_STRING *value; GetX509Name(self, name); entries = X509_NAME_entry_count(name); @@ -294,7 +295,8 @@ ossl_x509name_to_a(VALUE self) if (!(entry = X509_NAME_get_entry(name, i))) { ossl_raise(eX509NameError, NULL); } - if (!i2t_ASN1_OBJECT(long_name, sizeof(long_name), entry->object)) { + if (!i2t_ASN1_OBJECT(long_name, sizeof(long_name), + X509_NAME_ENTRY_get_object(entry))) { ossl_raise(eX509NameError, NULL); } nid = OBJ_ln2nid(long_name); @@ -304,10 +306,11 @@ ossl_x509name_to_a(VALUE self) short_name = OBJ_nid2sn(nid); vname = rb_str_new2(short_name); /*do not free*/ } + value = X509_NAME_ENTRY_get_data(entry); ary = rb_ary_new3(3, vname, - rb_str_new((const char *)entry->value->data, entry->value->length), - INT2FIX(entry->value->type)); + rb_str_new((const char *)value->data, value->length), + INT2FIX(value->type)); rb_ary_push(ret, ary); } return ret; |