1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-01 22:51:45 +02:00

Handle cookie signing errors

This commit is contained in:
Nick Meves
2020-07-20 18:18:17 -07:00
parent 65c228394f
commit 1c8c5b08d7
6 changed files with 64 additions and 39 deletions

View File

@@ -88,8 +88,10 @@ func TestSignAndValidate(t *testing.T) {
value := base64.URLEncoding.EncodeToString([]byte("I am soooo encoded"))
epoch := "123456789"
sha256sig := cookieSignature(sha256.New, seed, key, value, epoch)
sha1sig := cookieSignature(sha1.New, seed, key, value, epoch)
sha256sig, err := cookieSignature(sha256.New, seed, key, value, epoch)
assert.NoError(t, err)
sha1sig, err := cookieSignature(sha1.New, seed, key, value, epoch)
assert.NoError(t, err)
assert.True(t, checkSignature(sha256sig, seed, key, value, epoch))
// This should be switched to False after fully deprecating SHA1