s3:libsmb/ntlmssp: improve anonymous logins
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Apr 2012 11:36:42 +0000 (13:36 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 17 Apr 2012 12:42:32 +0000 (14:42 +0200)
smbtorture3 (and maybe others) use fstrings for 'user' and 'password',
so we need to check for empty strings.

metze

source3/libsmb/ntlmssp.c

index 79c45f697b5ce35aac69fa8a66892e138273ed20..66e7102aefd9d9b2f7d1ae968dffdeccee7e8f70 100644 (file)
@@ -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 */