[jdk17u-dev] RFR: 8302111: Serialization considerations
Goetz Lindenmaier
goetz at openjdk.org
Mon Feb 17 16:44:51 UTC 2025
I backport this to match 17.0.13-oracle based on the commit to 21.
I had to resolve several files, two of them considerably:
src/java.base/share/classes/com/sun/crypto/provider/DHPrivateKey.java
Resolved larger chunk.
src/java.base/share/classes/com/sun/crypto/provider/DHPublicKey.java
Resolved some code.
The new code in DHPublic/PrivateKey depends on the removal
of IOException in [JDK-8297065.](https://bugs.openjdk.org/browse/JDK-8297065)"DerOutputStream operations should not throw IOExceptions" It calls functions that throw an
exception in 17, but do not do so in 21. JDK-8297065 makes the
point that these exceptions can never been thrown, which also
holds for 17. So I just catch and ignore them.
Also, I had to adapt code because a constructor with cause for
InvalidObjectException is missing in 17.
This was added by [JDK-8282696](https://bugs.openjdk.org/browse/JDK-8282696) "Add constructors taking a cause
to InvalidObjectException and InvalidClassException" in 19.
I double-checked that [JDK-8297065.](https://bugs.openjdk.org/browse/JDK-8297065) was not backported
by Oracle. Backporting this change would simplify matters considerably.
The remaining files only needed trivial resolves:
src/java.base/share/classes/java/security/Permissions.java
src/java.base/share/classes/java/security/SignedObject.java
Only Copyright.
src/java.base/share/classes/java/security/Timestamp.java
Copyright and import.
src/java.base/share/classes/java/security/UnresolvedPermissionCollection.java
src/java.base/share/classes/java/security/cert/CertificateRevokedException.java
src/java.base/share/classes/sun/security/provider/DRBG.java
src/java.base/share/classes/sun/security/util/ObjectIdentifier.java
src/java.base/share/classes/sun/security/x509/AlgIdDSA.java
Only Copyright.
src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5Context.java
Resolved imports.
src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java
src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11SecureRandom.java
Only Copyright.
I manually ran these tests on linux x86_64:
test/jdk/com/sun/security
test/jdk/java/awt/security
test/jdk/java/net/httpclient/security
test/jdk/java/net/httpclient/websocket/security
test/jdk/java/security
test/jdk/javax/management/security
test/jdk/javax/security
test/jdk/jdk/security
test/jdk/security
test/jdk/sun/security
Our well-known nightly tests passed, too.
-------------
Commit messages:
- Make it build, just ignore IOException. call initCause
- Backport 8302111
Changes: https://git.openjdk.org/jdk17u-dev/pull/3278/files
Webrev: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3278&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8302111
Stats: 1103 lines in 21 files changed: 612 ins; 339 del; 152 mod
Patch: https://git.openjdk.org/jdk17u-dev/pull/3278.diff
Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/3278/head:pull/3278
PR: https://git.openjdk.org/jdk17u-dev/pull/3278
More information about the jdk-updates-dev
mailing list