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:

committed by
Jeffrey Altman

parent
20f038f4f0
commit
b19633f9b9
@@ -588,7 +588,7 @@ _netlogon_unwrap_iov(OM_uint32 *minor_status,
|
||||
|
||||
/* [MS-NRPC] 3.3.4.2.2.10: verify signature */
|
||||
_netlogon_digest(ctx, sig, iov, iov_count, checksum);
|
||||
if (memcmp(sig->Checksum, checksum, _netlogon_checksum_length(sig)) != 0)
|
||||
if (ct_memcmp(sig->Checksum, checksum, _netlogon_checksum_length(sig)) != 0)
|
||||
return GSS_S_BAD_SIG;
|
||||
|
||||
HEIMDAL_MUTEX_lock(&ctx->Mutex);
|
||||
|
Reference in New Issue
Block a user