Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ca/provisioner.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ca

import (
"encoding/base64"
"encoding/json"
"net/url"
"time"
Expand Down Expand Up @@ -179,7 +180,15 @@
return tok.SignedString(p.jwk.Algorithm, p.jwk.Key)
}

func decryptProvisionerJWK(encryptedKey string, password []byte) (*jose.JSONWebKey, error) {
func decryptProvisionerJWK(encryptedKeyEnc string, password []byte) (*jose.JSONWebKey, error) {
var encryptedKey string
encryptedKey_bytes, err := base64.StdEncoding.DecodeString(encryptedKeyEnc)
if err != nil {
encryptedKey = encryptedKeyEnc

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This definition of encryptedKey is never used.
return nil, errors.Wrap(err, "Could not decode the encryted key. Passing it through directly")
} else {
encryptedKey = string(encryptedKey_bytes)
}
enc, err := jose.ParseEncrypted(encryptedKey)
if err != nil {
return nil, errors.Wrap(err, "error parsing provisioner encrypted key")
Expand Down