|
|
@@ -12,8 +12,8 @@ import ( |
|
|
|
"git.destrealm.org/go/capstan" |
|
|
|
. "git.destrealm.org/go/capstan/errors" |
|
|
|
"git.destrealm.org/go/capstan/status" |
|
|
|
ch "git.destrealm.org/go/cryptohelper" |
|
|
|
"git.destrealm.org/go/errors" |
|
|
|
"git.destrealm.org/go/keystar/crypto" |
|
|
|
"git.destrealm.org/go/logging" |
|
|
|
) |
|
|
|
|
|
|
@@ -192,7 +192,7 @@ type CSRFOptions struct { |
|
|
|
} |
|
|
|
|
|
|
|
type CSRF struct { |
|
|
|
sealer crypto.Sealer |
|
|
|
sealer ch.Sealer |
|
|
|
methods map[string]struct{} |
|
|
|
options *CSRFOptions |
|
|
|
hostname string |
|
|
@@ -202,7 +202,7 @@ type CSRF struct { |
|
|
|
func NewCSRF(options *CSRFOptions) (*CSRF, error) { |
|
|
|
var methods map[string]struct{} |
|
|
|
|
|
|
|
sealer, err := crypto.NewSealer(&crypto.EngineConfiguration{ |
|
|
|
sealer, err := ch.NewSealer(&ch.EngineConfiguration{ |
|
|
|
CipherKey: options.Key, |
|
|
|
HMACKey: options.HMAC, |
|
|
|
}) |
|
|
@@ -406,7 +406,7 @@ func (c *CSRF) validateToken(token string) bool { |
|
|
|
if err != nil { |
|
|
|
return false |
|
|
|
} |
|
|
|
if validator, ok := c.sealer.(crypto.Signer); ok { |
|
|
|
if validator, ok := c.sealer.(ch.Signer); ok { |
|
|
|
return validator.VerifyBytes(b) |
|
|
|
} |
|
|
|
|
|
|
|