3#include <openssl/crypto.h>
4#include <openssl/evp.h>
5#include <openssl/conf.h>
6#include <openssl/err.h>
7#include <openssl/ecdsa.h>
8#include <openssl/ecdh.h>
9#include <openssl/sha.h>
10#include <openssl/obj_mac.h>
11#include <openssl/bn.h>
21 template <
typename ssl_type>
26 operator ssl_type*() {
return obj; }
27 operator const ssl_type*()
const {
return obj; }
34 #define SSL_TYPE(name, ssl_type, free_func) \
35 struct name : public ssl_wrapper<ssl_type> \
37 name(ssl_type* obj=nullptr) \
38 : ssl_wrapper(obj) {} \
41 if( obj != nullptr ) \
46 SSL_TYPE(ec_group, EC_GROUP, EC_GROUP_free)
47 SSL_TYPE(ec_point, EC_POINT, EC_POINT_free)
48 SSL_TYPE(ecdsa_sig, ECDSA_SIG, ECDSA_SIG_free)
49 SSL_TYPE(bn_ctx, BN_CTX, BN_CTX_free)
50 SSL_TYPE(evp_cipher_ctx, EVP_CIPHER_CTX, EVP_CIPHER_CTX_free )
51 SSL_TYPE(ec_key, EC_KEY, EC_KEY_free)
#define SSL_TYPE(name, ssl_type, free_func)
const ssl_type * operator->() const
ssl_wrapper(ssl_type *obj)