remove the use key stripping and store the proper keys (#1603)

This commit is contained in:
Kristoffer Dalby
2023-11-16 17:55:29 +01:00
committed by GitHub
parent 2af71c9e31
commit c0fd06e3f5
21 changed files with 99 additions and 198 deletions

View File

@@ -911,10 +911,9 @@ func readOrCreatePrivateKey(path string) (*key.MachinePrivate, error) {
}
trimmedPrivateKey := strings.TrimSpace(string(privateKey))
privateKeyEnsurePrefix := util.PrivateKeyEnsurePrefix(trimmedPrivateKey)
var machineKey key.MachinePrivate
if err = machineKey.UnmarshalText([]byte(privateKeyEnsurePrefix)); err != nil {
if err = machineKey.UnmarshalText([]byte(trimmedPrivateKey)); err != nil {
log.Info().
Str("path", path).
Msg("This might be due to a legacy (headscale pre-0.12) private key. " +