1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-05 03:41:07 +01:00

Fix exception when changing passphrase of key with stripped component key

Fixes https://github.com/pgpainless/pgpainless/discussions/489\#discussioncomment-14796176
This commit is contained in:
Paul Schaub 2025-10-29 12:27:28 +01:00
parent 3f7b4920f4
commit a9cee6f45c
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -65,6 +65,12 @@ class S2KUsageFix {
"Missing passphrase for key with ID " + java.lang.Long.toHexString(keyId))
}
// skip stripped secret keys
if (key.isPrivateKeyEmpty) {
keyList.add(key)
continue
}
val privateKey = key.unlock(protector)
// This constructor makes use of USAGE_SHA1 by default
val fixedKey =