In JDK-8267599, reverted only macAlgorithm. So still issue is reproducible. We should revert certProtectionAlgorithm also at least, I would suggest to revert keyProtectionAlgorithm along with it.
Steps to reproduce the issue:
Generate keystore with latest java - keytool -keystore testkeystore.p12 -genkeypair -keyalg EC -alias testcert -dname CN=testcert -storepass password -storetype pkcs12
Run the attached program with old JDK(say April 2021 CPU)
Exception:
Exception in thread "main" java.io.IOException: parseAlgParameters failed: ObjectIdentifier() -- data isn't an object ID (tag = 48)
at sun.security.pkcs12.PKCS12KeyStore.parseAlgParameters(PKCS12KeyStore.java:819)
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2027)
at java.security.KeyStore.load(KeyStore.java:1445)
at PKCS12.main(PKCS12.java:14)
Caused by: java.io.IOException: ObjectIdentifier() -- data isn't an object ID (tag = 48)
at sun.security.util.ObjectIdentifier.<init>(ObjectIdentifier.java:285)
at sun.security.util.DerInputStream.getOID(DerInputStream.java:321)
at com.sun.crypto.provider.PBES2Parameters.engineInit(PBES2Parameters.java:267)
at java.security.AlgorithmParameters.init(AlgorithmParameters.java:293)
at sun.security.pkcs12.PKCS12KeyStore.parseAlgParameters(PKCS12KeyStore.java:815)
... 3 more