summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_x509store.c
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-27 20:20:29 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-27 20:20:29 +0000
commit76d714d88a3cfd368da059da6e28af7597a467c8 (patch)
tree42bb155dfe957797fe42d8b3eacb43a65e42189f /ext/openssl/ossl_x509store.c
parent63c32170e7a937b4afd306012a057a8911bf24cc (diff)
* 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/branches/ruby_1_8@8532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_x509store.c')
-rw-r--r--ext/openssl/ossl_x509store.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index b08f90c..5dba733 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;
}