2222 TypedData_Get_Struct((obj), OCSP_REQUEST, &ossl_ocsp_request_type, (req)); \
2323 if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
2424} while (0)
25- #define SafeGetOCSPReq (obj , req ) do { \
26- OSSL_Check_Kind((obj), cOCSPReq); \
27- GetOCSPReq((obj), (req)); \
28- } while (0)
2925
3026#define NewOCSPRes (klass ) \
3127 TypedData_Wrap_Struct((klass), &ossl_ocsp_response_type, 0)
3733 TypedData_Get_Struct((obj), OCSP_RESPONSE, &ossl_ocsp_response_type, (res)); \
3834 if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
3935} while (0)
40- #define SafeGetOCSPRes (obj , res ) do { \
41- OSSL_Check_Kind((obj), cOCSPRes); \
42- GetOCSPRes((obj), (res)); \
43- } while (0)
4436
4537#define NewOCSPBasicRes (klass ) \
4638 TypedData_Wrap_Struct((klass), &ossl_ocsp_basicresp_type, 0)
5244 TypedData_Get_Struct((obj), OCSP_BASICRESP, &ossl_ocsp_basicresp_type, (res)); \
5345 if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
5446} while (0)
55- #define SafeGetOCSPBasicRes (obj , res ) do { \
56- OSSL_Check_Kind((obj), cOCSPBasicRes); \
57- GetOCSPBasicRes((obj), (res)); \
58- } while (0)
5947
6048#define NewOCSPSingleRes (klass ) \
6149 TypedData_Wrap_Struct((klass), &ossl_ocsp_singleresp_type, 0)
6755 TypedData_Get_Struct((obj), OCSP_SINGLERESP, &ossl_ocsp_singleresp_type, (res)); \
6856 if(!(res)) ossl_raise(rb_eRuntimeError, "SingleResponse wasn't initialized!"); \
6957} while (0)
70- #define SafeGetOCSPSingleRes (obj , res ) do { \
71- OSSL_Check_Kind((obj), cOCSPSingleRes); \
72- GetOCSPSingleRes((obj), (res)); \
73- } while (0)
7458
7559#define NewOCSPCertId (klass ) \
7660 TypedData_Wrap_Struct((klass), &ossl_ocsp_certid_type, 0)
8266 TypedData_Get_Struct((obj), OCSP_CERTID, &ossl_ocsp_certid_type, (cid)); \
8367 if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
8468} while (0)
85- #define SafeGetOCSPCertId (obj , cid ) do { \
86- OSSL_Check_Kind((obj), cOCSPCertId); \
87- GetOCSPCertId((obj), (cid)); \
88- } while (0)
8969
9070VALUE mOCSP ;
9171VALUE eOCSPError ;
@@ -200,7 +180,7 @@ ossl_ocspreq_initialize_copy(VALUE self, VALUE other)
200180
201181 rb_check_frozen (self );
202182 GetOCSPReq (self , req_old );
203- SafeGetOCSPReq (other , req );
183+ GetOCSPReq (other , req );
204184
205185 req_new = ASN1_item_dup (ASN1_ITEM_rptr (OCSP_REQUEST ), req );
206186 if (!req_new )
@@ -304,7 +284,7 @@ ossl_ocspreq_check_nonce(VALUE self, VALUE basic_resp)
304284 int res ;
305285
306286 GetOCSPReq (self , req );
307- SafeGetOCSPBasicRes (basic_resp , bs );
287+ GetOCSPBasicRes (basic_resp , bs );
308288 res = OCSP_check_nonce (req , bs );
309289
310290 return INT2NUM (res );
@@ -521,7 +501,7 @@ ossl_ocspres_initialize_copy(VALUE self, VALUE other)
521501
522502 rb_check_frozen (self );
523503 GetOCSPRes (self , res_old );
524- SafeGetOCSPRes (other , res );
504+ GetOCSPRes (other , res );
525505
526506 res_new = ASN1_item_dup (ASN1_ITEM_rptr (OCSP_RESPONSE ), res );
527507 if (!res_new )
@@ -677,7 +657,7 @@ ossl_ocspbres_initialize_copy(VALUE self, VALUE other)
677657
678658 rb_check_frozen (self );
679659 GetOCSPBasicRes (self , bs_old );
680- SafeGetOCSPBasicRes (other , bs );
660+ GetOCSPBasicRes (other , bs );
681661
682662 bs_new = ASN1_item_dup (ASN1_ITEM_rptr (OCSP_BASICRESP ), bs );
683663 if (!bs_new )
@@ -736,7 +716,7 @@ ossl_ocspbres_copy_nonce(VALUE self, VALUE request)
736716 int ret ;
737717
738718 GetOCSPBasicRes (self , bs );
739- SafeGetOCSPReq (request , req );
719+ GetOCSPReq (request , req );
740720 ret = OCSP_copy_nonce (bs , req );
741721
742722 return INT2NUM (ret );
@@ -829,7 +809,7 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
829809 VALUE tmp ;
830810
831811 GetOCSPBasicRes (self , bs );
832- SafeGetOCSPCertId (cid , id );
812+ GetOCSPCertId (cid , id );
833813 st = NUM2INT (status );
834814 if (!NIL_P (ext )) { /* All ext's members must be X509::Extension */
835815 ext = rb_check_array_type (ext );
@@ -988,7 +968,7 @@ ossl_ocspbres_find_response(VALUE self, VALUE target)
988968 OCSP_CERTID * id ;
989969 int n ;
990970
991- SafeGetOCSPCertId (target , id );
971+ GetOCSPCertId (target , id );
992972 GetOCSPBasicRes (self , bs );
993973
994974 if ((n = OCSP_resp_find (bs , id , -1 )) == -1 )
@@ -1213,7 +1193,7 @@ ossl_ocspsres_initialize_copy(VALUE self, VALUE other)
12131193
12141194 rb_check_frozen (self );
12151195 GetOCSPSingleRes (self , sres_old );
1216- SafeGetOCSPSingleRes (other , sres );
1196+ GetOCSPSingleRes (other , sres );
12171197
12181198 sres_new = ASN1_item_dup (ASN1_ITEM_rptr (OCSP_SINGLERESP ), sres );
12191199 if (!sres_new )
@@ -1468,7 +1448,7 @@ ossl_ocspcid_initialize_copy(VALUE self, VALUE other)
14681448
14691449 rb_check_frozen (self );
14701450 GetOCSPCertId (self , cid_old );
1471- SafeGetOCSPCertId (other , cid );
1451+ GetOCSPCertId (other , cid );
14721452
14731453 cid_new = OCSP_CERTID_dup (cid );
14741454 if (!cid_new )
@@ -1543,7 +1523,7 @@ ossl_ocspcid_cmp(VALUE self, VALUE other)
15431523 int result ;
15441524
15451525 GetOCSPCertId (self , id );
1546- SafeGetOCSPCertId (other , id2 );
1526+ GetOCSPCertId (other , id2 );
15471527 result = OCSP_id_cmp (id , id2 );
15481528
15491529 return (result == 0 ) ? Qtrue : Qfalse ;
@@ -1564,7 +1544,7 @@ ossl_ocspcid_cmp_issuer(VALUE self, VALUE other)
15641544 int result ;
15651545
15661546 GetOCSPCertId (self , id );
1567- SafeGetOCSPCertId (other , id2 );
1547+ GetOCSPCertId (other , id2 );
15681548 result = OCSP_id_issuer_cmp (id , id2 );
15691549
15701550 return (result == 0 ) ? Qtrue : Qfalse ;
0 commit comments