proxy: update vendor
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
7574b334cc
commit
15619b08f8
592 changed files with 148411 additions and 20678 deletions
18
vendor/github.com/jimstudt/http-authentication/basic/util.go
generated
vendored
Normal file
18
vendor/github.com/jimstudt/http-authentication/basic/util.go
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package basic
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"crypto/subtle"
|
||||
)
|
||||
|
||||
func constantTimeEquals(a string, b string) bool {
|
||||
// compare SHA-1 as a gatekeeper in constant time
|
||||
// then check that we didn't get by because of a collision
|
||||
aSha := sha1.Sum([]byte(a))
|
||||
bSha := sha1.Sum([]byte(b))
|
||||
if subtle.ConstantTimeCompare(aSha[:], bSha[:]) == 1 {
|
||||
// yes, this bit isn't constant, but you had to make a Sha1 collision to get here
|
||||
return a == b
|
||||
}
|
||||
return false
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue