diff options
Diffstat (limited to 'ext/openssl/ossl_ssl.h')
-rw-r--r-- | ext/openssl/ossl_ssl.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/openssl/ossl_ssl.h b/ext/openssl/ossl_ssl.h index 034762fc..0c20b107 100644 --- a/ext/openssl/ossl_ssl.h +++ b/ext/openssl/ossl_ssl.h @@ -11,8 +11,12 @@ #if !defined(_OSSL_SSL_H_) #define _OSSL_SSL_H_ +#define GetSSL(obj, ssl) do { \ + TypedData_Get_Struct((obj), SSL, &ossl_ssl_type, (ssl)); \ +} while (0) + #define GetSSLSession(obj, sess) do { \ - Data_Get_Struct((obj), SSL_SESSION, (sess)); \ + TypedData_Get_Struct((obj), SSL_SESSION, &ossl_ssl_session_type, (sess)); \ if (!(sess)) { \ ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \ } \ @@ -23,6 +27,8 @@ GetSSLSession((obj), (sess)); \ } while (0) +extern const rb_data_type_t ossl_ssl_type; +extern const rb_data_type_t ossl_ssl_session_type; extern VALUE mSSL; extern VALUE eSSLError; extern VALUE cSSLSocket; |