aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_x509crl.c
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2015-01-05 11:59:50 -0800
committerZachary Scott <e@zzak.io>2015-01-05 11:59:50 -0800
commit2953dfd4ad925a669110fed1993d6e83b24e420f (patch)
tree05e4d2a6750e0ce6dd408c2b8f2f5bf597cfe54a /ext/openssl/ossl_x509crl.c
parent77269de78e376981342127d30dc0b953b9bcd781 (diff)
downloadruby-openssl-2953dfd4ad925a669110fed1993d6e83b24e420f.tar.gz
Sync with ruby trunk
Diffstat (limited to 'ext/openssl/ossl_x509crl.c')
-rw-r--r--ext/openssl/ossl_x509crl.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c
index beacc260..461c226f 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -14,10 +14,10 @@
if (!(crl)) { \
ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, X509_CRL_free, (crl)); \
+ (obj) = TypedData_Wrap_Struct((klass), &ossl_x509crl_type, (crl)); \
} while (0)
#define GetX509CRL(obj, crl) do { \
- Data_Get_Struct((obj), X509_CRL, (crl)); \
+ TypedData_Get_Struct((obj), X509_CRL, &ossl_x509crl_type, (crl)); \
if (!(crl)) { \
ossl_raise(rb_eRuntimeError, "CRL wasn't initialized!"); \
} \
@@ -33,6 +33,20 @@
VALUE cX509CRL;
VALUE eX509CRLError;
+static void
+ossl_x509crl_free(void *ptr)
+{
+ X509_CRL_free(ptr);
+}
+
+static const rb_data_type_t ossl_x509crl_type = {
+ "OpenSSL/X509/CRL",
+ {
+ 0, ossl_x509crl_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
/*
* PUBLIC
*/