uapi: allow unsetting device private key with /dev/null

This commit is contained in:
Jason A. Donenfeld
2020-02-04 18:03:31 +01:00
parent 05b03c6750
commit cb4bb63030
2 changed files with 10 additions and 1 deletions

View File

@@ -138,7 +138,7 @@ func (device *Device) IpcSetOperation(socket *bufio.Reader) *IPCError {
switch key {
case "private_key":
var sk NoisePrivateKey
err := sk.FromHex(value)
err := sk.FromMaybeZeroHex(value)
if err != nil {
logError.Println("Failed to set private_key:", err)
return &IPCError{ipc.IpcErrorInvalid}