Ensure we always have the key prefix when needed

This commit is contained in:
Kristoffer Dalby 2021-11-27 20:25:12 +00:00
parent c38f00fab8
commit 59aeaa8476
6 changed files with 38 additions and 8 deletions

View file

@ -192,7 +192,7 @@ func (h *Headscale) OIDCCallback(ctx *gin.Context) {
machineKeyStr, machineKeyOK := machineKeyIf.(string)
var machineKey key.MachinePublic
err = machineKey.UnmarshalText([]byte(machineKeyStr))
err = machineKey.UnmarshalText([]byte(MachinePublicKeyEnsurePrefix(machineKeyStr)))
if err != nil {
log.Error().
Msg("could not parse machine public key")