aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkcs7.h
diff options
context:
space:
mode:
authorBen Toews <mastahyeti@gmail.com>2018-06-21 10:26:30 -0600
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-10-01 11:25:06 +1300
commit23ae5c9cbf43dec30b138b952982f6212940943d (patch)
tree3dda9dfde0f1a55854a68e7f64a0fd6c7eaacb70 /ext/openssl/ossl_pkcs7.h
parentf201e3282ec0f93cb6e199dfbed4e80c0f57714b (diff)
downloadruby-openssl-23ae5c9cbf43dec30b138b952982f6212940943d.tar.gz
ts: get tests running/passing
A number of conventions seem to have changed, causing a fair bit of breakage: - `Data_*` was deprecated in favor of `TypedData_*` - `ossl_obj2bio` takes a `VALUE*` instead of `VALUE` now - `time_to_time_t()` was removed
Diffstat (limited to 'ext/openssl/ossl_pkcs7.h')
-rw-r--r--ext/openssl/ossl_pkcs7.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/openssl/ossl_pkcs7.h b/ext/openssl/ossl_pkcs7.h
index 139e00d6..0d0fea7e 100644
--- a/ext/openssl/ossl_pkcs7.h
+++ b/ext/openssl/ossl_pkcs7.h
@@ -10,6 +10,22 @@
#if !defined(_OSSL_PKCS7_H_)
#define _OSSL_PKCS7_H_
+#define NewPKCS7(klass) \
+ TypedData_Wrap_Struct((klass), &ossl_pkcs7_type, 0)
+#define SetPKCS7(obj, pkcs7) do { \
+ if (!(pkcs7)) { \
+ ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
+ } \
+ RTYPEDDATA_DATA(obj) = (pkcs7); \
+} while (0)
+#define GetPKCS7(obj, pkcs7) do { \
+ TypedData_Get_Struct((obj), PKCS7, &ossl_pkcs7_type, (pkcs7)); \
+ if (!(pkcs7)) { \
+ ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
+ } \
+} while (0)
+
+extern const rb_data_type_t ossl_pkcs7_type;
extern VALUE cPKCS7;
extern VALUE cPKCS7Signer;
extern VALUE cPKCS7Recipient;