2003-07-23 12:12:24 -04:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
* 'OpenSSL for Ruby' project
|
|
|
|
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
/*
|
2015-04-19 23:55:09 -04:00
|
|
|
* This program is licensed under the same licence as Ruby.
|
2003-07-23 12:12:24 -04:00
|
|
|
* (See the file 'LICENCE'.)
|
|
|
|
*/
|
|
|
|
#if !defined(_OSSL_SSL_H_)
|
|
|
|
#define _OSSL_SSL_H_
|
|
|
|
|
2014-12-12 16:57:33 -05:00
|
|
|
#define GetSSL(obj, ssl) do { \
|
2014-12-12 16:58:34 -05:00
|
|
|
TypedData_Get_Struct((obj), SSL, &ossl_ssl_type, (ssl)); \
|
2014-12-12 16:57:33 -05:00
|
|
|
} while (0)
|
|
|
|
|
2007-04-02 18:10:12 -04:00
|
|
|
#define GetSSLSession(obj, sess) do { \
|
2014-12-12 16:58:25 -05:00
|
|
|
TypedData_Get_Struct((obj), SSL_SESSION, &ossl_ssl_session_type, (sess)); \
|
2011-03-10 08:28:58 -05:00
|
|
|
if (!(sess)) { \
|
2007-04-02 18:10:12 -04:00
|
|
|
ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define SafeGetSSLSession(obj, sess) do { \
|
2011-03-10 08:28:58 -05:00
|
|
|
OSSL_Check_Kind((obj), cSSLSession); \
|
|
|
|
GetSSLSession((obj), (sess)); \
|
2007-04-02 18:10:12 -04:00
|
|
|
} while (0)
|
2010-04-22 04:04:13 -04:00
|
|
|
|
2014-12-12 16:58:34 -05:00
|
|
|
extern const rb_data_type_t ossl_ssl_type;
|
2014-12-12 16:58:25 -05:00
|
|
|
extern const rb_data_type_t ossl_ssl_session_type;
|
2003-07-23 12:12:24 -04:00
|
|
|
extern VALUE mSSL;
|
|
|
|
extern VALUE eSSLError;
|
|
|
|
extern VALUE cSSLSocket;
|
|
|
|
extern VALUE cSSLContext;
|
2007-04-02 18:10:12 -04:00
|
|
|
extern VALUE cSSLSession;
|
2003-07-23 12:12:24 -04:00
|
|
|
|
|
|
|
void Init_ossl_ssl(void);
|
2007-04-02 18:10:12 -04:00
|
|
|
void Init_ossl_ssl_session(void);
|
2003-07-23 12:12:24 -04:00
|
|
|
|
|
|
|
#endif /* _OSSL_SSL_H_ */
|
2007-04-02 18:10:12 -04:00
|
|
|
|