gift, dekey: the key-mismatch error was wrapping a nil err with %w, producing a mangled message.

This commit is contained in:
Yasuhiro Matsumoto
2026-07-15 09:41:48 +09:00
parent 3e50a8cba7
commit df2aaefb6d
2 changed files with 2 additions and 2 deletions

View File

@@ -164,7 +164,7 @@ var dekey = &cli.Command{
return fmt.Errorf("invalid main key: %w", err)
}
if eSec.Public() != ePub {
return fmt.Errorf("stored decoupled encryption key is corrupted: %w", err)
return fmt.Errorf("stored decoupled encryption key at %s doesn't match the announced key %s", eKeyPath, ePub.Hex())
}
} else {
log("- decoupled encryption key not found locally, attempting to fetch the key from other devices\n")

View File

@@ -332,7 +332,7 @@ func getDecoupledEncryptionSecretKey(ctx context.Context, configPath string, pub
return [32]byte{}, true, fmt.Errorf("invalid main key: %w", err)
}
if eSec.Public() != ePub {
return [32]byte{}, true, fmt.Errorf("stored decoupled encryption key is corrupted: %w", err)
return [32]byte{}, true, fmt.Errorf("stored decoupled encryption key at %s doesn't match the announced key %s", eKeyPath, ePub.Hex())
}
return eSec, true, nil
}