update comment method (#977)

This commit is contained in:
田欧 2017-07-05 17:37:24 +08:00 committed by Bo-Yi Wu
parent d535fcd598
commit 31ac11a298
1 changed files with 1 additions and 1 deletions

View File

@ -89,6 +89,6 @@ func secureCompare(given, actual string) bool {
if subtle.ConstantTimeEq(int32(len(given)), int32(len(actual))) == 1 { if subtle.ConstantTimeEq(int32(len(given)), int32(len(actual))) == 1 {
return subtle.ConstantTimeCompare([]byte(given), []byte(actual)) == 1 return subtle.ConstantTimeCompare([]byte(given), []byte(actual)) == 1
} }
/* Securely compare actual to itself to keep constant time, but always return false */ // Securely compare actual to itself to keep constant time, but always return false
return subtle.ConstantTimeCompare([]byte(actual), []byte(actual)) == 1 && false return subtle.ConstantTimeCompare([]byte(actual), []byte(actual)) == 1 && false
} }