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
@@ -259,7 +259,7 @@ _gsskrb5_verify_8003_checksum(
|
||||
}
|
||||
|
||||
if (input_chan_bindings != GSS_C_NO_CHANNEL_BINDINGS
|
||||
&& (memcmp(p, zeros, sizeof(zeros)) != 0 || client_asserted_cb)) {
|
||||
&& (ct_memcmp(p, zeros, sizeof(zeros)) != 0 || client_asserted_cb)) {
|
||||
if(hash_input_chan_bindings(input_chan_bindings, hash) != 0) {
|
||||
*minor_status = 0;
|
||||
return GSS_S_BAD_BINDINGS;
|
||||
|
Reference in New Issue
Block a user