~ubuntu-branches/ubuntu/saucy/resiprocate/saucy-proposed

« back to all changes in this revision

Viewing changes to resip/stack/ssl/TlsTransport.hxx

  • Committer: Package Import Robot
  • Author(s): Daniel Pocock
  • Date: 2012-05-17 19:29:59 UTC
  • Revision ID: package-import@ubuntu.com-20120517192959-vv00m77isztdy64q
Tags: upstream-1.8.2
ImportĀ upstreamĀ versionĀ 1.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if !defined(RESIP_TLSTRANSPORT_HXX)
 
2
#define RESIP_TLSTRANSPORT_HXX
 
3
 
 
4
#if defined(HAVE_CONFIG_H)
 
5
  #include "config.h"
 
6
#endif
 
7
 
 
8
 
 
9
#include "resip/stack/TcpBaseTransport.hxx"
 
10
#include "resip/stack/SecurityTypes.hxx"
 
11
#include "rutil/HeapInstanceCounter.hxx"
 
12
#include "resip/stack/Compression.hxx"
 
13
 
 
14
#include <openssl/ssl.h>
 
15
 
 
16
namespace resip
 
17
{
 
18
 
 
19
class Connection;
 
20
class Message;
 
21
class Security;
 
22
 
 
23
class TlsTransport : public TcpBaseTransport
 
24
{
 
25
   public:
 
26
      RESIP_HeapCount(TlsTransport);
 
27
      TlsTransport(Fifo<TransactionMessage>& fifo, 
 
28
                   int portNum, 
 
29
                   IpVersion version,
 
30
                   const Data& interfaceObj,
 
31
                   Security& security,
 
32
                   const Data& sipDomain, 
 
33
                   SecurityTypes::SSLType sslType,
 
34
                   AfterSocketCreationFuncPtr socketFunc=0,
 
35
                   Compression &compression = Compression::Disabled,
 
36
                   unsigned transportFlags = 0,
 
37
                   SecurityTypes::TlsClientVerificationMode cvm = SecurityTypes::None,
 
38
                   bool useEmailAsSIP = false);
 
39
      virtual  ~TlsTransport();
 
40
 
 
41
      TransportType transport() const { return TLS; }
 
42
      SSL_CTX* getCtx() const;
 
43
 
 
44
      SecurityTypes::TlsClientVerificationMode getClientVerificationMode() 
 
45
         { return mClientVerificationMode; };
 
46
      bool isUseEmailAsSIP()
 
47
         { return mUseEmailAsSIP; };
 
48
 
 
49
   protected:
 
50
      Connection* createConnection(const Tuple& who, Socket fd, bool server=false);
 
51
 
 
52
      Security* mSecurity;
 
53
      SecurityTypes::SSLType mSslType;
 
54
      SSL_CTX* mDomainCtx;
 
55
      SecurityTypes::TlsClientVerificationMode mClientVerificationMode;
 
56
      /* If true, we will accept the email address in a client's subjectAltName
 
57
         as if it were a SIP URI.  This is convenient because many commercial
 
58
         CAs offer email certificates but not sip: certificates */
 
59
      bool mUseEmailAsSIP;
 
60
};
 
61
 
 
62
}
 
63
 
 
64
#endif
 
65
 
 
66
/* ====================================================================
 
67
 * The Vovida Software License, Version 1.0 
 
68
 * 
 
69
 * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
 
70
 * 
 
71
 * Redistribution and use in source and binary forms, with or without
 
72
 * modification, are permitted provided that the following conditions
 
73
 * are met:
 
74
 * 
 
75
 * 1. Redistributions of source code must retain the above copyright
 
76
 *    notice, this list of conditions and the following disclaimer.
 
77
 * 
 
78
 * 2. Redistributions in binary form must reproduce the above copyright
 
79
 *    notice, this list of conditions and the following disclaimer in
 
80
 *    the documentation and/or other materials provided with the
 
81
 *    distribution.
 
82
 * 
 
83
 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
 
84
 *    and "Vovida Open Communication Application Library (VOCAL)" must
 
85
 *    not be used to endorse or promote products derived from this
 
86
 *    software without prior written permission. For written
 
87
 *    permission, please contact vocal@vovida.org.
 
88
 *
 
89
 * 4. Products derived from this software may not be called "VOCAL", nor
 
90
 *    may "VOCAL" appear in their name, without prior written
 
91
 *    permission of Vovida Networks, Inc.
 
92
 * 
 
93
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
 
94
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 
95
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
 
96
 * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
 
97
 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
 
98
 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
 
99
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
100
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 
101
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 
102
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
103
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 
104
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 
105
 * DAMAGE.
 
106
 * 
 
107
 * ====================================================================
 
108
 * 
 
109
 * This software consists of voluntary contributions made by Vovida
 
110
 * Networks, Inc. and many individuals on behalf of Vovida Networks,
 
111
 * Inc.  For more information on Vovida Networks, Inc., please see
 
112
 * <http://www.vovida.org/>.
 
113
 *
 
114
 */