httpd: always use an opaque signing key

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-11-12 19:27:34 +01:00
parent 4cb6acefb2
commit 618723c457
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -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