diff options
author | Luke Leighton <lkcl@samba.org> | 1999-06-29 19:39:23 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-06-29 19:39:23 +0000 |
commit | 8e145947988d4ac8d025dcd876fae14c75db9527 (patch) | |
tree | 69923251d04b51832cbdac6bbd7469b8fef69cb4 /source3/libsmb | |
parent | 73891ca8e4f6cca6aa8bb0ae043f660a64baa056 (diff) | |
download | samba-8e145947988d4ac8d025dcd876fae14c75db9527.tar.gz samba-8e145947988d4ac8d025dcd876fae14c75db9527.tar.bz2 samba-8e145947988d4ac8d025dcd876fae14c75db9527.zip |
smbclient modified to use cli_establish_connection(). smbclient therefore
now uses improved authentication. smbclient now "broken" for "scripts"
based on DEBUG() output. cli_establish_connection() requires modification
to support old scripts.
(This used to be commit b0539d43407cb2b0bab7977908de09b21b145218)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 11 | ||||
-rw-r--r-- | source3/libsmb/smbencrypt.c | 16 |
2 files changed, 22 insertions, 5 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 8d3508d98f..cc51ab0c4b 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -754,6 +754,7 @@ BOOL cli_session_setup_x(struct cli_state *cli, strupper(p); p = skip_string(p,1); pstrcpy(p,user_domain); + strupper(p); p = skip_string(p,1); pstrcpy(p,"Unix");p = skip_string(p,1); CVAL(p, 0) = 0; p++; @@ -2851,6 +2852,16 @@ BOOL cli_establish_connection(struct cli_state *cli, return False; } + DEBUG(1,("session setup ok\n")); + + if (*cli->server_domain || *cli->server_os || *cli->server_type) + { + DEBUG(1,("Domain=[%s] OS=[%s] Server=[%s]\n", + cli->server_domain, + cli->server_os, + cli->server_type)); + } + if (do_tcon) { if (!cli_send_tconX(cli, service, service_type, diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c index 852e5327cf..abee4f3f19 100644 --- a/source3/libsmb/smbencrypt.c +++ b/source3/libsmb/smbencrypt.c @@ -239,11 +239,17 @@ static char np_cli_chal[58] = void SMBgenclientchals(char *lm_cli_chal, char *nt_cli_chal, int *nt_cli_chal_len, - const char *srv, const char *domain) + const char *srv, const char *dom) { NTTIME nt_time; int srv_len = strlen(srv); - int dom_len = strlen(domain); + int dom_len = strlen(dom); + fstring server; + fstring domain; + fstrcpy(server, srv); + fstrcpy(domain, dom); + strupper(server); + strupper(domain); generate_random_buffer(lm_cli_chal, 8, False); unix_to_nt_time(&nt_time, time(NULL)); @@ -271,13 +277,13 @@ void SMBgenclientchals(char *lm_cli_chal, *nt_cli_chal_len += 2; SSVAL(nt_cli_chal, 30, srv_len*2); *nt_cli_chal_len += 2; - ascii_to_unibuf(nt_cli_chal+(*nt_cli_chal_len), srv, srv_len*2); + ascii_to_unibuf(nt_cli_chal+(*nt_cli_chal_len), server, srv_len*2); *nt_cli_chal_len += srv_len*2; SSVAL(nt_cli_chal, 24, (*nt_cli_chal_len)+16); SSVAL(nt_cli_chal, 26, (*nt_cli_chal_len)+15); - DEBUG(100,("SMBgenclientchals: srv %s, dom %s\n", srv, domain)); + DEBUG(100,("SMBgenclientchals: srv %s, dom %s\n", server, domain)); dump_data(100, nt_cli_chal, *nt_cli_chal_len); } @@ -294,7 +300,7 @@ void ntv2_owf_gen(const uchar owf[16], int domain_l = strlen(domain_n); _my_mbstowcsupper((int16*)user_u, user_n , user_l*2 ); - _my_mbstowcs((int16*)dom_u , domain_n, domain_l*2); + _my_mbstowcsupper((int16*)dom_u , domain_n, domain_l*2); hmac_md5_init_limK_to_64(owf, 16, &ctx); hmac_md5_update(user_u, user_l*2, &ctx); |