fixed regression with PKCS#12
@@ -320,10 +320,17 @@ protected SecretKey engineGenerateSecret(
CipherParameters param;
if (pbeSpec.getSalt() == null)
+ {
+ if (scheme == PKCS5S1 || scheme == PKCS5S1_UTF8)
{
return new PBKDF1Key(pbeSpec.getPassword(),
scheme == PKCS5S1 ? PasswordConverter.ASCII : PasswordConverter.UTF8);
}
+ else
+ {
+ return new BCPBEKey(this.algName, this.algOid, scheme, digest, keySize, ivSize, pbeSpec, null);
+ }
+ }
if (forCipher)
{
