mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-09 23:27:43 +02:00
internal/cryputil: combines aead and cryptutil packages.
- Refactored encrypt / decrypt methods to use aead's NonceSize() interface method. - Add explicit GenerateKey function. - Remove mutex on XChaCha20.
This commit is contained in:
parent
131810ccfe
commit
24b11b0428
11 changed files with 44 additions and 89 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
"github.com/pomerium/envconfig"
|
||||
|
||||
"github.com/pomerium/pomerium/authenticate/providers"
|
||||
"github.com/pomerium/pomerium/internal/aead"
|
||||
"github.com/pomerium/pomerium/internal/cryptutil"
|
||||
"github.com/pomerium/pomerium/internal/sessions"
|
||||
"github.com/pomerium/pomerium/internal/templates"
|
||||
)
|
||||
|
@ -132,7 +132,7 @@ type Authenticator struct {
|
|||
// sesion related
|
||||
csrfStore sessions.CSRFStore
|
||||
sessionStore sessions.SessionStore
|
||||
cipher aead.Cipher
|
||||
cipher cryptutil.Cipher
|
||||
|
||||
provider providers.Provider
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ func NewAuthenticator(opts *Options, optionFuncs ...func(*Authenticator) error)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cipher, err := aead.New([]byte(decodedAuthCodeSecret))
|
||||
cipher, err := cryptutil.NewCipher([]byte(decodedAuthCodeSecret))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue