aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-12 23:19:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-12 23:19:07 +0000
commit68c8994a697480386fe9c47468c07fa856c97f6b (patch)
tree7108461098d37e3e0a2d8e61455e13ef8a0b5962 /ext/openssl/ossl_pkey.h
parentbf368e4f48c8d8bbeb56b68f1457e126cebcc9ca (diff)
downloadruby-68c8994a697480386fe9c47468c07fa856c97f6b.tar.gz
ossl_pkey.c: typed data
* ext/openssl/ossl_pkey.c (ossl_evp_pkey_type): use typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey.h')
-rw-r--r--ext/openssl/ossl_pkey.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h
index 686e956ee5..6c0b7fd602 100644
--- a/ext/openssl/ossl_pkey.h
+++ b/ext/openssl/ossl_pkey.h
@@ -15,6 +15,7 @@ extern VALUE mPKey;
extern VALUE cPKey;
extern VALUE ePKeyError;
extern ID id_private_q;
+extern const rb_data_type_t ossl_evp_pkey_type;
#define OSSL_PKEY_SET_PRIVATE(obj) rb_iv_set((obj), "private", Qtrue)
#define OSSL_PKEY_SET_PUBLIC(obj) rb_iv_set((obj), "private", Qfalse)
@@ -24,11 +25,11 @@ extern ID id_private_q;
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
} \
- (obj) = Data_Wrap_Struct((klass), 0, EVP_PKEY_free, (pkey)); \
+ (obj) = TypedData_Wrap_Struct((klass), &ossl_evp_pkey_type, (pkey)); \
OSSL_PKEY_SET_PUBLIC(obj); \
} while (0)
#define GetPKey(obj, pkey) do {\
- Data_Get_Struct((obj), EVP_PKEY, (pkey));\
+ TypedData_Get_Struct((obj), EVP_PKEY, &ossl_evp_pkey_type, (pkey)); \
if (!(pkey)) { \
rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
} \