mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
node: use a plain string as key
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Test and deploy (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (push) Waiting to run
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
CI / Test and deploy (push) Waiting to run
CI / Test build flags (push) Waiting to run
CI / Test with PgSQL/MySQL/Cockroach (push) Waiting to run
CI / Build Linux packages (push) Waiting to run
CI / golangci-lint (push) Waiting to run
Docker / Build (push) Waiting to run
Some KMS providers only allow UTF-8 characters Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
b4eabda7ad
commit
256e3c1e3e
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ func (n *NodeData) validate() error {
|
||||||
if n.Proto != NodeProtoHTTP && n.Proto != NodeProtoHTTPS {
|
if n.Proto != NodeProtoHTTP && n.Proto != NodeProtoHTTPS {
|
||||||
return util.NewValidationError(fmt.Sprintf("invalid node proto: %s", n.Proto))
|
return util.NewValidationError(fmt.Sprintf("invalid node proto: %s", n.Proto))
|
||||||
}
|
}
|
||||||
n.Key = kms.NewPlainSecret(util.BytesToString(util.GenerateRandomBytes(32)))
|
n.Key = kms.NewPlainSecret(util.GenerateUniqueID())
|
||||||
n.Key.SetAdditionalData(n.Host)
|
n.Key.SetAdditionalData(n.Host)
|
||||||
if err := n.Key.Encrypt(); err != nil {
|
if err := n.Key.Encrypt(); err != nil {
|
||||||
return fmt.Errorf("unable to encrypt node key: %w", err)
|
return fmt.Errorf("unable to encrypt node key: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue