From 3207c7f9655c236278d96a0837354d1e58993974 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 17 Apr 2012 13:36:42 +0200 Subject: s3:libsmb/ntlmssp: improve anonymous logins smbtorture3 (and maybe others) use fstrings for 'user' and 'password', so we need to check for empty strings. metze --- source3/libsmb/ntlmssp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index 79c45f697b..66e7102aef 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -349,8 +349,9 @@ static NTSTATUS ntlmssp3_client_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB session_key = data_blob_null; DATA_BLOB encrypted_session_key = data_blob_null; NTSTATUS nt_status = NT_STATUS_OK; + bool anon = ntlmssp_is_anonymous(ntlmssp_state); - if (ntlmssp_state->use_ccache) { + if (!anon && ntlmssp_state->use_ccache) { struct wbcCredentialCacheParams params; struct wbcCredentialCacheInfo *info = NULL; struct wbcAuthErrorInfo *error = NULL; @@ -483,7 +484,7 @@ noccache: return NT_STATUS_INVALID_PARAMETER; } - if (!ntlmssp_state->nt_hash) { + if (anon || !ntlmssp_state->nt_hash) { static const uint8_t zeros[16] = {0, }; /* do nothing - blobs are zero length */ -- cgit