Don't retain references to passed byte slices (#40)

This commit is contained in:
Daniel Huigens 2020-04-08 11:11:16 +02:00 committed by GitHub
parent 9caf737bc7
commit 10a9a0f557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 9 deletions

View file

@ -80,7 +80,7 @@ func GenerateSessionKey() (*SessionKey, error) {
func NewSessionKeyFromToken(token []byte, algo string) *SessionKey {
return &SessionKey{
Key: token,
Key: clone(token),
Algo: algo,
}
}