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

Bump bcpg, bcprov to 1.80, add bcutil dependency

Adding bcutil as a dependency is apparently required now.
See https://github.com/bcgit/bc-java/issues/1977
This commit is contained in:
Paul Schaub 2025-03-11 22:04:03 +01:00
parent 9a1a01fe05
commit 883eb80a63
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
6 changed files with 47 additions and 14 deletions

View file

@ -55,14 +55,14 @@ public class CustomPublicKeyDataDecryptorFactoryTest {
HardwareSecurity.DecryptionCallback hardwareDecryptionCallback = new HardwareSecurity.DecryptionCallback() {
@Override
public byte[] decryptSessionKey(long keyId, int keyAlgorithm, byte[] sessionKeyData)
public byte[] decryptSessionKey(long keyId, int keyAlgorithm, byte[] sessionKeyData, int pkeskVersion)
throws HardwareSecurity.HardwareSecurityException {
// Emulate hardware decryption.
try {
PGPSecretKey decryptionKey = secretKey.getSecretKey(encryptionKey.getKeyID());
PGPPrivateKey privateKey = UnlockSecretKey.unlockSecretKey(decryptionKey, Passphrase.emptyPassphrase());
PublicKeyDataDecryptorFactory internal = new BcPublicKeyDataDecryptorFactory(privateKey);
return internal.recoverSessionData(keyAlgorithm, new byte[][] {sessionKeyData});
return internal.recoverSessionData(keyAlgorithm, new byte[][] {sessionKeyData}, pkeskVersion);
} catch (PGPException e) {
throw new HardwareSecurity.HardwareSecurityException();
}