r3959: fix compiler warnings
authorStefan Metzmacher <metze@samba.org>
Thu, 25 Nov 2004 18:01:40 +0000 (18:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:06:08 +0000 (13:06 -0500)
metze

source/client/clitar.c
source/libcli/auth/gensec_ntlmssp.c
source/libcli/auth/ntlmssp.c
source/torture/rpc/echo.c
source/torture/rpc/samlogon.c

index 40ff5a79ab554b8e2c70fb0a8a9fb7e70927f399..476e29d4ba693574febfb7f2f584eb07c03c1ad9 100644 (file)
@@ -300,7 +300,7 @@ static long readtarheader(union hblock *hb, file_info2 *finfo, char *prefix)
   if (fchk != chk)
     {
       DEBUG(0, ("checksums don't match %ld %ld\n", fchk, chk));
-      dump_data(5, (char *)hb - TBLOCK, TBLOCK *3);
+      dump_data(5, (uint8_t *)hb - TBLOCK, TBLOCK *3);
       return -1;
     }
 
index ee8d1aa79c21188284954452f8aea864b6e26dff..5e55082c6f6cb9e7342e43eff1d2a76fc0670f6b 100644 (file)
@@ -74,7 +74,7 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state,
 
        DEBUG(5, ("auth_context challenge set by %s\n", auth_context->challenge_set_by));
        DEBUG(5, ("challenge is: \n"));
-       dump_data(5, (const char *)auth_context->challenge.data, auth_context->challenge.length);
+       dump_data(5, auth_context->challenge.data, auth_context->challenge.length);
        return NT_STATUS_OK;
 }
 
index f0003279e55bcfc9180ca68a462f5f3205771720..5d61361d69f57e7c0c9f0b558a89087a29da71f3 100644 (file)
@@ -264,7 +264,7 @@ NTSTATUS ntlmssp_update(struct ntlmssp_state *ntlmssp_state,
                                 "NTLMSSP",
                                 &ntlmssp_command)) {
                        DEBUG(1, ("Failed to parse NTLMSSP packet, could not extract NTLMSSP command\n"));
-                       dump_data(2, (const char *)input.data, input.length);
+                       dump_data(2, input.data, input.length);
                        return NT_STATUS_INVALID_PARAMETER;
                }
        }
@@ -472,7 +472,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
                                 &cliname,
                                 &domname)) {
                        DEBUG(1, ("ntlmssp_server_negotiate: failed to parse NTLMSSP:\n"));
-                       dump_data(2, (const char *)in.data, in.length);
+                       dump_data(2, in.data, in.length);
                        return NT_STATUS_INVALID_PARAMETER;
                }
                
@@ -611,7 +611,7 @@ static NTSTATUS ntlmssp_server_preauth(struct ntlmssp_state *ntlmssp_state,
                         &ntlmssp_state->encrypted_session_key,
                         &auth_flags)) {
                DEBUG(10, ("ntlmssp_server_auth: failed to parse NTLMSSP (nonfatal):\n"));
-               dump_data(10, (const char *)request.data, request.length);
+               dump_data(10, request.data, request.length);
 
                /* zero this out */
                data_blob_free(&ntlmssp_state->encrypted_session_key);
@@ -635,7 +635,7 @@ static NTSTATUS ntlmssp_server_preauth(struct ntlmssp_state *ntlmssp_state,
                                 &user, 
                                 &workstation)) {
                        DEBUG(1, ("ntlmssp_server_auth: failed to parse NTLMSSP:\n"));
-                       dump_data(2, (const char *)request.data, request.length);
+                       dump_data(2, request.data, request.length);
 
                        return NT_STATUS_INVALID_PARAMETER;
                }
@@ -1027,7 +1027,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
                         &server_domain_blob,
                         &chal_flags)) {
                DEBUG(1, ("Failed to parse the NTLMSSP Challenge: (#1)\n"));
-               dump_data(2, (const char *)in.data, in.length);
+               dump_data(2, in.data, in.length);
 
                return NT_STATUS_INVALID_PARAMETER;
        }
@@ -1069,7 +1069,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
                         &unkn1, &unkn2,
                         &struct_blob)) {
                DEBUG(1, ("Failed to parse the NTLMSSP Challenge: (#2)\n"));
-               dump_data(2, (const char *)in.data, in.length);
+               dump_data(2, in.data, in.length);
                return NT_STATUS_INVALID_PARAMETER;
        }
 
@@ -1136,7 +1136,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
 
                DEBUG(5, ("NTLMSSP challenge set by NTLM2\n"));
                DEBUG(5, ("challenge is: \n"));
-               dump_data(5, (const char *)session_nonce_hash, 8);
+               dump_data(5, session_nonce_hash, 8);
                
                nt_response = data_blob_talloc(ntlmssp_state, NULL, 24);
                SMBNTencrypt(ntlmssp_state->password,
index 441a4835f2bf41e31f0c99b24d42f4b335460c23..c141d4be9c0c9a962c3068330c9a382ecdac2ea6 100644 (file)
@@ -56,7 +56,7 @@ static BOOL test_echodata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 {
        int i;
        NTSTATUS status;
-       char *data_in, *data_out;
+       uint8_t *data_in, *data_out;
        int len = 1 + (random() % 5000);
        struct echo_EchoData r;
 
@@ -104,7 +104,7 @@ static BOOL test_sourcedata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
        int i;
        NTSTATUS status;
        int len = 200000 + (random() % 5000);
-       char *data_out;
+       uint8_t *data_out;
        struct echo_SourceData r;
 
        printf("\nTesting SourceData\n");
@@ -138,7 +138,7 @@ static BOOL test_sinkdata(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 {
        int i;
        NTSTATUS status;
-       char *data_in;
+       uint8_t *data_in;
        int len = 200000 + (random() % 5000);
        struct echo_SinkData r;
 
index c193ba5557384f306245bed511dfdb90909bcb14..e7c04b6ad13e778df01c36a6f564e32165d1f72b 100644 (file)
@@ -344,25 +344,25 @@ static BOOL test_lm_ntlm_broken(struct samlogon_state *samlogon_state, enum ntlm
                   sizeof(lm_key)) != 0) {
                printf("LM Key does not match expectations!\n");
                printf("lm_key:\n");
-               dump_data(1, (const char *)lm_key, 8);
+               dump_data(1, lm_key, 8);
                printf("expected:\n");
-               dump_data(1, (const char *)lm_hash, 8);
+               dump_data(1, lm_hash, 8);
                pass = False;
        }
 
        switch (break_which) {
        case NO_NT:
        {
-               char lm_key_expected[16];
+               uint8_t lm_key_expected[16];
                memcpy(lm_key_expected, lm_hash, 8);
                memset(lm_key_expected+8, '\0', 8);
                if (memcmp(lm_key_expected, user_session_key, 
                           16) != 0) {
                        printf("NT Session Key does not match expectations (should be first-8 LM hash)!\n");
                        printf("user_session_key:\n");
-                       dump_data(1, (const char *)user_session_key, sizeof(user_session_key));
+                       dump_data(1, user_session_key, sizeof(user_session_key));
                        printf("expected:\n");
-                       dump_data(1, (const char *)lm_key_expected, sizeof(lm_key_expected));
+                       dump_data(1, lm_key_expected, sizeof(lm_key_expected));
                        pass = False;
                }
                break;
@@ -372,9 +372,9 @@ static BOOL test_lm_ntlm_broken(struct samlogon_state *samlogon_state, enum ntlm
                           sizeof(user_session_key)) != 0) {
                        printf("NT Session Key does not match expectations!\n");
                        printf("user_session_key:\n");
-                       dump_data(1, (const char *)user_session_key, 16);
+                       dump_data(1, user_session_key, 16);
                        printf("expected:\n");
-                       dump_data(1, (const char *)session_key.data, session_key.length);
+                       dump_data(1, session_key.data, session_key.length);
                        pass = False;
                }
        }
@@ -437,22 +437,22 @@ static BOOL test_ntlm_in_lm(struct samlogon_state *samlogon_state, char **error_
                   sizeof(lm_key)) != 0) {
                printf("LM Key does not match expectations!\n");
                printf("lm_key:\n");
-               dump_data(1, (const char *)lm_key, 8);
+               dump_data(1, lm_key, 8);
                printf("expected:\n");
-               dump_data(1, (const char *)lm_hash, 8);
+               dump_data(1, lm_hash, 8);
                pass = False;
        }
        if (memcmp(lm_hash, user_session_key, 8) != 0) {
-               char lm_key_expected[16];
+               uint8_t lm_key_expected[16];
                memcpy(lm_key_expected, lm_hash, 8);
                memset(lm_key_expected+8, '\0', 8);
                if (memcmp(lm_key_expected, user_session_key, 
                           16) != 0) {
                        printf("NT Session Key does not match expectations (should be first-8 LM hash)!\n");
                        printf("user_session_key:\n");
-                       dump_data(1, (const char *)user_session_key, sizeof(user_session_key));
+                       dump_data(1, user_session_key, sizeof(user_session_key));
                        printf("expected:\n");
-                       dump_data(1, (const char *)lm_key_expected, sizeof(lm_key_expected));
+                       dump_data(1, lm_key_expected, sizeof(lm_key_expected));
                        pass = False;
                }
        }
@@ -471,21 +471,21 @@ static BOOL test_ntlm_in_both(struct samlogon_state *samlogon_state, char **erro
        DATA_BLOB nt_response = data_blob_talloc(samlogon_state->mem_ctx, NULL, 24);
        DATA_BLOB session_key = data_blob_talloc(samlogon_state->mem_ctx, NULL, 16);
 
-       char lm_key[8];
-       char lm_hash[16];
-       char user_session_key[16];
-       char nt_hash[16];
+       uint8_t lm_key[8];
+       uint8_t lm_hash[16];
+       uint8_t user_session_key[16];
+       uint8_t nt_hash[16];
        
        ZERO_STRUCT(lm_key);
        ZERO_STRUCT(user_session_key);
 
        SMBNTencrypt(samlogon_state->password, samlogon_state->chall.data, 
                     nt_response.data);
-       E_md4hash(samlogon_state->password, (uint8_t *)nt_hash);
-       SMBsesskeygen_ntv1((const uint8_t *)nt_hash, 
+       E_md4hash(samlogon_state->password, nt_hash);
+       SMBsesskeygen_ntv1(nt_hash, 
                           session_key.data);
 
-       lm_good = E_deshash(samlogon_state->password, (uint8_t *)lm_hash); 
+       lm_good = E_deshash(samlogon_state->password, lm_hash); 
        if (!lm_good) {
                ZERO_STRUCT(lm_hash);
        }
@@ -518,7 +518,7 @@ static BOOL test_ntlm_in_both(struct samlogon_state *samlogon_state, char **erro
                printf("user_session_key:\n");
                dump_data(1, user_session_key, 16);
                printf("expected:\n");
-               dump_data(1, (const char *)session_key.data, session_key.length);
+               dump_data(1, session_key.data, session_key.length);
                pass = False;
        }
 
@@ -584,18 +584,18 @@ static BOOL test_lmv2_ntlmv2_broken(struct samlogon_state *samlogon_state, enum
                           sizeof(user_session_key)) != 0) {
                        printf("USER (LMv2) Session Key does not match expectations!\n");
                        printf("user_session_key:\n");
-                       dump_data(1, (const char *)user_session_key, 16);
+                       dump_data(1, user_session_key, 16);
                        printf("expected:\n");
-                       dump_data(1, (const char *)lmv2_session_key.data, ntlmv2_session_key.length);
+                       dump_data(1, lmv2_session_key.data, ntlmv2_session_key.length);
                        pass = False;
                }
                if (memcmp(lmv2_session_key.data, lm_session_key, 
                           sizeof(lm_session_key)) != 0) {
                        printf("LM (LMv2) Session Key does not match expectations!\n");
                        printf("lm_session_key:\n");
-                       dump_data(1, (const char *)lm_session_key, 8);
+                       dump_data(1, lm_session_key, 8);
                        printf("expected:\n");
-                       dump_data(1, (const char *)lmv2_session_key.data, 8);
+                       dump_data(1, lmv2_session_key.data, 8);
                        pass = False;
                }
                break;
@@ -604,18 +604,18 @@ static BOOL test_lmv2_ntlmv2_broken(struct samlogon_state *samlogon_state, enum
                           sizeof(user_session_key)) != 0) {
                        printf("USER (NTLMv2) Session Key does not match expectations!\n");
                        printf("user_session_key:\n");
-                       dump_data(1, (const char *)user_session_key, 16);
+                       dump_data(1, user_session_key, 16);
                        printf("expected:\n");
-                       dump_data(1, (const char *)ntlmv2_session_key.data, ntlmv2_session_key.length);
+                       dump_data(1, ntlmv2_session_key.data, ntlmv2_session_key.length);
                        pass = False;
                }
                if (memcmp(ntlmv2_session_key.data, lm_session_key, 
                           sizeof(lm_session_key)) != 0) {
                        printf("LM (NTLMv2) Session Key does not match expectations!\n");
                        printf("lm_session_key:\n");
-                       dump_data(1, (const char *)lm_session_key, 8);
+                       dump_data(1, lm_session_key, 8);
                        printf("expected:\n");
-                       dump_data(1, (const char *)ntlmv2_session_key.data, 8);
+                       dump_data(1, ntlmv2_session_key.data, 8);
                        pass = False;
                }
        }
@@ -752,17 +752,17 @@ static BOOL test_ntlm2(struct samlogon_state *samlogon_state, char **error_strin
                   sizeof(lm_key)) != 0) {
                printf("LM Key does not match expectations!\n");
                printf("lm_key:\n");
-               dump_data(1, (const char *)lm_key, 8);
+               dump_data(1, lm_key, 8);
                printf("expected:\n");
-               dump_data(1, (const char *)lm_hash, 8);
+               dump_data(1, lm_hash, 8);
                pass = False;
        }
        if (memcmp(nt_key, user_session_key, 16) != 0) {
                printf("NT Session Key does not match expectations (should be first-8 LM hash)!\n");
                printf("user_session_key:\n");
-               dump_data(1, (const char *)user_session_key, sizeof(user_session_key));
+               dump_data(1, user_session_key, sizeof(user_session_key));
                printf("expected:\n");
-               dump_data(1, (const char *)nt_key, sizeof(nt_key));
+               dump_data(1, nt_key, sizeof(nt_key));
                pass = False;
        }
         return pass;