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): fix for
initialization of r18168. * ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): ditto. * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7fc16c2377
commit
379fa42f6d
4 changed files with 21 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
|||
Fri Aug 29 12:19:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for
|
||||
initialization of r18168.
|
||||
|
||||
* ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): ditto.
|
||||
|
||||
* ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.
|
||||
|
||||
Fri Aug 29 11:04:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* encoding.c (rb_enc_compatible): ASCII compatible string and US-ASCII
|
||||
|
|
|
@ -107,11 +107,13 @@ ossl_ocspreq_initialize(int argc, VALUE *argv, VALUE self)
|
|||
|
||||
rb_scan_args(argc, argv, "01", &arg);
|
||||
if(!NIL_P(arg)){
|
||||
OCSP_REQUEST *req = DATA_PTR(self);
|
||||
OCSP_REQUEST *req = DATA_PTR(self), *x;
|
||||
arg = ossl_to_der_if_possible(arg);
|
||||
StringValue(arg);
|
||||
p = (unsigned char*)RSTRING_PTR(arg);
|
||||
if(!d2i_OCSP_REQUEST(&req, &p, RSTRING_LEN(arg)) && (DATA_PTR(self) = req, 1)){
|
||||
x = d2i_OCSP_REQUEST(&req, &p, RSTRING_LEN(arg));
|
||||
DATA_PTR(self) = req;
|
||||
if(!x){
|
||||
ossl_raise(eOCSPError, "cannot load DER encoded request");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ static VALUE
|
|||
ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE oid, value;
|
||||
X509_ATTRIBUTE *attr;
|
||||
X509_ATTRIBUTE *attr, *x;
|
||||
const unsigned char *p;
|
||||
|
||||
GetX509Attr(self, attr);
|
||||
|
@ -100,7 +100,9 @@ ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
|
|||
oid = ossl_to_der_if_possible(oid);
|
||||
StringValue(oid);
|
||||
p = (unsigned char *)RSTRING_PTR(oid);
|
||||
if(!d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid)) && (DATA_PTR(self) = attr, 1)){
|
||||
x = d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid));
|
||||
DATA_PTR(self) = attr;
|
||||
if(!x){
|
||||
ossl_raise(eX509AttrError, NULL);
|
||||
}
|
||||
return self;
|
||||
|
|
|
@ -137,13 +137,14 @@ ossl_x509name_initialize(int argc, VALUE *argv, VALUE self)
|
|||
else{
|
||||
const unsigned char *p;
|
||||
VALUE str = ossl_to_der_if_possible(arg);
|
||||
X509_NAME *x = DATA_PTR(self);
|
||||
X509_NAME *x;
|
||||
StringValue(str);
|
||||
p = (unsigned char *)RSTRING_PTR(str);
|
||||
if(!d2i_X509_NAME(&x, &p, RSTRING_LEN(str)) && (DATA_PTR(self) = x, 1)){
|
||||
x = d2i_X509_NAME(&name, &p, RSTRING_LEN(str));
|
||||
DATA_PTR(self) = name;
|
||||
if(!x){
|
||||
ossl_raise(eX509NameError, NULL);
|
||||
}
|
||||
DATA_PTR(self) = x;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue