summaryrefslogtreecommitdiff
path: root/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java')
-rw-r--r--src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java b/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java
index 7136b36ffc2..5ae1981a5e7 100644
--- a/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java
+++ b/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -133,6 +133,15 @@ final class ServerHelloDone {
// The consuming happens in client side only.
ClientHandshakeContext chc = (ClientHandshakeContext)context;
+ // Check for an unprocessed server Certificate message. If
+ // that handshake consumer is still present then that expected
+ // message was not sent.
+ if (chc.handshakeConsumers.containsKey(
+ SSLHandshake.CERTIFICATE.id)) {
+ throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
+ "Unexpected ServerHelloDone handshake message.");
+ }
+
SSLConsumer certStatCons = chc.handshakeConsumers.remove(
SSLHandshake.CERTIFICATE_STATUS.id);
if (certStatCons != null) {