Skip to content

Commit eb34aa9

Browse files
author
gefeili
committed
1. In BcPBEDataDecryptorFactory, the PGPDigestCalculatorProvider argument was unnecessarily shadowed as BcPGPDigestCalculatorProvider.
2. JcePBEKeyEncryptionMethodGenerator did not expose the constructor taking Argon2 S2K parameters.
2 parents 7acd73b + 7729228 commit eb34aa9

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

pg/src/main/java/org/bouncycastle/openpgp/operator/PBEKeyEncryptionMethodGenerator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
* PGP style PBE encryption method.
1515
* <p>
1616
* A pass phrase is used to generate an encryption key using the PGP {@link S2K string-to-key}
17-
* method. This class always uses the {@link S2K#SALTED_AND_ITERATED salted and iterated form of the
18-
* S2K algorithm}.
17+
* method.
1918
* </p><p>
2019
* Note that the iteration count provided to this method is a single byte as described by the
2120
* {@link S2K} algorithm, and the actual iteration count ranges exponentially from

pg/src/main/java/org/bouncycastle/openpgp/operator/bc/BcPBEDataDecryptorFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.bouncycastle.openpgp.PGPSessionKey;
1717
import org.bouncycastle.openpgp.operator.PBEDataDecryptorFactory;
1818
import org.bouncycastle.openpgp.operator.PGPDataDecryptor;
19+
import org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider;
1920

2021
/**
2122
* A {@link PBEDataDecryptorFactory} for handling PBE decryption operations using the Bouncy Castle
@@ -30,7 +31,7 @@ public class BcPBEDataDecryptorFactory
3031
* @param pass the passphrase to use as the primary source of key material.
3132
* @param calculatorProvider a digest calculator provider to provide calculators to support the key generation calculation required.
3233
*/
33-
public BcPBEDataDecryptorFactory(char[] pass, BcPGPDigestCalculatorProvider calculatorProvider)
34+
public BcPBEDataDecryptorFactory(char[] pass, PGPDigestCalculatorProvider calculatorProvider)
3435
{
3536
super(pass, calculatorProvider);
3637
}

pg/src/main/java/org/bouncycastle/openpgp/operator/jcajce/JcePBEKeyEncryptionMethodGenerator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public JcePBEKeyEncryptionMethodGenerator(char[] passPhrase, int s2kCount)
8383
super(passPhrase, new SHA1PGPDigestCalculator(), s2kCount);
8484
}
8585

86+
public JcePBEKeyEncryptionMethodGenerator(char[] passPhrase, S2K.Argon2Params params)
87+
{
88+
super(passPhrase, params);
89+
}
90+
8691
/**
8792
* Sets the JCE provider to source cryptographic primitives from.
8893
*

0 commit comments

Comments
 (0)