Skip to content

Commit df2aaef

Browse files
committed
gift, dekey: the key-mismatch error was wrapping a nil err with %w, producing a mangled message.
1 parent 3e50a8c commit df2aaef

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dekey.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ var dekey = &cli.Command{
164164
return fmt.Errorf("invalid main key: %w", err)
165165
}
166166
if eSec.Public() != ePub {
167-
return fmt.Errorf("stored decoupled encryption key is corrupted: %w", err)
167+
return fmt.Errorf("stored decoupled encryption key at %s doesn't match the announced key %s", eKeyPath, ePub.Hex())
168168
}
169169
} else {
170170
log("- decoupled encryption key not found locally, attempting to fetch the key from other devices\n")

gift.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func getDecoupledEncryptionSecretKey(ctx context.Context, configPath string, pub
332332
return [32]byte{}, true, fmt.Errorf("invalid main key: %w", err)
333333
}
334334
if eSec.Public() != ePub {
335-
return [32]byte{}, true, fmt.Errorf("stored decoupled encryption key is corrupted: %w", err)
335+
return [32]byte{}, true, fmt.Errorf("stored decoupled encryption key at %s doesn't match the announced key %s", eKeyPath, ePub.Hex())
336336
}
337337
return eSec, true, nil
338338
}

0 commit comments

Comments
 (0)