blob: e20b30e774d60ddbd4dcb865e0a1a92f6bc32554 (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
// -*- C++ -*-
//
// $Id$
ACE_INLINE ::EVP_PKEY *
TAO::SSLIOP::_duplicate (::EVP_PKEY *key)
{
// OpenSSL provides no function to increase the reference count on
// the EVP_PKEY structure, so we do it manually.
if (key != 0)
CRYPTO_add (&(key->references), 1, CRYPTO_LOCK_EVP_PKEY);
return key;
}
ACE_INLINE void
TAO::SSLIOP::release (::EVP_PKEY *key)
{
// OpenSSL's EVP_PKEY_free() function already handles reference
// counting properly.
::EVP_PKEY_free (key);
}
// -------------------------------------------------------------------
ACE_INLINE
TAO::SSLIOP::EVP_PKEY_var::EVP_PKEY_var (void)
: evp_ (0)
{
}
ACE_INLINE
TAO::SSLIOP::EVP_PKEY_var::EVP_PKEY_var (::EVP_PKEY *x)
: evp_ (x)
{
}
ACE_INLINE
TAO::SSLIOP::EVP_PKEY_var::EVP_PKEY_var (const TAO::SSLIOP::EVP_PKEY_var &p)
: TAO_Base_var (),
evp_ (TAO::SSLIOP::_duplicate (p.ptr ()))
{
}
ACE_INLINE
TAO::SSLIOP::EVP_PKEY_var::~EVP_PKEY_var (void)
{
TAO::SSLIOP::release (this->evp_);
}
ACE_INLINE TAO::SSLIOP::EVP_PKEY_var &
TAO::SSLIOP::EVP_PKEY_var::operator= (::EVP_PKEY *p)
{
TAO::SSLIOP::release (this->evp_);
this->evp_ = p;
return *this;
}
ACE_INLINE TAO::SSLIOP::EVP_PKEY_var &
TAO::SSLIOP::EVP_PKEY_var::operator= (const TAO::SSLIOP::EVP_PKEY_var &p)
{
if (this != &p)
{
TAO::SSLIOP::release (this->evp_);
this->evp_ = TAO::SSLIOP::_duplicate (p.ptr ());
}
return *this;
}
ACE_INLINE const ::EVP_PKEY *
TAO::SSLIOP::EVP_PKEY_var::operator-> (void) const
{
return this->evp_;
}
ACE_INLINE ::EVP_PKEY *
TAO::SSLIOP::EVP_PKEY_var::operator-> (void)
{
return this->evp_;
}
ACE_INLINE
TAO::SSLIOP::EVP_PKEY_var::operator const ::EVP_PKEY &() const
{
return *this->evp_;
}
ACE_INLINE
TAO::SSLIOP::EVP_PKEY_var::operator ::EVP_PKEY &()
{
return *this->evp_;
}
ACE_INLINE ::EVP_PKEY *
TAO::SSLIOP::EVP_PKEY_var::in (void) const
{
return this->evp_;
}
ACE_INLINE ::EVP_PKEY *&
TAO::SSLIOP::EVP_PKEY_var::inout (void)
{
return this->evp_;
}
ACE_INLINE ::EVP_PKEY *&
TAO::SSLIOP::EVP_PKEY_var::out (void)
{
EVP_PKEY_free (this->evp_);
this->evp_ = 0;
return this->evp_;
}
ACE_INLINE ::EVP_PKEY *
TAO::SSLIOP::EVP_PKEY_var::_retn (void)
{
// Yield ownership of the EVP_PKEY structure.
::EVP_PKEY *x = this->evp_;
this->evp_ = 0;
return x;
}
ACE_INLINE ::EVP_PKEY *
TAO::SSLIOP::EVP_PKEY_var::ptr (void) const
{
return this->evp_;
}
|