Skip to content

Commit 5ebd05b

Browse files
jblomerdpiparo
authored andcommitted
[net] deprecate TSSLSocket
(cherry picked from commit db8b305)
1 parent c225836 commit 5ebd05b

6 files changed

Lines changed: 35 additions & 29 deletions

File tree

README/ReleaseNotes/v640/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ The following people have contributed to this new version:
6060
* The `TFTP`, `TNetFile`, `TNetFileStager`, and `TNetSystem` classes are deprecated and will be removed in ROOT 6.42. These classes rely on **rootd**, which was removed in release 6.16.
6161
* The ROOT **auth** package together with `TVirtualAuth` and `TROOT::GetListOfSecContexts()`, and the **authenticated sockets** (`TSocket::CreateAuthSocket()`) feature are deprecated and will be remove in ROOT 6.42.
6262
The security assumtions in the current socket authentication implementation is not up to date anymore.
63-
Secure communication should be provided by standard means, such as SSL sockets or SSH tunneling.
63+
Secure communication should be provided by external means, such as SSH tunneling.
64+
* The `TSSLSocket` class is deprecated and should not be used in user code anymore. Secure communication should be provided by externals means, such as SSH tunneling.
6465
* The `builtin_davix` build option has been removed.
6566
The Davix I/O code in ROOT remains uneffected and is built as before provided that the Davix library is found on the system.
6667
* `RRealField::SetQuantized` now has a new overload and the existing signature has been deprecated. The new overload enforces proper ordering of the arguments.
@@ -803,4 +804,3 @@ More than 130 items were addressed for this release:
803804
* [[ROOT-7499](https://its.cern.ch/jira/browse/ROOT-7499)] - ExpectedData generated from RooSimultaneous does not have non-integer weights
804805
* [[ROOT-5306](https://its.cern.ch/jira/browse/ROOT-5306)] - Read a file with a versioned class layout fails if the current class layout is unversioned
805806
* [[ROOT-5174](https://its.cern.ch/jira/browse/ROOT-5174)] - rootcling without linkdef
806-

gui/guihtml/src/TGHtmlBrowser.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Ssiz_t ReadSize(const char *url)
268268
return 0;
269269
if (uri.BeginsWith("https://")) {
270270
#ifdef R__SSL
271-
s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
271+
s = new ROOT::Deprecated::TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
272272
#else
273273
::Error("ReadSize", "library compiled without SSL, https not supported");
274274
return 0;
@@ -328,7 +328,7 @@ static char *ReadRemote(const char *url)
328328
return 0;
329329
if (uri.BeginsWith("https://")) {
330330
#ifdef R__SSL
331-
s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
331+
s = new ROOT::Deprecated::TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
332332
#else
333333
::Error("ReadRemote", "library compiled without SSL, https not supported");
334334
return 0;
@@ -699,4 +699,3 @@ Bool_t TGHtmlBrowser::ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t)
699699
}
700700
return kTRUE;
701701
}
702-

gui/guihtml/src/TGHtmlImage.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static TImage *ReadRemoteImage(const char *url)
236236
TSocket *s;
237237
if (uri.BeginsWith("https://")) {
238238
#ifdef R__SSL
239-
s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
239+
s = new ROOT::Deprecated::TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
240240
#else
241241
::Error("ReadRemoteImage", "library compiled without SSL, https not supported");
242242
return 0;

net/net/inc/LinkDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#ifdef R__SSL
5555
#pragma link C++ class ROOT::Deprecated::TS3HTTPRequest+;
5656
#pragma link C++ class ROOT::Deprecated::TS3WebFile+;
57-
#pragma link C++ class TSSLSocket;
57+
#pragma link C++ class ROOT::Deprecated::TSSLSocket;
5858
#endif
5959

6060
#pragma read sourceClass="TGridCollection" version="[-1]" targetClass="ROOT::Deprecated::TGridCollection"

net/net/inc/TSSLSocket.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include "TSocket.h"
2424

25+
namespace ROOT::Deprecated {
26+
2527
typedef struct ssl_st SSL;
2628
typedef struct ssl_ctx_st SSL_CTX;
2729

@@ -78,4 +80,10 @@ class TSSLSocket : public TSocket {
7880
ClassDefOverride(TSSLSocket,0) // SSL wrapped socket
7981
};
8082

83+
} // namespace ROOT::Deprecated
84+
85+
using TSSLSocket R__DEPRECATED(6, 42,
86+
"ROOT is not providing an SSL socket API anymore. "
87+
"Consider using SSH tunneling for secure channels.") = ROOT::Deprecated::TSSLSocket;
88+
8189
#endif

net/net/src/TSSLSocket.cxx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ not limited to, the management of the connections to said sockets.
2626
#include "strlcpy.h"
2727

2828
// Static properties
29-
char TSSLSocket::fgSSLCAFile[FILENAME_MAX] = "";
30-
char TSSLSocket::fgSSLCAPath[FILENAME_MAX] = "";
31-
char TSSLSocket::fgSSLUCert[FILENAME_MAX] = "";
32-
char TSSLSocket::fgSSLUKey[FILENAME_MAX] = "";
29+
char ROOT::Deprecated::TSSLSocket::fgSSLCAFile[FILENAME_MAX] = "";
30+
char ROOT::Deprecated::TSSLSocket::fgSSLCAPath[FILENAME_MAX] = "";
31+
char ROOT::Deprecated::TSSLSocket::fgSSLUCert[FILENAME_MAX] = "";
32+
char ROOT::Deprecated::TSSLSocket::fgSSLUKey[FILENAME_MAX] = "";
3333

3434
////////////////////////////////////////////////////////////////////////////////
3535
// SSL debugging
3636

37-
void ssl_info_callback(const SSL* ssl, int where, int ret)
37+
static void ssl_info_callback(const SSL *ssl, int where, int ret)
3838
{
3939
if (ret == 0) {
4040
std::cout << "-- ssl_info_callback: error occurred.\n";
@@ -50,7 +50,7 @@ void ssl_info_callback(const SSL* ssl, int where, int ret)
5050
////////////////////////////////////////////////////////////////////////////////
5151
/// Wraps the socket with OpenSSL.
5252

53-
void TSSLSocket::WrapWithSSL(void)
53+
void ROOT::Deprecated::TSSLSocket::WrapWithSSL(void)
5454
{
5555
SSL_library_init();
5656

@@ -108,68 +108,68 @@ void TSSLSocket::WrapWithSSL(void)
108108

109109
////////////////////////////////////////////////////////////////////////////////
110110

111-
TSSLSocket::TSSLSocket(TInetAddress addr, const char *service, Int_t tcpwindowsize)
111+
ROOT::Deprecated::TSSLSocket::TSSLSocket(TInetAddress addr, const char *service, Int_t tcpwindowsize)
112112
: TSocket(addr, service, tcpwindowsize)
113113
{
114114
WrapWithSSL();
115115
}
116116

117117
////////////////////////////////////////////////////////////////////////////////
118118

119-
TSSLSocket::TSSLSocket(TInetAddress addr, Int_t port, Int_t tcpwindowsize)
119+
ROOT::Deprecated::TSSLSocket::TSSLSocket(TInetAddress addr, Int_t port, Int_t tcpwindowsize)
120120
: TSocket(addr, port, tcpwindowsize)
121121
{
122122
WrapWithSSL();
123123
}
124124

125125
////////////////////////////////////////////////////////////////////////////////
126126

127-
TSSLSocket::TSSLSocket(const char *host, const char *service, Int_t tcpwindowsize)
127+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const char *host, const char *service, Int_t tcpwindowsize)
128128
: TSocket(host, service, tcpwindowsize)
129129
{
130130
WrapWithSSL();
131131
}
132132

133133
////////////////////////////////////////////////////////////////////////////////
134134

135-
TSSLSocket::TSSLSocket(const char *url, Int_t port, Int_t tcpwindowsize)
135+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const char *url, Int_t port, Int_t tcpwindowsize)
136136
: TSocket(url, port, tcpwindowsize)
137137
{
138138
WrapWithSSL();
139139
}
140140

141141
////////////////////////////////////////////////////////////////////////////////
142142

143-
TSSLSocket::TSSLSocket(const char *sockpath) : TSocket(sockpath)
143+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const char *sockpath) : TSocket(sockpath)
144144
{
145145
WrapWithSSL();
146146
}
147147

148148
////////////////////////////////////////////////////////////////////////////////
149149

150-
TSSLSocket::TSSLSocket(Int_t desc) : TSocket(desc)
150+
ROOT::Deprecated::TSSLSocket::TSSLSocket(Int_t desc) : TSocket(desc)
151151
{
152152
WrapWithSSL();
153153
}
154154

155155
////////////////////////////////////////////////////////////////////////////////
156156

157-
TSSLSocket::TSSLSocket(Int_t desc, const char *sockpath) : TSocket(desc, sockpath)
157+
ROOT::Deprecated::TSSLSocket::TSSLSocket(Int_t desc, const char *sockpath) : TSocket(desc, sockpath)
158158
{
159159
WrapWithSSL();
160160
}
161161

162162
////////////////////////////////////////////////////////////////////////////////
163163

164-
TSSLSocket::TSSLSocket(const TSSLSocket &s) : TSocket(s)
164+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const TSSLSocket &s) : TSocket(s)
165165
{
166166
WrapWithSSL();
167167
}
168168

169169
////////////////////////////////////////////////////////////////////////////////
170170
/// Close gracefully the connection, and free SSL structures.
171171

172-
TSSLSocket::~TSSLSocket()
172+
ROOT::Deprecated::TSSLSocket::~TSSLSocket()
173173
{
174174
Close();
175175
if (fSSL)
@@ -181,7 +181,7 @@ TSSLSocket::~TSSLSocket()
181181
////////////////////////////////////////////////////////////////////////////////
182182
/// Close the SSL connection.
183183

184-
void TSSLSocket::Close(Option_t *option)
184+
void ROOT::Deprecated::TSSLSocket::Close(Option_t *option)
185185
{
186186
if (fSSL)
187187
SSL_shutdown(fSSL);
@@ -191,8 +191,7 @@ void TSSLSocket::Close(Option_t *option)
191191
////////////////////////////////////////////////////////////////////////////////
192192
/// Set up the static configuration variables.
193193

194-
void TSSLSocket::SetUpSSL(const char *cafile, const char *capath,
195-
const char *ucert, const char *ukey)
194+
void ROOT::Deprecated::TSSLSocket::SetUpSSL(const char *cafile, const char *capath, const char *ucert, const char *ukey)
196195
{
197196
if (cafile)
198197
strlcpy(fgSSLCAFile, cafile, FILENAME_MAX);
@@ -206,7 +205,7 @@ void TSSLSocket::SetUpSSL(const char *cafile, const char *capath,
206205

207206
////////////////////////////////////////////////////////////////////////////////
208207

209-
Int_t TSSLSocket::Recv(TMessage *& /*mess */)
208+
Int_t ROOT::Deprecated::TSSLSocket::Recv(TMessage *& /*mess */)
210209
{
211210
Error("Recv", "not implemented");
212211
return -1;
@@ -215,7 +214,7 @@ Int_t TSSLSocket::Recv(TMessage *& /*mess */)
215214
////////////////////////////////////////////////////////////////////////////////
216215
/// Receive a raw buffer of specified length bytes.
217216

218-
Int_t TSSLSocket::RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt)
217+
Int_t ROOT::Deprecated::TSSLSocket::RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt)
219218
{
220219
TSystem::ResetErrno();
221220

@@ -271,7 +270,7 @@ Int_t TSSLSocket::RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt)
271270

272271
////////////////////////////////////////////////////////////////////////////////
273272

274-
Int_t TSSLSocket::Send(const TMessage & /* mess */)
273+
Int_t ROOT::Deprecated::TSSLSocket::Send(const TMessage & /* mess */)
275274
{
276275
Error("Send", "not implemented");
277276
return -1;
@@ -280,7 +279,7 @@ Int_t TSSLSocket::Send(const TMessage & /* mess */)
280279
////////////////////////////////////////////////////////////////////////////////
281280
/// Send a raw buffer of specified length.
282281

283-
Int_t TSSLSocket::SendRaw(const void *buffer, Int_t length, ESendRecvOptions /* opt */)
282+
Int_t ROOT::Deprecated::TSSLSocket::SendRaw(const void *buffer, Int_t length, ESendRecvOptions /* opt */)
284283
{
285284
TSystem::ResetErrno();
286285

0 commit comments

Comments
 (0)