diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2020-02-19 05:11:54 +0000 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2020-05-13 16:01:18 +0900 |
commit | d9064190ca892708f71da500a6e24fb2615c6ccb (patch) | |
tree | aa253a675050ac575027b0c3c7c75278e1cce75d /ext/openssl/ossl_x509ext.c | |
parent | c891e0ea8951230c19919c6960d88b8d038395e9 (diff) | |
download | ruby-openssl-d9064190ca892708f71da500a6e24fb2615c6ccb.tar.gz |
config: replace DupConfigPtr() with GetConfig()ky/config-use-openssl-api
Now that OpenSSL::Config wraps a real CONF object, the caller can just
borrow it rather than creating a new temporary CONF object. CONF object
is usually treated as immutable.
DupConfigPtr() is now removed, and GetConfig() is exported instead.
Diffstat (limited to 'ext/openssl/ossl_x509ext.c')
-rw-r--r-- | ext/openssl/ossl_x509ext.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c index 5eb9bd75..e54102c7 100644 --- a/ext/openssl/ossl_x509ext.c +++ b/ext/openssl/ossl_x509ext.c @@ -226,11 +226,10 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self) GetX509ExtFactory(self, ctx); obj = NewX509Ext(cX509Ext); rconf = rb_iv_get(self, "@config"); - conf = NIL_P(rconf) ? NULL : DupConfigPtr(rconf); + conf = NIL_P(rconf) ? NULL : GetConfig(rconf); X509V3_set_nconf(ctx, conf); ext = X509V3_EXT_nconf_nid(conf, ctx, nid, RSTRING_PTR(valstr)); X509V3_set_ctx_nodb(ctx); - NCONF_free(conf); if (!ext){ ossl_raise(eX509ExtError, "%"PRIsVALUE" = %"PRIsVALUE, oid, valstr); } |