mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-24 08:30:27 +00:00
node: use a plain string as key
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
97bb004c12
commit
21bd8c5660
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