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
@@ -426,7 +426,7 @@ RSA_verify(int type, const unsigned char *from, unsigned int flen,
|
||||
return -4;
|
||||
}
|
||||
|
||||
if (flen != di.digest.length || memcmp(di.digest.data, from, flen) != 0) {
|
||||
if (flen != di.digest.length || ct_memcmp(di.digest.data, from, flen) != 0) {
|
||||
free_DigestInfo(&di);
|
||||
return -5;
|
||||
}
|
||||
|
Reference in New Issue
Block a user