Please review this fix to change the internal `X509CertImpl.getFingerprint` method to not return "" as a fingerprint if there is an error generating that fingerprint. Instead, `null` is now returned, and "" is no longer cached as a valid fingerprint. Although errors generating fingerprints should be very rare, this is a cleaner way to handle them.
Also, debugging messages have been added when there is an exception. And, as a memory/performance improvement, `X509CertImpl.getFingerprint` now calls `X509CertImpl.getEncodedInternal` which avoids cloning the encoded bytes if the `Certificate` is an instance of `X509CertImpl`. ------------- Commit messages: - Regression test for JDK-8270946. - 8270946: X509CertImpl.getFingerprint should not return the empty String Changes: https://git.openjdk.java.net/jdk/pull/4891/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4891&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8270946 Stats: 225 lines in 6 files changed: 186 ins; 13 del; 26 mod Patch: https://git.openjdk.java.net/jdk/pull/4891.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4891/head:pull/4891 PR: https://git.openjdk.java.net/jdk/pull/4891