@@ -223,7 +223,6 @@ ossl_x509store_initialize(int argc, VALUE *argv, VALUE self)
223223 rb_iv_set (self , "@error" , Qnil );
224224 rb_iv_set (self , "@error_string" , Qnil );
225225 rb_iv_set (self , "@chain" , Qnil );
226- rb_iv_set (self , "@time" , Qnil );
227226
228227 return self ;
229228}
@@ -329,7 +328,16 @@ ossl_x509store_set_trust(VALUE self, VALUE trust)
329328static VALUE
330329ossl_x509store_set_time (VALUE self , VALUE time )
331330{
332- rb_iv_set (self , "@time" , time );
331+ X509_STORE * store ;
332+ X509_VERIFY_PARAM * param ;
333+
334+ GetX509Store (self , store );
335+ #ifdef HAVE_X509_STORE_GET0_PARAM
336+ param = X509_STORE_get0_param (store );
337+ #else
338+ param = store -> param ;
339+ #endif
340+ X509_VERIFY_PARAM_set_time (param , NUM2LONG (rb_Integer (time )));
333341 return time ;
334342}
335343
@@ -564,7 +572,6 @@ ossl_x509stctx_new(X509_STORE_CTX *ctx)
564572static VALUE ossl_x509stctx_set_flags (VALUE , VALUE );
565573static VALUE ossl_x509stctx_set_purpose (VALUE , VALUE );
566574static VALUE ossl_x509stctx_set_trust (VALUE , VALUE );
567- static VALUE ossl_x509stctx_set_time (VALUE , VALUE );
568575
569576/*
570577 * call-seq:
@@ -575,7 +582,7 @@ static VALUE ossl_x509stctx_set_time(VALUE, VALUE);
575582static VALUE
576583ossl_x509stctx_initialize (int argc , VALUE * argv , VALUE self )
577584{
578- VALUE store , cert , chain , t ;
585+ VALUE store , cert , chain ;
579586 X509_STORE_CTX * ctx ;
580587 X509_STORE * x509st ;
581588 X509 * x509 = NULL ;
@@ -599,8 +606,6 @@ ossl_x509stctx_initialize(int argc, VALUE *argv, VALUE self)
599606 sk_X509_pop_free (x509s , X509_free );
600607 ossl_raise (eX509StoreError , "X509_STORE_CTX_init" );
601608 }
602- if (!NIL_P (t = rb_iv_get (store , "@time" )))
603- ossl_x509stctx_set_time (self , t );
604609 rb_iv_set (self , "@verify_callback" , rb_iv_get (store , "@verify_callback" ));
605610 rb_iv_set (self , "@cert" , cert );
606611
0 commit comments