summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-06-16 01:35:52 +0000
committerJeremy Allison <jra@samba.org>1998-06-16 01:35:52 +0000
commitcb757820f5452d192ce3b1eeb4f19a17ee93c3fe (patch)
treeb40303dac4805a9ffb4a32e0f24d90648ed7a1e7 /source3/libsmb
parente31b4f29f6b6b7f74a066e1219d85d1eb425eebb (diff)
downloadsamba-cb757820f5452d192ce3b1eeb4f19a17ee93c3fe.tar.gz
samba-cb757820f5452d192ce3b1eeb4f19a17ee93c3fe.tar.bz2
samba-cb757820f5452d192ce3b1eeb4f19a17ee93c3fe.zip
Added SSL support from Christian Starkjohann <cs@obdev.at>
This patch may not yet compile with -DUSE_SSL enabled, further Makefile changes may be needed. But it was important to get this code in place before I go off to USENIX. Jeremy. (This used to be commit 31e768369fdc61e07c59630c86c62239f3d3f3f7)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clientgen.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 9dfd482da3..68bd369606 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -1633,12 +1633,25 @@ BOOL cli_session_request(struct cli_state *cli, char *host, int name_type,
_smb_setlen(cli->outbuf,len);
CVAL(cli->outbuf,0) = 0x81;
+#ifdef USE_SSL
+retry:
+#endif /* USE_SSL */
+
send_smb(cli->fd,cli->outbuf);
DEBUG(5,("Sent session request\n"));
if (!client_receive_smb(cli->fd,cli->inbuf,cli->timeout))
return False;
+#ifdef USE_SSL
+ if(CVAL(cli->inbuf,0) == 0x83 && CVAL(cli->inbuf,4) == 0x8e){ /* use ssl */
+ if(!sslutil_fd_is_ssl(cli->fd)){
+ if(sslutil_connect(cli->fd) == 0)
+ goto retry;
+ }
+ }
+#endif /* USE_SSL */
+
if (CVAL(cli->inbuf,0) != 0x82) {
/* This is the wrong place to put the error... JRA. */
cli->rap_error = CVAL(cli->inbuf,0);