aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_x509store.c
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-05-02 14:05:57 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-05-02 14:40:41 +0900
commit6a14a591065a88a1f5fce3fb062b84977f924006 (patch)
treeb680e69ac32f68d4a9b45db662f0e6ec5f03307b /ext/openssl/ossl_x509store.c
parentfa51e0c91ebb4df91adb40365de70d3c19c232aa (diff)
downloadruby-openssl-6a14a591065a88a1f5fce3fb062b84977f924006.tar.gz
Remove SafeGet*() macros
They are no longer useful since we use the TypedData_Get_Struct() which also performs type checking (based on the rb_data_type_t) for the non-safe Get*() macros. Just use them instead.
Diffstat (limited to 'ext/openssl/ossl_x509store.c')
-rw-r--r--ext/openssl/ossl_x509store.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/ext/openssl/ossl_x509store.c b/ext/openssl/ossl_x509store.c
index 3ea6ea14..fc168ad9 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -23,10 +23,6 @@
ossl_raise(rb_eRuntimeError, "STORE wasn't initialized!"); \
} \
} while (0)
-#define SafeGetX509Store(obj, st) do { \
- OSSL_Check_Kind((obj), cX509Store); \
- GetX509Store((obj), (st)); \
-} while (0)
#define NewX509StCtx(klass) \
TypedData_Wrap_Struct((klass), &ossl_x509stctx_type, 0)
@@ -42,10 +38,6 @@
ossl_raise(rb_eRuntimeError, "STORE_CTX is out of scope!"); \
} \
} while (0)
-#define SafeGetX509StCtx(obj, storep) do { \
- OSSL_Check_Kind((obj), cX509StoreContext); \
- GetX509Store((obj), (ctx)); \
-} while (0)
/*
* Verify callback stuff
@@ -146,7 +138,7 @@ GetX509StorePtr(VALUE obj)
{
X509_STORE *store;
- SafeGetX509Store(obj, store);
+ GetX509Store(obj, store);
return store;
}
@@ -156,7 +148,7 @@ DupX509StorePtr(VALUE obj)
{
X509_STORE *store;
- SafeGetX509Store(obj, store);
+ GetX509Store(obj, store);
X509_STORE_up_ref(store);
return store;
@@ -553,7 +545,7 @@ ossl_x509stctx_initialize(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "12", &store, &cert, &chain);
GetX509StCtx(self, ctx);
- SafeGetX509Store(store, x509st);
+ GetX509Store(store, x509st);
if(!NIL_P(cert)) x509 = DupX509CertPtr(cert); /* NEED TO DUP */
if(!NIL_P(chain)) x509s = ossl_x509_ary2sk(chain);
if(X509_STORE_CTX_init(ctx, x509st, x509, x509s) != 1){