Compare commits

...

1 Commits

Author SHA1 Message Date
Soatok Dreamseeker f24b8a3d2b Use a constant-time compare 3 months ago
  1. 7
      model/message.go

7
model/message.go

@ -37,12 +37,11 @@ func compareSignatures(a []byte, b []byte) bool {
if len(a) != len(b) {
return false
}
int d = 0
for i := range a {
if a[i] != b[i] {
return false
}
d := d | (a[i] ^ b[i])
}
return true
return d == 0
}
// GetMessages returns a copy of the entire timeline

Loading…
Cancel
Save