diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c index ebe066c7b..8b66b8c45 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_compute.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm_compute.c @@ -449,9 +449,10 @@ static BOOL ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) return FALSE; else if (memcmp(context->NtlmHash, NTLM_NULL_BUFFER, 16) != 0) { - NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User, - credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain, - credentials->identity.DomainLength * 2, hash); + return NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User, + credentials->identity.UserLength * 2, + (LPWSTR)credentials->identity.Domain, + credentials->identity.DomainLength * 2, hash); } else if (credentials->identity.PasswordLength > SSPI_CREDENTIALS_HASH_LENGTH_OFFSET) { @@ -459,16 +460,17 @@ static BOOL ntlm_compute_ntlm_v2_hash(NTLM_CONTEXT* context, BYTE* hash) if (ntlm_convert_password_hash(context, context->NtlmHash, sizeof(context->NtlmHash)) < 0) return FALSE; - NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User, - credentials->identity.UserLength * 2, (LPWSTR)credentials->identity.Domain, - credentials->identity.DomainLength * 2, hash); + return NTOWFv2FromHashW(context->NtlmHash, (LPWSTR)credentials->identity.User, + credentials->identity.UserLength * 2, + (LPWSTR)credentials->identity.Domain, + credentials->identity.DomainLength * 2, hash); } else if (credentials->identity.Password) { - NTOWFv2W((LPWSTR)credentials->identity.Password, credentials->identity.PasswordLength * 2, - (LPWSTR)credentials->identity.User, credentials->identity.UserLength * 2, - (LPWSTR)credentials->identity.Domain, credentials->identity.DomainLength * 2, - hash); + return NTOWFv2W( + (LPWSTR)credentials->identity.Password, credentials->identity.PasswordLength * 2, + (LPWSTR)credentials->identity.User, credentials->identity.UserLength * 2, + (LPWSTR)credentials->identity.Domain, credentials->identity.DomainLength * 2, hash); } else if (context->HashCallback) { diff --git a/winpr/libwinpr/sspi/NTLM/ntlm_compute.h b/winpr/libwinpr/sspi/NTLM/ntlm_compute.h index 74448329e..0332c6ee8 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm_compute.h +++ b/winpr/libwinpr/sspi/NTLM/ntlm_compute.h @@ -38,20 +38,19 @@ BOOL ntlm_write_ntlm_v2_response(wStream* s, const NTLMv2_RESPONSE* response); void ntlm_output_target_name(NTLM_CONTEXT* context); void ntlm_output_channel_bindings(NTLM_CONTEXT* context); -void ntlm_current_time(BYTE* timestamp); void ntlm_generate_timestamp(NTLM_CONTEXT* context); SECURITY_STATUS ntlm_compute_lm_v2_response(NTLM_CONTEXT* context); SECURITY_STATUS ntlm_compute_ntlm_v2_response(NTLM_CONTEXT* context); -void ntlm_rc4k(BYTE* key, size_t length, BYTE* plaintext, BYTE* ciphertext); -void ntlm_generate_client_challenge(NTLM_CONTEXT* context); -void ntlm_generate_server_challenge(NTLM_CONTEXT* context); -void ntlm_generate_key_exchange_key(NTLM_CONTEXT* context); -void ntlm_generate_random_session_key(NTLM_CONTEXT* context); -void ntlm_generate_exported_session_key(NTLM_CONTEXT* context); -void ntlm_encrypt_random_session_key(NTLM_CONTEXT* context); -void ntlm_decrypt_random_session_key(NTLM_CONTEXT* context); +BOOL ntlm_rc4k(BYTE* key, size_t length, BYTE* plaintext, BYTE* ciphertext); +BOOL ntlm_generate_client_challenge(NTLM_CONTEXT* context); +BOOL ntlm_generate_server_challenge(NTLM_CONTEXT* context); +BOOL ntlm_generate_key_exchange_key(NTLM_CONTEXT* context); +BOOL ntlm_generate_random_session_key(NTLM_CONTEXT* context); +BOOL ntlm_generate_exported_session_key(NTLM_CONTEXT* context); +BOOL ntlm_encrypt_random_session_key(NTLM_CONTEXT* context); +BOOL ntlm_decrypt_random_session_key(NTLM_CONTEXT* context); BOOL ntlm_generate_client_signing_key(NTLM_CONTEXT* context); BOOL ntlm_generate_server_signing_key(NTLM_CONTEXT* context);