blob: 1b4581bd5fb8d707c7127276cac012e7a739c8da (
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
130
131
132
133
134
135
136
137
138
139
140
141
142
|
// **********************************************************************
//
// Copyright (c) 2001
// Mutable Realms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************
#include <IceSSL/OpenSSLJanitors.h>
IceSSL::OpenSSL::RSAJanitor::RSAJanitor(RSA* rsa) :
_rsa(rsa)
{
assert(_rsa != 0);
}
IceSSL::OpenSSL::RSAJanitor::~RSAJanitor()
{
if(_rsa)
{
RSA_free(_rsa);
}
}
void
IceSSL::OpenSSL::RSAJanitor::clear()
{
_rsa = 0;
}
RSA*
IceSSL::OpenSSL::RSAJanitor::get() const
{
return _rsa;
}
IceSSL::OpenSSL::EVP_PKEYJanitor::EVP_PKEYJanitor(EVP_PKEY* evp_pkey) :
_evp_pkey(evp_pkey)
{
assert(_evp_pkey != 0);
}
IceSSL::OpenSSL::EVP_PKEYJanitor::~EVP_PKEYJanitor()
{
if(_evp_pkey)
{
EVP_PKEY_free(_evp_pkey);
}
}
void
IceSSL::OpenSSL::EVP_PKEYJanitor::clear()
{
_evp_pkey = 0;
}
EVP_PKEY*
IceSSL::OpenSSL::EVP_PKEYJanitor::get() const
{
return _evp_pkey;
}
IceSSL::OpenSSL::X509_REQJanitor::X509_REQJanitor(X509_REQ* x509_req) :
_x509_req(x509_req)
{
assert(_x509_req != 0);
}
IceSSL::OpenSSL::X509_REQJanitor::~X509_REQJanitor()
{
if(_x509_req)
{
X509_REQ_free(_x509_req);
}
}
void
IceSSL::OpenSSL::X509_REQJanitor::clear()
{
_x509_req = 0;
}
X509_REQ*
IceSSL::OpenSSL::X509_REQJanitor::get() const
{
return _x509_req;
}
IceSSL::OpenSSL::X509Janitor::X509Janitor(X509* x509) :
_x509(x509)
{
assert(_x509 != 0);
}
IceSSL::OpenSSL::X509Janitor::~X509Janitor()
{
if(_x509)
{
X509_free(_x509);
}
}
void
IceSSL::OpenSSL::X509Janitor::clear()
{
_x509 = 0;
}
X509*
IceSSL::OpenSSL::X509Janitor::get() const
{
return _x509;
}
IceSSL::OpenSSL::BIOJanitor::BIOJanitor(BIO* bio) :
_bio(bio)
{
assert(_bio != 0);
}
IceSSL::OpenSSL::BIOJanitor::~BIOJanitor()
{
if(_bio)
{
BIO_free(_bio);
}
}
void
IceSSL::OpenSSL::BIOJanitor::clear()
{
_bio = 0;
}
BIO*
IceSSL::OpenSSL::BIOJanitor::get() const
{
return _bio;
}
|