mirror of
https://github.com/fiatjaf/nak.git
synced 2026-10-05 15:18:23 +00:00
Merge pull request #185 from mattn/fix/dekey-corrupted-error-message
gift, dekey: fix key-mismatch error wrapping a nil err with %w
This commit is contained in:
@@ -164,7 +164,7 @@ var dekey = &cli.Command{
|
|||||||
return fmt.Errorf("invalid main key: %w", err)
|
return fmt.Errorf("invalid main key: %w", err)
|
||||||
}
|
}
|
||||||
if eSec.Public() != ePub {
|
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 {
|
} else {
|
||||||
log("- decoupled encryption key not found locally, attempting to fetch the key from other devices\n")
|
log("- decoupled encryption key not found locally, attempting to fetch the key from other devices\n")
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ func getDecoupledEncryptionSecretKey(ctx context.Context, configPath string, pub
|
|||||||
return [32]byte{}, true, fmt.Errorf("invalid main key: %w", err)
|
return [32]byte{}, true, fmt.Errorf("invalid main key: %w", err)
|
||||||
}
|
}
|
||||||
if eSec.Public() != ePub {
|
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
|
return eSec, true, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user