Use constant-time memcmp when comparing sensitive buffers

This helps to avoid timing attacks.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
This commit is contained in:
Joseph Sutton
2022-02-17 15:35:51 +13:00
committed by Jeffrey Altman
parent 20f038f4f0
commit b19633f9b9
9 changed files with 12 additions and 12 deletions

View File

@@ -1359,7 +1359,7 @@ _gssapi_unwrap_iov_arcfour(OM_uint32 *minor_status,
return GSS_S_FAILURE;
}
cmp = (memcmp(cksum_data, p0 + 16, 8) != 0); /* SGN_CKSUM */
cmp = (ct_memcmp(cksum_data, p0 + 16, 8) != 0); /* SGN_CKSUM */
if (cmp) {
*minor_status = 0;
return GSS_S_BAD_MIC;