mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): d2i
functions may replace the pointer indicated by the first argument. * ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto. * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b1ba6aebf9
commit
ef5ce7029d
4 changed files with 16 additions and 6 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Tue Aug 24 08:57:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): d2i
|
||||||
|
functions may replace the pointer indicated by the first argument.
|
||||||
|
|
||||||
|
* ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto.
|
||||||
|
|
||||||
|
* ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.
|
||||||
|
|
||||||
Mon Aug 23 12:43:32 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Aug 23 12:43:32 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* lib/resolv.rb (Config.default_config_hash): when multiple domains
|
* lib/resolv.rb (Config.default_config_hash): when multiple domains
|
||||||
|
|
|
@ -91,12 +91,13 @@ ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
|
||||||
X509_ATTRIBUTE *attr;
|
X509_ATTRIBUTE *attr;
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
|
|
||||||
|
GetX509Attr(self, attr);
|
||||||
if(rb_scan_args(argc, argv, "11", &oid, &value) == 1){
|
if(rb_scan_args(argc, argv, "11", &oid, &value) == 1){
|
||||||
GetX509Attr(self, attr);
|
|
||||||
oid = ossl_to_der_if_possible(oid);
|
oid = ossl_to_der_if_possible(oid);
|
||||||
StringValue(oid);
|
StringValue(oid);
|
||||||
p = RSTRING(oid)->ptr;
|
p = RSTRING(oid)->ptr;
|
||||||
if(!d2i_X509_ATTRIBUTE(&attr, &p, RSTRING(oid)->len)){
|
if(!d2i_X509_ATTRIBUTE((X509_ATTRIBUTE**)&DATA_PTR(self),
|
||||||
|
&p, RSTRING(oid)->len)){
|
||||||
ossl_raise(eX509AttrError, NULL);
|
ossl_raise(eX509AttrError, NULL);
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -260,13 +260,13 @@ ossl_x509ext_initialize(int argc, VALUE *argv, VALUE self)
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
X509_EXTENSION *ext;
|
X509_EXTENSION *ext;
|
||||||
|
|
||||||
|
GetX509Ext(self, ext);
|
||||||
if(rb_scan_args(argc, argv, "12", &oid, &value, &critical) == 1){
|
if(rb_scan_args(argc, argv, "12", &oid, &value, &critical) == 1){
|
||||||
/* evaluate oid as a DER string */
|
|
||||||
oid = ossl_to_der_if_possible(oid);
|
oid = ossl_to_der_if_possible(oid);
|
||||||
StringValue(oid);
|
StringValue(oid);
|
||||||
GetX509Ext(self, ext);
|
|
||||||
p = RSTRING(oid)->ptr;
|
p = RSTRING(oid)->ptr;
|
||||||
if(!d2i_X509_EXTENSION(&ext, &p, RSTRING(oid)->len))
|
if(!d2i_X509_EXTENSION((X509_EXTENSION**)&DATA_PTR(self),
|
||||||
|
&p, RSTRING(oid)->len))
|
||||||
ossl_raise(eX509ExtError, NULL);
|
ossl_raise(eX509ExtError, NULL);
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ ossl_x509name_initialize(int argc, VALUE *argv, VALUE self)
|
||||||
VALUE str = ossl_to_der_if_possible(arg);
|
VALUE str = ossl_to_der_if_possible(arg);
|
||||||
StringValue(str);
|
StringValue(str);
|
||||||
p = RSTRING(str)->ptr;
|
p = RSTRING(str)->ptr;
|
||||||
if(!d2i_X509_NAME(&name, &p, RSTRING(str)->len)){
|
if(!d2i_X509_NAME((X509_NAME**)&DATA_PTR(self), &p, RSTRING(str)->len)){
|
||||||
ossl_raise(eX509NameError, NULL);
|
ossl_raise(eX509NameError, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue