mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-19 05:52:04 +01:00
Fix indirect parameter passing for change-key-password password arguments
Fixes https://github.com/pgpainless/pgpainless/issues/453 Thanks to @dkg for the report
This commit is contained in:
parent
5ea94233d8
commit
00925e6511
2 changed files with 13 additions and 8 deletions
|
@ -6,6 +6,9 @@ SPDX-License-Identifier: Apache-2.0
|
|||
|
||||
# Changelog
|
||||
|
||||
## 7.0.2-SNAPSHOT
|
||||
- CLI `change-key-password`: Fix indirect parameter passing for new and old passwords (thanks to @dkg for the report)
|
||||
|
||||
## 7.0.1
|
||||
- `decrypt`: Do not throw `NoSignature` exception (exit code 3) if `--verify-with` is provided, but `VERIFICATIONS` is empty.
|
||||
|
||||
|
|
|
@ -39,15 +39,17 @@ public class ChangeKeyPasswordCmd extends AbstractSopCmd {
|
|||
changeKeyPassword.noArmor();
|
||||
}
|
||||
|
||||
try {
|
||||
for (String oldKeyPassword : oldKeyPasswords) {
|
||||
changeKeyPassword.oldKeyPassphrase(oldKeyPassword);
|
||||
String password = stringFromInputStream(getInput(oldKeyPassword));
|
||||
changeKeyPassword.oldKeyPassphrase(password);
|
||||
}
|
||||
|
||||
if (newKeyPassword != null) {
|
||||
changeKeyPassword.newKeyPassphrase(newKeyPassword);
|
||||
String password = stringFromInputStream(getInput(newKeyPassword));
|
||||
changeKeyPassword.newKeyPassphrase(password);
|
||||
}
|
||||
|
||||
try {
|
||||
changeKeyPassword.keys(System.in).writeTo(System.out);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
Loading…
Reference in a new issue