summaryrefslogtreecommitdiff
path: root/ACE/protocols/ace/INet/SSL_X509Cert.inl
blob: 01c6d650aaa180769270bd581443e091055eb273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// -*- C++ -*-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
{
  namespace INet
  {

    ACE_INLINE
    SSL_X509Cert::SSL_X509Cert ()
      : ssl_cert_ (0)
      {
      }

    ACE_INLINE
    SSL_X509Cert::SSL_X509Cert (::X509* ssl_cert)
      : ssl_cert_ (0)
      {
        *this = ssl_cert;
      }

    ACE_INLINE
    SSL_X509Cert::SSL_X509Cert (const SSL_X509Cert& cert)
      {
        *this = cert;
      }

    ACE_INLINE
    SSL_X509Cert::~SSL_X509Cert ()
      {
      }

    ACE_INLINE
    SSL_X509Cert& SSL_X509Cert::operator= (::X509* ssl_cert)
      {
        if (this->ssl_cert_ != 0)
          ::X509_free (this->ssl_cert_);

        if (ssl_cert != 0)
          {
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
            ::X509_up_ref(x509);
#else
            CRYPTO_add (&(ssl_cert->references),
                        1,
                        CRYPTO_LOCK_X509);
#endif
          }
        this->ssl_cert_ = ssl_cert;
        return *this;
      }

    ACE_INLINE
    SSL_X509Cert& SSL_X509Cert::operator= (const SSL_X509Cert& ssl_cert)
      {
        return (*this = &(const_cast<SSL_X509Cert&> (ssl_cert)));
      }

    ACE_INLINE
    ::X509* SSL_X509Cert::operator & (void)
      {
        return this->ssl_cert_;
      }

  }
}

ACE_END_VERSIONED_NAMESPACE_DECL