Fix logic error in reworked MD5 call for establishing keys, and fix some minor whitespace issues.
This commit is contained in:
parent
7aa9e7a97f
commit
68ab485e63
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user