[
https://issues.apache.org/jira/browse/NIFI-8451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326765#comment-17326765
]
ASF subversion and git services commented on NIFI-8451:
-------------------------------------------------------
Commit ed6d5bacba45e4a8015cf224366845b16b82b13e in nifi's branch
refs/heads/main from David Handermann
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=ed6d5ba ]
NIFI-8451 Updated KeyStoreUtils to use KeyStore.getInstance() with provider
- Refactored and consolidated KeyStoreUtils unit tests
- Corrected KeyStoreUtils.loadEmptyKeyStore() to use KeyStoreUtils.getKeyStore()
Signed-off-by: Nathan Gough <[email protected]>
This closes #5015.
> KeyStoreUtils Test Failures on Java 1.8.0 Update 292
> ----------------------------------------------------
>
> Key: NIFI-8451
> URL: https://issues.apache.org/jira/browse/NIFI-8451
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.13.2
> Environment: OpenJDK Runtime Environment (Zulu 8.54.0.21-CA-macosx)
> (build 1.8.0_292-b10)
> Reporter: David Handermann
> Assignee: David Handermann
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Azul Zulu JDK 8 Update 292 introduced changes resulting in unit test failures
> for {{KeyStoreUtils}} tests related to PKCS12.
> {quote}java.security.KeyStoreException: Key protection algorithm not found:
> java.security.UnrecoverableKeyException: Encrypt Private Key failed:
> unrecognized algorithm name: PBEWithSHA1AndDESede
> at sun.security.pkcs12.PKCS12KeyStore.setKeyEntry(PKCS12KeyStore.java:694)
> at
> sun.security.pkcs12.PKCS12KeyStore.engineSetKeyEntry(PKCS12KeyStore.java:594)
> at java.security.KeyStore.setKeyEntry(KeyStore.java:1140)
> at
> org.apache.nifi.security.util.KeyStoreUtilsTest.testKeyStoreRoundTrip(KeyStoreUtilsTest.java:124)
> at
> org.apache.nifi.security.util.KeyStoreUtilsTest.testPkcs12KeyStoreRoundTripBcReload(KeyStoreUtilsTest.java:79)
> Caused by: java.security.UnrecoverableKeyException: Encrypt Private Key
> failed: unrecognized algorithm name: PBEWithSHA1AndDESede
> at
> sun.security.pkcs12.PKCS12KeyStore.encryptPrivateKey(PKCS12KeyStore.java:938)
> at sun.security.pkcs12.PKCS12KeyStore.setKeyEntry(PKCS12KeyStore.java:631)
> ... 33 more
> Caused by: java.security.NoSuchAlgorithmException: unrecognized algorithm
> name: PBEWithSHA1AndDESede
> at sun.security.x509.AlgorithmId.get(AlgorithmId.java:448)
> at
> sun.security.pkcs12.PKCS12KeyStore.mapPBEAlgorithmToOID(PKCS12KeyStore.java:955)
> at
> sun.security.pkcs12.PKCS12KeyStore.encryptPrivateKey(PKCS12KeyStore.java:912)
> {quote}
> The unit tests use {{KeyStore.getInstance()}} without specifying the
> provider, causing a mismatch between the KeyStore instances created using
> {{KeyStoreUtils.getKeyStore()}}, which determines the provider based on
> internal configuration.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)