Fix password parameter passing in change-key-password

This commit is contained in:
Paul Schaub 2024-10-31 13:15:06 +01:00
parent 84f9fbc221
commit a33739b772
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -33,9 +33,15 @@ class ChangeKeyPasswordCmd : AbstractSopCmd() {
changeKeyPassword.noArmor()
}
oldKeyPasswords.forEach { changeKeyPassword.oldKeyPassphrase(it) }
oldKeyPasswords.forEach {
val password = stringFromInputStream(getInput(it))
changeKeyPassword.oldKeyPassphrase(password)
}
newKeyPassword?.let { changeKeyPassword.newKeyPassphrase(it) }
newKeyPassword?.let {
val password = stringFromInputStream(getInput(it))
changeKeyPassword.newKeyPassphrase(password)
}
try {
changeKeyPassword.keys(System.`in`).writeTo(System.out)