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:
Bobby DeSimone 2019-01-18 11:55:04 -08:00
parent 131810ccfe
commit 24b11b0428
No known key found for this signature in database
GPG key ID: AEE4CF12FE86D07E
11 changed files with 44 additions and 89 deletions

View file

@ -8,7 +8,7 @@ import (
"net/url"
"reflect"
"github.com/pomerium/pomerium/internal/aead"
"github.com/pomerium/pomerium/internal/cryptutil"
"github.com/pomerium/pomerium/internal/httputil"
"github.com/pomerium/pomerium/internal/log"
"github.com/pomerium/pomerium/internal/middleware"
@ -167,7 +167,7 @@ func (p *Proxy) OAuthStart(rw http.ResponseWriter, req *http.Request) {
callbackURL := p.GetRedirectURL(req.Host)
// generate nonce
key := aead.GenerateKey()
key := cryptutil.GenerateKey()
// state prevents cross site forgery and maintain state across the client and server
state := &StateParameter{