types/key: use tlpub: in error message (#13707)
Fixes tailscale/corp#19442 Signed-off-by: Erisa A <erisa@tailscale.com>
This commit is contained in:
+3
-3
@@ -131,10 +131,10 @@ func NLPublicFromEd25519Unsafe(public ed25519.PublicKey) NLPublic {
|
||||
// is able to decode both the CLI form (tlpub:<hex>) & the
|
||||
// regular form (nlpub:<hex>).
|
||||
func (k *NLPublic) UnmarshalText(b []byte) error {
|
||||
if mem.HasPrefix(mem.B(b), mem.S(nlPublicHexPrefixCLI)) {
|
||||
return parseHex(k.k[:], mem.B(b), mem.S(nlPublicHexPrefixCLI))
|
||||
if mem.HasPrefix(mem.B(b), mem.S(nlPublicHexPrefix)) {
|
||||
return parseHex(k.k[:], mem.B(b), mem.S(nlPublicHexPrefix))
|
||||
}
|
||||
return parseHex(k.k[:], mem.B(b), mem.S(nlPublicHexPrefix))
|
||||
return parseHex(k.k[:], mem.B(b), mem.S(nlPublicHexPrefixCLI))
|
||||
}
|
||||
|
||||
// AppendText implements encoding.TextAppender.
|
||||
|
||||
Reference in New Issue
Block a user