Mixe for Privacy and Anonymity in the Internet
CATLSClientSocket.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2000, The JAP-Team
3 All rights reserved.
4 Redistribution and use in source and binary forms, with or without modification,
5 are permitted provided that the following conditions are met:
6 
7  - Redistributions of source code must retain the above copyright notice,
8  this list of conditions and the following disclaimer.
9 
10  - Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation and/or
12  other materials provided with the distribution.
13 
14  - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
15  may be used to endorse or promote products derived from this software without specific
16  prior written permission.
17 
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
20 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
22 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
27 */
28 
29 #ifndef __CATLSCLIENTSOCKET_HPP__
30 #define __CATLSCLIENTSOCKET_HPP__
31 #ifndef ONLY_LOCAL_PROXY
32 #include "CASocketAddr.hpp"
33 #include "CASocket.hpp"
34 #include "CAMsg.hpp"
35 #include "CACertificate.hpp"
46 #define DEFAULT_HANDSHAKE_TIMEOUT 4
47 
49 {
50 
51 public:
54  SINT32 sendFully(const UINT8* buff,UINT32 len);
55  SINT32 send(const UINT8* buff,UINT32 len);
56  SINT32 receive(UINT8* buff,UINT32 len);
57  SINT32 close();
58 
60  SINT32 connect(const CASocketAddr & psa, UINT32 msTimeout);
61 
62  /*
63  SINT32 connect(CASocketAddr & psa)
64  {
65  return connect(psa, 1, 0);
66  }*/
67 
73 
74 protected:
75 
76  /*CASocket* getSocket()
77  {
78  return m_pSocket;
79  }*/
80 
81 private:
82  SINT32 doTLSConnect(const CASocketAddr &psa);
83 
84  SSL *m_pSSL;
85  SSL_CTX *m_pCtx;
86  //CASocket* m_pSocket;
90 };
91 
92 #endif
93 #endif //ONLY_LOCAL_PROXY
signed int SINT32
Definition: basetypedefs.h:132
unsigned char UINT8
Definition: basetypedefs.h:135
unsigned int UINT32
Definition: basetypedefs.h:131
This is an abstract class for representing a socket address used in CASocket, CADatagramSocket and CA...
SINT32 send(const UINT8 *buff, UINT32 len)
Sends all data over the network.
SINT32 close()
Shuts down the socket.
SINT32 receive(UINT8 *buff, UINT32 len)
Will receive some bytes from the socket.
SINT32 connect(const CASocketAddr &psa, UINT32 msTimeout)
Establishes the actual TCP/IP connection and performs the TLS handshake.
SINT32 sendFully(const UINT8 *buff, UINT32 len)
Sends all data over the network.
SINT32 setServerCertificate(CACertificate *pCert)
Sets the Certifcate we accept as server identification.
CACertificate * m_pRootCert
bool m_bConnectedTLS
is the TLS layer established ?
SINT32 doTLSConnect(const CASocketAddr &psa)
Does the TLS handshake.
UINT16 len
Definition: typedefs.hpp:0