mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): the argument
should be a String. * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): ditt. * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): ditto. * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto. * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
879944aa32
commit
ca8be43f0e
4 changed files with 18 additions and 0 deletions
|
|
@ -256,6 +256,7 @@ ossl_x509ext_initialize(int argc, VALUE *argv, VALUE self)
|
|||
if(rb_scan_args(argc, argv, "12", &oid, &value, &critical) == 1){
|
||||
/* evaluate oid as a DER string */
|
||||
oid = ossl_to_der_if_possible(oid);
|
||||
StringValue(oid);
|
||||
GetX509Ext(self, ext);
|
||||
p = RSTRING(oid)->ptr;
|
||||
if(!d2i_X509_EXTENSION(&ext, &p, RSTRING(oid)->len))
|
||||
|
|
@ -295,6 +296,7 @@ ossl_x509ext_set_value(VALUE self, VALUE data)
|
|||
|
||||
GetX509Ext(self, ext);
|
||||
data = ossl_to_der_if_possible(data);
|
||||
StringValue(data);
|
||||
if(!(s = OPENSSL_malloc(RSTRING(data)->len)))
|
||||
ossl_raise(eX509ExtError, "malloc error");
|
||||
memcpy(s, RSTRING(data)->ptr, RSTRING(data)->len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue