mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
httpd: always use an opaque signing key
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1309,11 +1309,14 @@ func stopCleanupTicker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getSigningKey(signingPassphrase string) []byte {
|
func getSigningKey(signingPassphrase string) []byte {
|
||||||
|
var key []byte
|
||||||
if signingPassphrase != "" {
|
if signingPassphrase != "" {
|
||||||
sk := sha256.Sum256([]byte(signingPassphrase))
|
key = []byte(signingPassphrase)
|
||||||
return sk[:]
|
} else {
|
||||||
|
key = util.GenerateRandomBytes(32)
|
||||||
}
|
}
|
||||||
return util.GenerateRandomBytes(32)
|
sk := sha256.Sum256(key)
|
||||||
|
return sk[:]
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetInstallationCodeResolver sets a function to call to resolve the installation code
|
// SetInstallationCodeResolver sets a function to call to resolve the installation code
|
||||||
|
|||||||
Reference in New Issue
Block a user