8286503: Enhance security classes

Reviewed-by: rhalade, mullan, skoivu, weijun
This commit is contained in:
Bradford Wetmore 2023-05-19 00:58:30 +00:00 committed by Henry Jen
parent 195c9b2c48
commit adca97b659
39 changed files with 931 additions and 149 deletions

View file

@ -142,9 +142,9 @@ public final class CodeSigner implements Serializable {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("(");
sb.append("Signer: " + signerCertPath.getCertificates().get(0));
sb.append("Signer: ").append(signerCertPath.getCertificates().get(0));
if (timestamp != null) {
sb.append("timestamp: " + timestamp);
sb.append("timestamp: ").append(timestamp);
}
sb.append(")");
return sb.toString();
@ -160,8 +160,11 @@ public final class CodeSigner implements Serializable {
*/
@java.io.Serial
private void readObject(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
ois.defaultReadObject();
myhash = -1;
throws IOException, ClassNotFoundException {
ois.defaultReadObject();
if (signerCertPath == null) {
throw new InvalidObjectException("signerCertPath is null");
}
myhash = -1;
}
}