diff --git a/libfreerdp/core/security.c b/libfreerdp/core/security.c index 60d2ab89c..cfd3863aa 100644 --- a/libfreerdp/core/security.c +++ b/libfreerdp/core/security.c @@ -156,7 +156,7 @@ static BOOL security_salted_hash(const BYTE* salt, const BYTE* input, int length /* Allow FIPS override for use of MD5 here, this is used for creating hashes of the premaster_secret and master_secret */ /* used for RDP licensing as described in MS-RDPELE. This is for RDP licensing packets */ /* which will already be encrypted under FIPS, so the use of MD5 here is not for sensitive data protection. */ - if (!winpr_Digest_Init_MD5_Allow_FIPS(WINPR_MD_MD5)) + if (!winpr_Digest_Init_MD5_Allow_FIPS(md5)) goto out; if (!winpr_Digest_Update(md5, salt, 48)) /* Salt (48 bytes) */ goto out; diff --git a/winpr/libwinpr/crypto/hash.c b/winpr/libwinpr/crypto/hash.c index 4f9b3ae11..85def459c 100644 --- a/winpr/libwinpr/crypto/hash.c +++ b/winpr/libwinpr/crypto/hash.c @@ -452,25 +452,24 @@ void winpr_Digest_Free(WINPR_DIGEST_CTX* ctx) BOOL winpr_Digest_MD5_Allow_FIPS(const BYTE* input, size_t ilen, BYTE* output, size_t olen) { BOOL result = FALSE; - WINPR_DIGEST_CTX *ctx = winpr_Digest_New(); + WINPR_DIGEST_CTX *ctx = winpr_Digest_New(); if (!ctx) - return FALSE; + return FALSE; if (!winpr_Digest_Init_MD5_Allow_FIPS(ctx)) - goto out; - if (!winpr_Digest_Update(ctx, input, ilen)) - goto out; - if (!winpr_Digest_Final(ctx, output, olen)) - goto out; + goto out; + if (!winpr_Digest_Update(ctx, input, ilen)) + goto out; + if (!winpr_Digest_Final(ctx, output, olen)) + goto out; - result = TRUE; + result = TRUE; out: - winpr_Digest_Free(ctx); - return result; - - + winpr_Digest_Free(ctx); + return result; } + BOOL winpr_Digest(int md, const BYTE* input, size_t ilen, BYTE* output, size_t olen) { BOOL result = FALSE;