Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
5b1fd2e5
Commit
5b1fd2e5
authored
19 years ago
by
Robert Shearman
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
SSL doesn't need to use a different socket to unsecure communications.
parent
17cbf1cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/wininet/internet.h
+0
-1
0 additions, 1 deletion
dlls/wininet/internet.h
dlls/wininet/netconnection.c
+40
-69
40 additions, 69 deletions
dlls/wininet/netconnection.c
with
40 additions
and
70 deletions
dlls/wininet/internet.h
+
0
−
1
View file @
5b1fd2e5
...
...
@@ -61,7 +61,6 @@ typedef struct
int
socketFD
;
#ifdef HAVE_OPENSSL_SSL_H
SSL
*
ssl_s
;
int
ssl_sock
;
char
*
peek_msg
;
char
*
peek_msg_mem
;
#endif
...
...
This diff is collapsed.
Click to expand it.
dlls/wininet/netconnection.c
+
40
−
69
View file @
5b1fd2e5
...
...
@@ -102,7 +102,6 @@ void NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
{
#ifdef HAVE_OPENSSL_SSL_H
TRACE
(
"using SSL connection
\n
"
);
connection
->
ssl_sock
=
-
1
;
if
(
OpenSSL_ssl_handle
)
/* already initilzed everything */
return
;
OpenSSL_ssl_handle
=
wine_dlopen
(
SONAME_LIBSSL
,
RTLD_NOW
,
NULL
,
0
);
...
...
@@ -174,22 +173,10 @@ void NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
BOOL
NETCON_connected
(
WININET_NETCONNECTION
*
connection
)
{
if
(
!
connection
->
useSSL
)
{
if
(
connection
->
socketFD
==
-
1
)
return
FALSE
;
return
TRUE
;
}
if
(
connection
->
socketFD
==
-
1
)
return
FALSE
;
else
{
#ifdef HAVE_OPENSSL_SSL_H
if
(
connection
->
ssl_sock
==
-
1
)
return
FALSE
;
return
TRUE
;
#else
return
FALSE
;
#endif
}
}
/******************************************************************************
...
...
@@ -200,22 +187,15 @@ BOOL NETCON_connected(WININET_NETCONNECTION *connection)
BOOL
NETCON_create
(
WININET_NETCONNECTION
*
connection
,
int
domain
,
int
type
,
int
protocol
)
{
if
(
!
connection
->
useSSL
)
{
connection
->
socketFD
=
socket
(
domain
,
type
,
protocol
);
if
(
connection
->
socketFD
==
-
1
)
return
FALSE
;
return
TRUE
;
}
else
{
#ifdef HAVE_OPENSSL_SSL_H
connection
->
ssl_sock
=
socket
(
domain
,
type
,
protocol
);
return
TRUE
;
#else
return
FALSE
;
#ifndef HAVE_OPENSSL_SSL_H
if
(
connection
->
useSSL
)
return
FALSE
;
#endif
}
connection
->
socketFD
=
socket
(
domain
,
type
,
protocol
);
if
(
connection
->
socketFD
==
-
1
)
return
FALSE
;
return
TRUE
;
}
/******************************************************************************
...
...
@@ -224,31 +204,27 @@ BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain,
*/
BOOL
NETCON_close
(
WININET_NETCONNECTION
*
connection
)
{
int
result
;
if
(
!
NETCON_connected
(
connection
))
return
FALSE
;
if
(
!
connection
->
useSSL
)
{
int
result
;
result
=
closesocket
(
connection
->
socketFD
);
connection
->
socketFD
=
-
1
;
if
(
result
==
-
1
)
return
FALSE
;
return
TRUE
;
}
else
{
result
=
closesocket
(
connection
->
socketFD
);
connection
->
socketFD
=
-
1
;
#ifdef HAVE_OPENSSL_SSL_H
closesocket
(
connection
->
ssl_sock
);
connection
->
ssl_sock
=
-
1
;
if
(
connection
->
useSSL
)
{
HeapFree
(
GetProcessHeap
(),
0
,
connection
->
peek_msg_mem
);
connection
->
peek_msg
=
NULL
;
connection
->
peek_msg_mem
=
NULL
;
/* FIXME should we call SSL_shutdown here?? Probably on whatever is the
* opposite of NETCON_init.... */
return
TRUE
;
#else
return
FALSE
;
#endif
/* FIXME should we call SSL_shutdown here?? Probably on whatever is the
* opposite of NETCON_init.... */
}
#endif
if
(
result
==
-
1
)
return
FALSE
;
return
TRUE
;
}
/******************************************************************************
...
...
@@ -258,42 +234,37 @@ BOOL NETCON_close(WININET_NETCONNECTION *connection)
BOOL
NETCON_connect
(
WININET_NETCONNECTION
*
connection
,
const
struct
sockaddr
*
serv_addr
,
unsigned
int
addrlen
)
{
int
result
;
if
(
!
NETCON_connected
(
connection
))
return
FALSE
;
if
(
!
connection
->
useSSL
)
result
=
connect
(
connection
->
socketFD
,
serv_addr
,
addrlen
);
if
(
result
==
-
1
)
{
int
result
;
result
=
connect
(
connection
->
socketFD
,
serv_addr
,
addrlen
);
if
(
result
==
-
1
)
{
closesocket
(
connection
->
socketFD
);
connection
->
socketFD
=
-
1
;
return
FALSE
;
}
return
TRUE
;
closesocket
(
connection
->
socketFD
);
connection
->
socketFD
=
-
1
;
return
FALSE
;
}
else
{
#ifdef HAVE_OPENSSL_SSL_H
if
(
connection
->
useSSL
)
{
BIO
*
sbio
;
ctx
=
pSSL_CTX_new
(
meth
);
connection
->
ssl_s
=
pSSL_new
(
ctx
);
if
(
connect
(
connection
->
ssl_sock
,
serv_addr
,
addrlen
)
==
-
1
)
return
FALSE
;
sbio
=
pBIO_new_socket
(
connection
->
ssl_sock
,
BIO_NOCLOSE
);
sbio
=
pBIO_new_socket
(
connection
->
socketFD
,
BIO_NOCLOSE
);
pSSL_set_bio
(
connection
->
ssl_s
,
sbio
,
sbio
);
if
(
pSSL_connect
(
connection
->
ssl_s
)
<=
0
)
{
ERR
(
"ssl couldn't connect
\n
"
);
return
FALSE
;
}
return
TRUE
;
#else
return
FALSE
;
#endif
}
#endif
return
TRUE
;
}
/******************************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment