ssl_toolkit_compat.h revision 766c20b0366e1d0e359e0d9a834669e19a4db3d9
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*/
#ifndef SSL_TOOLKIT_COMPAT_H
#define SSL_TOOLKIT_COMPAT_H
/*
* this header file provides a compatiblity layer
* between OpenSSL and RSA sslc
*/
#ifdef OPENSSL_VERSION_NUMBER
/*
* rsa sslc uses incomplete types for most structures
* so we macroize for OpenSSL those which cannot be dereferenced
* using the same sames as the sslc functions
*/
#define SSL_CIPHER_get_name(s) (s->name)
#define SSL_CIPHER_get_valid(s) (s->valid)
#define SSL_SESSION_get_session_id(s) (s->session_id)
#define SSL_SESSION_get_session_id_length(s) (s->session_id_length)
/*
* Support for retrieving/overriding states
*/
#ifndef SSL_get_state
#endif
#define MODSSL_BIO_CB_ARG_TYPE const char
#define MODSSL_CRYPTO_CB_ARG_TYPE const char
#define modssl_free OPENSSL_free
#define EVP_PKEY_reference_inc(pkey) \
#define X509_reference_inc(cert) \
#define HAVE_SSL_RAND_EGD /* since 9.5.1 */
#define HAVE_SSL_X509V3_EXT_d2i
#else /* RSA sslc */
/* sslc does not support this function, OpenSSL has since 9.5.1 */
#define RAND_status() 1
/* sslc names this function a bit differently */
#define CRYPTO_num_locks() CRYPTO_get_num_locks()
#ifndef STACK_OF
#endif
#define MODSSL_BIO_CB_ARG_TYPE char
#define MODSSL_CRYPTO_CB_ARG_TYPE char
PEM_read_bio_X509(b, x, cb)
PEM_X509_INFO_read_bio(b, x, cb)
PEM_read_bio_PrivateKey(b, k, cb)
#ifndef HAVE_SSL_SET_STATE
#endif
#define modssl_set_cipher_list(ssl, l) \
SSL_set_cipher_list(ssl, (char *)l)
#define modssl_free free
#ifndef PEM_F_DEF_CALLBACK
#define PEM_F_DEF_CALLBACK PEM_F_DEF_CB
#endif
#if SSLC_VERSION < 0x2000
#define X509_STORE_CTX_set_depth(st, d)
#define NO_SSL_X509V3_H
#endif
/* BEGIN GENERATED SECTION */
#define sk_SSL_CIPHER_free sk_free
#define sk_SSL_CIPHER_dup sk_dup
#define sk_SSL_CIPHER_num sk_num
#define sk_X509_num sk_num
#define sk_X509_push sk_push
#define sk_X509_INFO_free sk_free
#define sk_X509_INFO_pop_free sk_pop_free
#define sk_X509_INFO_num sk_num
#define sk_X509_INFO_new_null sk_new_null
#define sk_X509_NAME_num sk_num
#define sk_X509_NAME_free sk_free
#define sk_X509_NAME_new sk_new
#define sk_X509_NAME_ENTRY_num sk_num
#define sk_X509_REVOKED_num sk_num
#define sk_X509_pop_free sk_pop_free
/* END GENERATED SECTION */
#endif /* OPENSSL_VERSION_NUMBER */
#ifndef modssl_set_verify
#endif
#ifndef NO_SSL_X509V3_H
#define HAVE_SSL_X509V3_H
#endif
#endif /* SSL_TOOLKIT_COMPAT_H */