From df2aaefb6dad428dc74511a06e532bbc419ddb4f Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 15 Jul 2026 09:41:48 +0900 Subject: [PATCH] gift, dekey: the key-mismatch error was wrapping a nil err with %w, producing a mangled message. --- dekey.go | 2 +- gift.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dekey.go b/dekey.go index 65bf6de..a7aabc8 100644 --- a/dekey.go +++ b/dekey.go @@ -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") diff --git a/gift.go b/gift.go index d2a172d..15cca6d 100644 --- a/gift.go +++ b/gift.go @@ -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 }