summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_x509ext.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-15 06:35:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-15 06:35:55 +0000
commit2edbb9d0f802bab53153979c59125dd0afaafccf (patch)
tree76c471687bb6af4c8c0528187471346008838622 /ext/openssl/ossl_x509ext.c
parent772396882f02ec3738242a4e83a34e4fc32597bb (diff)
* lib/set.rb (Set#==): [ruby-dev:25206]
* ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198] * utf8.c (utf8_is_mbc_ambiguous): [ruby-talk:123561] * utf8.c (utf8_mbc_to_normalize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_x509ext.c')
-rw-r--r--ext/openssl/ossl_x509ext.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c
index 57e0054..8ba555d 100644
--- a/ext/openssl/ossl_x509ext.c
+++ b/ext/openssl/ossl_x509ext.c
@@ -215,7 +215,6 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self)
VALUE oid, value, critical, valstr, obj;
int nid;
- GetX509ExtFactory(self, ctx);
rb_scan_args(argc, argv, "21", &oid, &value, &critical);
StringValue(oid);
StringValue(value);
@@ -226,6 +225,7 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self)
if(!nid) ossl_raise(eX509ExtError, "unknown OID `%s'", RSTRING(oid)->ptr);
valstr = rb_str_new2(RTEST(critical) ? "critical," : "");
rb_str_append(valstr, value);
+ GetX509ExtFactory(self, ctx);
ext = X509V3_EXT_conf_nid(NULL, ctx, nid, RSTRING(valstr)->ptr);
if (!ext){
ossl_raise(eX509ExtError, "%s = %s",
@@ -284,11 +284,11 @@ ossl_x509ext_set_oid(VALUE self, VALUE oid)
ASN1_OBJECT *obj;
char *s;
- GetX509Ext(self, ext);
s = StringValuePtr(oid);
obj = OBJ_txt2obj(s, 0);
if(!obj) obj = OBJ_txt2obj(s, 1);
if(!obj) ossl_raise(eX509ExtError, NULL);
+ GetX509Ext(self, ext);
X509_EXTENSION_set_object(ext, obj);
return oid;
@@ -301,7 +301,6 @@ ossl_x509ext_set_value(VALUE self, VALUE data)
ASN1_OCTET_STRING *asn1s;
char *s;
- GetX509Ext(self, ext);
data = ossl_to_der_if_possible(data);
StringValue(data);
if(!(s = OPENSSL_malloc(RSTRING(data)->len)))
@@ -316,6 +315,7 @@ ossl_x509ext_set_value(VALUE self, VALUE data)
ASN1_OCTET_STRING_free(asn1s);
ossl_raise(eX509ExtError, NULL);
}
+ GetX509Ext(self, ext);
X509_EXTENSION_set_data(ext, asn1s);
return data;
@@ -376,6 +376,7 @@ static VALUE
ossl_x509ext_get_critical(VALUE obj)
{
X509_EXTENSION *ext;
+
GetX509Ext(obj, ext);
return X509_EXTENSION_get_critical(ext) ? Qtrue : Qfalse;
}