diff options
author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-27 20:20:29 +0000 |
---|---|---|
committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-05-27 20:20:29 +0000 |
commit | 313799a022529e000c8a25e4081d403bd4db7f2e (patch) | |
tree | 29c1ea76dfda49d9ae66ddb7d43caf1c28ace6f2 /ext | |
parent | 2530fa50e9d4d0af08245481536d00d884d5766a (diff) | |
download | ruby-313799a022529e000c8a25e4081d403bd4db7f2e.tar.gz |
* ext/openssl/ossl_x509store.c (ossl_x509stctx_set_time): should
not set internal flag directry.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openssl/ossl_x509store.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c index b08f90cde8..5dba733878 100644 --- a/ext/openssl/ossl_x509store.c +++ b/ext/openssl/ossl_x509store.c @@ -358,7 +358,7 @@ static VALUE ossl_x509stctx_set_time(VALUE, VALUE); static VALUE ossl_x509stctx_initialize(int argc, VALUE *argv, VALUE self) { - VALUE store, cert, chain; + VALUE store, cert, chain, t; X509_STORE_CTX *ctx; X509_STORE *x509st; X509 *x509 = NULL; @@ -380,7 +380,8 @@ ossl_x509stctx_initialize(int argc, VALUE *argv, VALUE self) ossl_x509stctx_set_purpose(self, rb_iv_get(store, "@purpose")); ossl_x509stctx_set_trust(self, rb_iv_get(store, "@trust")); #endif - ossl_x509stctx_set_time(self, rb_iv_get(store, "@time")); + if (!NIL_P(t = rb_iv_get(store, "@time"))) + ossl_x509stctx_set_time(self, t); rb_iv_set(self, "@verify_callback", rb_iv_get(store, "@verify_callback")); rb_iv_set(self, "@cert", cert); @@ -546,17 +547,11 @@ static VALUE ossl_x509stctx_set_time(VALUE self, VALUE time) { X509_STORE_CTX *store; + long t; - if(NIL_P(time)) { - GetX509StCtx(self, store); - store->flags &= ~X509_V_FLAG_USE_CHECK_TIME; - } - else { - long t = NUM2LONG(rb_Integer(time)); - - GetX509StCtx(self, store); - X509_STORE_CTX_set_time(store, 0, t); - } + t = NUM2LONG(rb_Integer(time)); + GetX509StCtx(self, store); + X509_STORE_CTX_set_time(store, 0, t); return time; } |