mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
use GenerateOpaqueString also for node secrets
this method will use rand.Text() with Go 1.24 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -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.GenerateUniqueID())
|
n.Key = kms.NewPlainSecret(util.GenerateOpaqueString())
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user