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 | 0494ac830a0f6d843dbcb510f7c231e26b351e00 (patch) | |
tree | 29c1ea76dfda49d9ae66ddb7d43caf1c28ace6f2 /ext | |
parent | 09174ffe8d09fb4356801ffcc24e389ad2288ac6 (diff) | |
download | ruby-0494ac830a0f6d843dbcb510f7c231e26b351e00.tar.gz ruby-0494ac830a0f6d843dbcb510f7c231e26b351e00.tar.xz ruby-0494ac830a0f6d843dbcb510f7c231e26b351e00.zip |
* ext/openssl/ossl_x509store.c (ossl_x509stctx_set_time): should
not set internal flag directry.
git-svn-id: http://svn.ruby-lang.org/repos/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 b08f90cde..5dba73387 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; } |