mirror of
https://github.com/fiatjaf/nak.git
synced 2026-08-01 01:15:03 +02:00
key: decrypt with the password as argument never read the ncryptsec from stdin, it was decrypting an empty string.
This commit is contained in:
4
key.go
4
key.go
@@ -173,7 +173,8 @@ var decryptKey = &cli.Command{
|
||||
}
|
||||
} else {
|
||||
password = c.Args().Get(0)
|
||||
for ncryptsec := range getStdinLinesOrArgumentsFromSlice([]string{ncryptsec}) {
|
||||
// the ncryptsec codes come from stdin
|
||||
for ncryptsec := range getStdinLinesOrArgumentsFromSlice(nil) {
|
||||
sk, err := nip49.Decrypt(ncryptsec, password)
|
||||
if err != nil {
|
||||
ctx = lineProcessingError(ctx, "failed to decrypt: %s", err)
|
||||
@@ -181,6 +182,7 @@ var decryptKey = &cli.Command{
|
||||
}
|
||||
stdout(sk.Hex())
|
||||
}
|
||||
exitIfLineProcessingError(ctx)
|
||||
return nil
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user