00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 2 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 * 00016 * (c)Copyright 2006 Hewlett-Packard Development Company, LP. 00017 * 00018 */ 00019 00020 #ifndef _C_TRANS_IP_TLS_H 00021 #define _C_TRANS_IP_TLS_H 00022 00023 #include "C_TransIP.hpp" 00024 #include "ssl_t.hpp" 00025 00026 00027 00028 class C_TransIPTLS : public C_TransIP { 00029 00030 public: 00031 00032 C_TransIPTLS(); 00033 virtual ~C_TransIPTLS(); 00034 00035 virtual int init (char *P_buf, 00036 T_logFunction P_logError, 00037 T_logFunction P_logInfo) ; 00038 00039 virtual int config (T_pConfigValueList P_config_param_list) ; 00040 00041 typedef SSL_METHOD* (*T_SSLMethodType)(void); 00042 typedef struct _T_supported_methods { 00043 char *m_name ; 00044 T_SSLMethodType m_method ; 00045 } T_supported_methods ; 00046 00047 protected : 00048 00049 virtual C_Socket* open (int P_channel_id, 00050 T_pIpAddr P_Addr, 00051 T_pOpenStatus P_status, 00052 C_ProtocolBinaryFrame *P_protocol) ; 00053 00054 virtual int set_option (int P_Channel_Id, char *P_buf) ; 00055 00056 int analyze_config(T_ConfigValue& P_config) ; 00057 00058 virtual bool analyze_init_string (char *P_buf) ; 00059 00060 int load_crls(char *crlfile) ; 00061 00062 00063 protected : 00064 00065 C_Socket* make_secure (C_Socket *) ; 00066 00067 T_SSLMethodType find_method(char* P_name); 00068 00069 SSL_CTX *m_ssl_ctx ; 00070 char *m_passwd ; 00071 char *m_cert_chain_file ; 00072 char *m_crl_file ; 00073 char *m_private_key_file ; 00074 T_SSLMethodType m_method ; 00075 00076 bool m_start_secure_mode ; 00077 00078 } ; 00079 00080 extern "C" T_pTransport create_ciptlsio_instance () ; 00081 extern "C" void delete_ciptlsio_instance (T_ppTransport) ; 00082 00083 00084 00085 #endif // _C_TRANS_IP_TLS_H 00086 00087 00088 00089 00090 00091