@@ -246,6 +246,7 @@ static VALUE
246
246
ossl_x509store_set_flags (VALUE self , VALUE flags )
247
247
{
248
248
X509_STORE * store ;
249
+ rb_check_frozen (self );
249
250
long f = NUM2LONG (flags );
250
251
251
252
GetX509Store (self , store );
@@ -281,6 +282,7 @@ static VALUE
281
282
ossl_x509store_set_purpose (VALUE self , VALUE purpose )
282
283
{
283
284
X509_STORE * store ;
285
+ rb_check_frozen (self );
284
286
int p = NUM2INT (purpose );
285
287
286
288
GetX509Store (self , store );
@@ -305,6 +307,7 @@ static VALUE
305
307
ossl_x509store_set_trust (VALUE self , VALUE trust )
306
308
{
307
309
X509_STORE * store ;
310
+ rb_check_frozen (self );
308
311
int t = NUM2INT (trust );
309
312
310
313
GetX509Store (self , store );
@@ -331,6 +334,7 @@ ossl_x509store_set_time(VALUE self, VALUE time)
331
334
X509_STORE * store ;
332
335
X509_VERIFY_PARAM * param ;
333
336
337
+ rb_check_frozen (self );
334
338
GetX509Store (self , store );
335
339
#ifdef HAVE_X509_STORE_GET0_PARAM
336
340
param = X509_STORE_get0_param (store );
@@ -358,6 +362,7 @@ ossl_x509store_add_file(VALUE self, VALUE file)
358
362
X509_LOOKUP * lookup ;
359
363
const char * path ;
360
364
365
+ rb_check_frozen (self );
361
366
GetX509Store (self , store );
362
367
path = StringValueCStr (file );
363
368
lookup = X509_STORE_add_lookup (store , X509_LOOKUP_file ());
@@ -393,6 +398,7 @@ ossl_x509store_add_path(VALUE self, VALUE dir)
393
398
X509_LOOKUP * lookup ;
394
399
const char * path ;
395
400
401
+ rb_check_frozen (self );
396
402
GetX509Store (self , store );
397
403
path = StringValueCStr (dir );
398
404
lookup = X509_STORE_add_lookup (store , X509_LOOKUP_hash_dir ());
@@ -422,6 +428,7 @@ ossl_x509store_set_default_paths(VALUE self)
422
428
{
423
429
X509_STORE * store ;
424
430
431
+ rb_check_frozen (self );
425
432
GetX509Store (self , store );
426
433
if (X509_STORE_set_default_paths (store ) != 1 )
427
434
ossl_raise (eX509StoreError , "X509_STORE_set_default_paths" );
@@ -443,6 +450,7 @@ ossl_x509store_add_cert(VALUE self, VALUE arg)
443
450
X509_STORE * store ;
444
451
X509 * cert ;
445
452
453
+ rb_check_frozen (self );
446
454
cert = GetX509CertPtr (arg ); /* NO NEED TO DUP */
447
455
GetX509Store (self , store );
448
456
if (X509_STORE_add_cert (store , cert ) != 1 )
@@ -465,6 +473,7 @@ ossl_x509store_add_crl(VALUE self, VALUE arg)
465
473
X509_STORE * store ;
466
474
X509_CRL * crl ;
467
475
476
+ rb_check_frozen (self );
468
477
crl = GetX509CRLPtr (arg ); /* NO NEED TO DUP */
469
478
GetX509Store (self , store );
470
479
if (X509_STORE_add_crl (store , crl ) != 1 )
@@ -498,6 +507,7 @@ ossl_x509store_verify(int argc, VALUE *argv, VALUE self)
498
507
VALUE cert , chain ;
499
508
VALUE ctx , proc , result ;
500
509
510
+ rb_check_frozen (self );
501
511
rb_scan_args (argc , argv , "11" , & cert , & chain );
502
512
ctx = rb_funcall (cX509StoreContext , rb_intern ("new" ), 3 , self , cert , chain );
503
513
proc = rb_block_given_p () ? rb_block_proc () :
@@ -695,6 +705,7 @@ ossl_x509stctx_set_error(VALUE self, VALUE err)
695
705
{
696
706
X509_STORE_CTX * ctx ;
697
707
708
+ rb_check_frozen (self );
698
709
GetX509StCtx (self , ctx );
699
710
X509_STORE_CTX_set_error (ctx , NUM2INT (err ));
700
711
@@ -793,6 +804,7 @@ static VALUE
793
804
ossl_x509stctx_set_flags (VALUE self , VALUE flags )
794
805
{
795
806
X509_STORE_CTX * store ;
807
+ rb_check_frozen (self );
796
808
long f = NUM2LONG (flags );
797
809
798
810
GetX509StCtx (self , store );
@@ -814,6 +826,7 @@ static VALUE
814
826
ossl_x509stctx_set_purpose (VALUE self , VALUE purpose )
815
827
{
816
828
X509_STORE_CTX * store ;
829
+ rb_check_frozen (self );
817
830
int p = NUM2INT (purpose );
818
831
819
832
GetX509StCtx (self , store );
@@ -835,6 +848,7 @@ static VALUE
835
848
ossl_x509stctx_set_trust (VALUE self , VALUE trust )
836
849
{
837
850
X509_STORE_CTX * store ;
851
+ rb_check_frozen (self );
838
852
int t = NUM2INT (trust );
839
853
840
854
GetX509StCtx (self , store );
@@ -857,6 +871,7 @@ ossl_x509stctx_set_time(VALUE self, VALUE time)
857
871
X509_STORE_CTX * store ;
858
872
long t ;
859
873
874
+ rb_check_frozen (self );
860
875
t = NUM2LONG (rb_Integer (time ));
861
876
GetX509StCtx (self , store );
862
877
X509_STORE_CTX_set_time (store , 0 , t );
0 commit comments