1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ssl/libssl/inc/libssl_wsd.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,197 @@
1.4 +/*
1.5 +Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.6 +
1.7 +Redistribution and use in source and binary forms, with or without
1.8 +modification, are permitted provided that the following conditions are met:
1.9 +
1.10 +* Redistributions of source code must retain the above copyright notice, this
1.11 + list of conditions and the following disclaimer.
1.12 +* Redistributions in binary form must reproduce the above copyright notice,
1.13 + this list of conditions and the following disclaimer in the documentation
1.14 + and/or other materials provided with the distribution.
1.15 +* Neither the name of Nokia Corporation nor the names of its contributors
1.16 + may be used to endorse or promote products derived from this software
1.17 + without specific prior written permission.
1.18 +
1.19 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1.20 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.21 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1.22 +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
1.23 +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.24 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1.25 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1.26 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
1.27 +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1.28 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.29 +
1.30 +Description:
1.31 +*/
1.32 +
1.33 +
1.34 +#ifndef _LIBSSL_WSD_H_
1.35 +#define _LIBSSL_WSD_H_
1.36 +
1.37 +
1.38 +#include <openssl/bio.h>
1.39 +#include <openssl/ssl.h>
1.40 +#include "libssl_wsd_defs.h"
1.41 +
1.42 +#ifdef EMULATOR
1.43 +
1.44 +
1.45 +#define SSL_MD_NUM_IDX 2
1.46 +#define SSL_ENC_NUM_IDX 9
1.47 +
1.48 +#define SSL_STR_FUNCTS_NUM 172
1.49 +#define SSL_STR_REASONS_NUM 238
1.50 +
1.51 +#define SSL3_MAX_NUM_CIPHERS 87 /* Must be updated once new ciphers are added. */
1.52 +#define SSL2_MAX_NUM_CIPHERS 10 /* Must be updated once new ciphers are added. */
1.53 +
1.54 +#define SSL3_NUM_CIPHERS (sizeof(temp_ssl3_ciphers)/sizeof(SSL_CIPHER))
1.55 +#define SSL2_NUM_CIPHERS (sizeof(temp_ssl2_ciphers)/sizeof(SSL_CIPHER))
1.56 +
1.57 +/* This is for the SSLv3/TLSv1.0 differences in crypto/hash stuff
1.58 + * It is a bit of a mess of functions, but hell, think of it as
1.59 + * an opaque structure :-) */
1.60 +typedef struct ssl3_enc_method
1.61 + {
1.62 + int (*enc)(SSL *, int);
1.63 + int (*mac)(SSL *, unsigned char *, int);
1.64 + int (*setup_key_block)(SSL *);
1.65 + int (*generate_master_secret)(SSL *, unsigned char *, unsigned char *, int);
1.66 + int (*change_cipher_state)(SSL *, int);
1.67 + int (*final_finish_mac)(SSL *, EVP_MD_CTX *, EVP_MD_CTX *, const char *, int, unsigned char *);
1.68 + int finish_mac_length;
1.69 + int (*cert_verify_mac)(SSL *, EVP_MD_CTX *, unsigned char *);
1.70 + const char *client_finished_label;
1.71 + int client_finished_label_len;
1.72 + const char *server_finished_label;
1.73 + int server_finished_label_len;
1.74 + int (*alert_value)(int);
1.75 + } SSL3_ENC_METHOD;
1.76 +
1.77 +typedef struct{
1.78 +
1.79 + /* bio_ssl.c */
1.80 + VARIABLE_DECL(methods_sslp,s,bio_ssl,BIO_METHOD) //static
1.81 +
1.82 + /* d1_meth.c */
1.83 + VARIABLE_DECL(DTLSv1_method_data,s,d1_meth,SSL_METHOD) //static
1.84 +
1.85 + /* d1_clnt.c */
1.86 + VARIABLE_DECL(DTLSv1_client_method_data,s,d1_clnt,SSL_METHOD) //static
1.87 +
1.88 + /* d1_lib.c */
1.89 + VARIABLE_DECL(dtlsv1_base_method_data,s,d1_lib,SSL_METHOD) //static
1.90 +
1.91 + /* d1_srvr.c */
1.92 + VARIABLE_DECL(DTLSv1_server_method_data,s,d1_srvr,SSL_METHOD) //static
1.93 +
1.94 + /* s23_clnt.c */
1.95 + VARIABLE_DECL(SSLv23_client_method_data,s,s23_clnt,SSL_METHOD) //static
1.96 +
1.97 + /* s23_lib.c */
1.98 + VARIABLE_DECL(sslv23_base_method_data,s,s23_lib,SSL_METHOD) //static
1.99 +
1.100 + /* s23_meth.c */
1.101 + VARIABLE_DECL(SSLv23_method_data,s,s23_meth,SSL_METHOD) //static
1.102 +
1.103 + /* s23_srvr.c */
1.104 + VARIABLE_DECL(SSLv23_server_method_data,s,s23_srvr,SSL_METHOD) //static
1.105 +
1.106 + /* s2_clnt.c */
1.107 + VARIABLE_DECL(SSLv2_client_method_data,s,s2_clnt,SSL_METHOD) //static
1.108 +
1.109 + /* s2_lib.c */
1.110 + VARIABLE_DECL(sslv2_base_method_data,s,s2_lib,SSL_METHOD) //static
1.111 +
1.112 + /* s2_meth.c */
1.113 + VARIABLE_DECL(SSLv2_method_data,s,s2_meth,SSL_METHOD) //static
1.114 +
1.115 + /* s2_srvr.c */
1.116 + VARIABLE_DECL(SSLv2_server_method_data,s,s2_srvr,SSL_METHOD) //static
1.117 +
1.118 + /* s3_clnt.c */
1.119 + VARIABLE_DECL(SSLv3_client_method_data,s,s3_clnt,SSL_METHOD) //static
1.120 +
1.121 + /* s3_lib.c */
1.122 + VARIABLE_DECL(sslv3_base_method_data,s,s3_lib,SSL_METHOD) //static
1.123 +
1.124 + /* s3_meth.c */
1.125 + VARIABLE_DECL(SSLv3_method_data,s,s3_meth,SSL_METHOD) //static
1.126 +
1.127 + /* s3_srvr.c */
1.128 + VARIABLE_DECL(SSLv3_server_method_data,s,s3_srvr,SSL_METHOD) //static
1.129 +
1.130 + /* t1_clnt.c */
1.131 + VARIABLE_DECL(TLSv1_client_method_data,s,t1_clnt,SSL_METHOD) //static
1.132 +
1.133 + /* t1_lib.c */
1.134 + VARIABLE_DECL(tlsv1_base_method_data,s,t1_lib,SSL_METHOD) //static
1.135 +
1.136 + /* t1_srvr.c */
1.137 + VARIABLE_DECL(TLSv1_server_method_data,s,t1_srvr,SSL_METHOD) //static
1.138 +
1.139 + /* t1_meth.c */
1.140 + VARIABLE_DECL(TLSv1_method_data,s,t1_meth,SSL_METHOD) //static
1.141 +
1.142 + /* ssl_cert.c */
1.143 + VARIABLE_DECL(ssl_x509_store_ctx_idx,s,ssl_cert,volatile int) //static
1.144 +
1.145 + /* ssl_ciph.c */
1.146 + VARIABLE_DECL(ssl_comp_methods,s,ssl_ciph,STACK_OF(SSL_COMP) *) //static
1.147 +
1.148 + /* ssl_ciph.c */
1.149 + VARIABLE_DECL_ARRAY(ssl_cipher_methods,s,ssl_ciph,const EVP_CIPHER *,SSL_ENC_NUM_IDX) //static
1.150 +
1.151 + /* ssl_ciph.c */
1.152 + VARIABLE_DECL_ARRAY(ssl_digest_methods,s,ssl_ciph,const EVP_MD *,SSL_MD_NUM_IDX) //static
1.153 +
1.154 +
1.155 + /* ssl_err.c */
1.156 + VARIABLE_DECL_ARRAY(SSL_str_functs,s,ssl_err,ERR_STRING_DATA,SSL_STR_FUNCTS_NUM) //static
1.157 +
1.158 + /* ssl_err.c */
1.159 + VARIABLE_DECL_ARRAY(SSL_str_reasons,s,ssl_err,ERR_STRING_DATA,SSL_STR_REASONS_NUM) //static
1.160 +
1.161 + /* s3_lib.c */
1.162 + VARIABLE_DECL_ARRAY(ssl3_ciphers,g,s3_lib,SSL_CIPHER,SSL3_MAX_NUM_CIPHERS) //global
1.163 +
1.164 + /* s3_lib.c */
1.165 + VARIABLE_DECL_ARRAY(ssl2_ciphers,g,s2_lib,SSL_CIPHER,SSL2_MAX_NUM_CIPHERS) //global
1.166 +
1.167 + /* ssl_lib.c */
1.168 + VARIABLE_DECL(ssl3_undef_enc_method,g,ssl_lib,SSL3_ENC_METHOD) //static
1.169 +
1.170 + /* d1_lib.c */
1.171 + VARIABLE_DECL(DTLSv1_enc_data,g,d1_lib,SSL3_ENC_METHOD) //static
1.172 +
1.173 + /* s3_lib.c */
1.174 + VARIABLE_DECL(SSLv3_enc_data,g,s3_lib,SSL3_ENC_METHOD) //static
1.175 +
1.176 + /* t1_lib.c */
1.177 + VARIABLE_DECL(TLSv1_enc_data,g,t1_lib,SSL3_ENC_METHOD) //static
1.178 +
1.179 +
1.180 +}_libssl_wsd;
1.181 +
1.182 +
1.183 +
1.184 +#ifdef __cplusplus
1.185 +extern "C" {
1.186 +#endif
1.187 +
1.188 +
1.189 +void InitSSLWsdVar(struct _libssl_wsd *p);
1.190 +
1.191 +//void Init_methods_sslp(/*_libssl_wsd *ptr*/);
1.192 +
1.193 +_libssl_wsd* Libssl_ImpurePtr();
1.194 +
1.195 +#ifdef __cplusplus
1.196 +}
1.197 +#endif
1.198 +
1.199 +#endif /* EMULATOR */
1.200 +#endif /* _LIBSSL_WSD_H_ */