Fixed winpr_HexDump calls in debug mode.
This commit is contained in:
parent
26887de257
commit
6a26e33695
@ -843,9 +843,9 @@ SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULONG fQOP,
|
||||
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "Data Buffer (length = %d)", length);
|
||||
winpr_HexDump(data, length);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, data, length);
|
||||
WLog_DBG(TAG, "Encrypted Data Buffer (length = %d)", (int) data_buffer->cbBuffer);
|
||||
winpr_HexDump(data_buffer->pvBuffer, data_buffer->cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer);
|
||||
#endif
|
||||
free(data);
|
||||
/* RC4-encrypt first 8 bytes of digest */
|
||||
@ -858,7 +858,7 @@ SECURITY_STATUS SEC_ENTRY ntlm_EncryptMessage(PCtxtHandle phContext, ULONG fQOP,
|
||||
context->SendSeqNum++;
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "Signature (length = %d)", (int) signature_buffer->cbBuffer);
|
||||
winpr_HexDump(signature_buffer->pvBuffer, signature_buffer->cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, signature_buffer->pvBuffer, signature_buffer->cbBuffer);
|
||||
#endif
|
||||
return SEC_E_OK;
|
||||
}
|
||||
@ -919,9 +919,9 @@ SECURITY_STATUS SEC_ENTRY ntlm_DecryptMessage(PCtxtHandle phContext, PSecBufferD
|
||||
HMAC_CTX_cleanup(&hmac);
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "Encrypted Data Buffer (length = %d)", length);
|
||||
winpr_HexDump(data, length);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, data, length);
|
||||
WLog_DBG(TAG, "Data Buffer (length = %d)", (int) data_buffer->cbBuffer);
|
||||
winpr_HexDump(data_buffer->pvBuffer, data_buffer->cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, data_buffer->pvBuffer, data_buffer->cbBuffer);
|
||||
#endif
|
||||
free(data);
|
||||
/* RC4-encrypt first 8 bytes of digest */
|
||||
|
@ -207,7 +207,7 @@ int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash)
|
||||
{
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "NTLM Hash:");
|
||||
winpr_HexDump(entry->NtHash, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, entry->NtHash, 16);
|
||||
#endif
|
||||
NTOWFv2FromHashW(entry->NtHash,
|
||||
(LPWSTR) credentials->identity.User, credentials->identity.UserLength * 2,
|
||||
@ -225,7 +225,7 @@ int ntlm_fetch_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash)
|
||||
{
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "NTLM Hash:");
|
||||
winpr_HexDump(entry->NtHash, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, entry->NtHash, 16);
|
||||
#endif
|
||||
NTOWFv2FromHashW(entry->NtHash,
|
||||
(LPWSTR) credentials->identity.User, credentials->identity.UserLength * 2,
|
||||
@ -377,15 +377,15 @@ int ntlm_compute_ntlm_v2_response(NTLM_CONTEXT* context)
|
||||
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "Password (length = %d)", credentials->identity.PasswordLength * 2);
|
||||
winpr_HexDump((BYTE*) credentials->identity.Password, credentials->identity.PasswordLength * 2);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.Password, credentials->identity.PasswordLength * 2);
|
||||
WLog_DBG(TAG, "Username (length = %d)", credentials->identity.UserLength * 2);
|
||||
winpr_HexDump((BYTE*) credentials->identity.User, credentials->identity.UserLength * 2);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.User, credentials->identity.UserLength * 2);
|
||||
WLog_DBG(TAG, "Domain (length = %d)", credentials->identity.DomainLength * 2);
|
||||
winpr_HexDump((BYTE*) credentials->identity.Domain, credentials->identity.DomainLength * 2);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) credentials->identity.Domain, credentials->identity.DomainLength * 2);
|
||||
WLog_DBG(TAG, "Workstation (length = %d)", context->Workstation.Length);
|
||||
winpr_HexDump((BYTE*) context->Workstation.Buffer, context->Workstation.Length);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, (BYTE*) context->Workstation.Buffer, context->Workstation.Length);
|
||||
WLog_DBG(TAG, "NTOWFv2, NTLMv2 Hash");
|
||||
winpr_HexDump(context->NtlmV2Hash, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->NtlmV2Hash, 16);
|
||||
#endif
|
||||
/* Construct temp */
|
||||
blob[0] = 1; /* RespType (1 byte) */
|
||||
@ -398,7 +398,7 @@ int ntlm_compute_ntlm_v2_response(NTLM_CONTEXT* context)
|
||||
CopyMemory(&blob[28], TargetInfo->pvBuffer, TargetInfo->cbBuffer);
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "NTLMv2 Response Temp Blob");
|
||||
winpr_HexDump(ntlm_v2_temp.pvBuffer, ntlm_v2_temp.cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, ntlm_v2_temp.pvBuffer, ntlm_v2_temp.cbBuffer);
|
||||
#endif
|
||||
|
||||
/* Concatenate server challenge with temp */
|
||||
|
@ -246,7 +246,7 @@ SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buf
|
||||
context->NegotiateMessage.BufferType = buffer->BufferType;
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "NEGOTIATE_MESSAGE (length = %d)", (int) context->NegotiateMessage.cbBuffer);
|
||||
winpr_HexDump(context->NegotiateMessage.pvBuffer, context->NegotiateMessage.cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->NegotiateMessage.pvBuffer, context->NegotiateMessage.cbBuffer);
|
||||
ntlm_print_negotiate_flags(message->NegotiateFlags);
|
||||
|
||||
if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)
|
||||
@ -322,7 +322,7 @@ SECURITY_STATUS ntlm_write_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer bu
|
||||
context->NegotiateMessage.BufferType = buffer->BufferType;
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "NEGOTIATE_MESSAGE (length = %d)", length);
|
||||
winpr_HexDump(Stream_Buffer(s), length);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), length);
|
||||
|
||||
if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)
|
||||
ntlm_print_version_info(&(message->Version));
|
||||
@ -421,7 +421,7 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf
|
||||
CopyMemory(context->ChallengeMessage.pvBuffer, StartOffset, length);
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "CHALLENGE_MESSAGE (length = %d)", length);
|
||||
winpr_HexDump(context->ChallengeMessage.pvBuffer, context->ChallengeMessage.cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ChallengeMessage.pvBuffer, context->ChallengeMessage.cbBuffer);
|
||||
ntlm_print_negotiate_flags(context->NegotiateFlags);
|
||||
|
||||
if (context->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)
|
||||
@ -471,27 +471,27 @@ SECURITY_STATUS ntlm_read_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer buf
|
||||
ntlm_init_rc4_seal_states(context);
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "ClientChallenge");
|
||||
winpr_HexDump(context->ClientChallenge, 8);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ClientChallenge, 8);
|
||||
WLog_DBG(TAG, "ServerChallenge");
|
||||
winpr_HexDump(context->ServerChallenge, 8);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ServerChallenge, 8);
|
||||
WLog_DBG(TAG, "SessionBaseKey");
|
||||
winpr_HexDump(context->SessionBaseKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->SessionBaseKey, 16);
|
||||
WLog_DBG(TAG, "KeyExchangeKey");
|
||||
winpr_HexDump(context->KeyExchangeKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->KeyExchangeKey, 16);
|
||||
WLog_DBG(TAG, "ExportedSessionKey");
|
||||
winpr_HexDump(context->ExportedSessionKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ExportedSessionKey, 16);
|
||||
WLog_DBG(TAG, "RandomSessionKey");
|
||||
winpr_HexDump(context->RandomSessionKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->RandomSessionKey, 16);
|
||||
WLog_DBG(TAG, "ClientSigningKey");
|
||||
winpr_HexDump(context->ClientSigningKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ClientSigningKey, 16);
|
||||
WLog_DBG(TAG, "ClientSealingKey");
|
||||
winpr_HexDump(context->ClientSealingKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ClientSealingKey, 16);
|
||||
WLog_DBG(TAG, "ServerSigningKey");
|
||||
winpr_HexDump(context->ServerSigningKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ServerSigningKey, 16);
|
||||
WLog_DBG(TAG, "ServerSealingKey");
|
||||
winpr_HexDump(context->ServerSealingKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ServerSealingKey, 16);
|
||||
WLog_DBG(TAG, "Timestamp");
|
||||
winpr_HexDump(context->Timestamp, 8);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->Timestamp, 8);
|
||||
#endif
|
||||
context->state = NTLM_STATE_AUTHENTICATE;
|
||||
ntlm_free_message_fields_buffer(&(message->TargetName));
|
||||
@ -574,7 +574,7 @@ SECURITY_STATUS ntlm_write_ChallengeMessage(NTLM_CONTEXT* context, PSecBuffer bu
|
||||
CopyMemory(context->ChallengeMessage.pvBuffer, Stream_Buffer(s), length);
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "CHALLENGE_MESSAGE (length = %d)", length);
|
||||
winpr_HexDump(context->ChallengeMessage.pvBuffer, context->ChallengeMessage.cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ChallengeMessage.pvBuffer, context->ChallengeMessage.cbBuffer);
|
||||
ntlm_print_negotiate_flags(message->NegotiateFlags);
|
||||
|
||||
if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)
|
||||
@ -716,7 +716,7 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer
|
||||
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "AUTHENTICATE_MESSAGE (length = %d)", (int) context->AuthenticateMessage.cbBuffer);
|
||||
winpr_HexDump(context->AuthenticateMessage.pvBuffer, context->AuthenticateMessage.cbBuffer);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->AuthenticateMessage.pvBuffer, context->AuthenticateMessage.cbBuffer);
|
||||
|
||||
if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)
|
||||
ntlm_print_version_info(&(message->Version));
|
||||
@ -732,7 +732,7 @@ SECURITY_STATUS ntlm_read_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer
|
||||
if (flags & MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK)
|
||||
{
|
||||
WLog_DBG(TAG, "MessageIntegrityCheck:");
|
||||
winpr_HexDump(message->MessageIntegrityCheck, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, message->MessageIntegrityCheck, 16);
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -909,7 +909,7 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer
|
||||
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "AUTHENTICATE_MESSAGE (length = %d)", length);
|
||||
winpr_HexDump(Stream_Buffer(s), length);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, Stream_Buffer(s), length);
|
||||
ntlm_print_negotiate_flags(message->NegotiateFlags);
|
||||
|
||||
if (message->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION)
|
||||
@ -931,7 +931,7 @@ SECURITY_STATUS ntlm_write_AuthenticateMessage(NTLM_CONTEXT* context, PSecBuffer
|
||||
if (context->UseMIC)
|
||||
{
|
||||
WLog_DBG(TAG, "MessageIntegrityCheck (length = 16)");
|
||||
winpr_HexDump(context->MessageIntegrityCheck, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->MessageIntegrityCheck, 16);
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -996,27 +996,27 @@ SECURITY_STATUS ntlm_server_AuthenticateComplete(NTLM_CONTEXT* context)
|
||||
ntlm_init_rc4_seal_states(context);
|
||||
#ifdef WITH_DEBUG_NTLM
|
||||
WLog_DBG(TAG, "ClientChallenge");
|
||||
winpr_HexDump(context->ClientChallenge, 8);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ClientChallenge, 8);
|
||||
WLog_DBG(TAG, "ServerChallenge");
|
||||
winpr_HexDump(context->ServerChallenge, 8);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ServerChallenge, 8);
|
||||
WLog_DBG(TAG, "SessionBaseKey");
|
||||
winpr_HexDump(context->SessionBaseKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->SessionBaseKey, 16);
|
||||
WLog_DBG(TAG, "KeyExchangeKey");
|
||||
winpr_HexDump(context->KeyExchangeKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->KeyExchangeKey, 16);
|
||||
WLog_DBG(TAG, "ExportedSessionKey");
|
||||
winpr_HexDump(context->ExportedSessionKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ExportedSessionKey, 16);
|
||||
WLog_DBG(TAG, "RandomSessionKey");
|
||||
winpr_HexDump(context->RandomSessionKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->RandomSessionKey, 16);
|
||||
WLog_DBG(TAG, "ClientSigningKey");
|
||||
winpr_HexDump(context->ClientSigningKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ClientSigningKey, 16);
|
||||
WLog_DBG(TAG, "ClientSealingKey");
|
||||
winpr_HexDump(context->ClientSealingKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ClientSealingKey, 16);
|
||||
WLog_DBG(TAG, "ServerSigningKey");
|
||||
winpr_HexDump(context->ServerSigningKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ServerSigningKey, 16);
|
||||
WLog_DBG(TAG, "ServerSealingKey");
|
||||
winpr_HexDump(context->ServerSealingKey, 16);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->ServerSealingKey, 16);
|
||||
WLog_DBG(TAG, "Timestamp");
|
||||
winpr_HexDump(context->Timestamp, 8);
|
||||
winpr_HexDump(TAG, WLOG_DEBUG, context->Timestamp, 8);
|
||||
#endif
|
||||
context->state = NTLM_STATE_FINAL;
|
||||
ntlm_free_message_fields_buffer(&(message->DomainName));
|
||||
|
Loading…
Reference in New Issue
Block a user