diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-16 18:49:26 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-30 00:39:06 +0900 |
commit | fcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch) | |
tree | 64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/ext/openssl/ossl_ssl.h |
Fresh start
Diffstat (limited to 'jni/ruby/ext/openssl/ossl_ssl.h')
-rw-r--r-- | jni/ruby/ext/openssl/ossl_ssl.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/jni/ruby/ext/openssl/ossl_ssl.h b/jni/ruby/ext/openssl/ossl_ssl.h new file mode 100644 index 0000000..1215ab5 --- /dev/null +++ b/jni/ruby/ext/openssl/ossl_ssl.h @@ -0,0 +1,42 @@ +/* + * $Id: ossl_ssl.h 48801 2014-12-12 21:58:34Z nobu $ + * 'OpenSSL for Ruby' project + * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz> + * All rights reserved. + */ +/* + * This program is licenced under the same licence as Ruby. + * (See the file 'LICENCE'.) + */ +#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 { \ + TypedData_Get_Struct((obj), SSL_SESSION, &ossl_ssl_session_type, (sess)); \ + if (!(sess)) { \ + ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \ + } \ +} while (0) + +#define SafeGetSSLSession(obj, sess) do { \ + OSSL_Check_Kind((obj), cSSLSession); \ + 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; +extern VALUE cSSLContext; +extern VALUE cSSLSession; + +void Init_ossl_ssl(void); +void Init_ossl_ssl_session(void); + +#endif /* _OSSL_SSL_H_ */ + |