Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,15 @@ public void consume(ConnectionContext context,

// clean up this consumer
hc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE.id);

// Ensure that the Certificate message has not been sent w/o
// an EncryptedExtensions preceding
if (hc.handshakeConsumers.containsKey(
SSLHandshake.ENCRYPTED_EXTENSIONS.id)) {
throw hc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
"Unexpected Certificate handshake message");
}

T13CertificateMessage cm = new T13CertificateMessage(hc, message);
if (hc.sslConfig.isClientMode) {
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, 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
Expand Down Expand Up @@ -1168,6 +1168,14 @@ public void consume(ConnectionContext context,
// Clean up this consumer
hc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE_VERIFY.id);

// Ensure that the Certificate Verify message has not been sent w/o
// a Certificate message preceding
if (hc.handshakeConsumers.containsKey(
SSLHandshake.CERTIFICATE.id)) {
throw hc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
"Unexpected Certificate Verify handshake message");
}

T13CertificateVerifyMessage cvm =
new T13CertificateVerifyMessage(hc, message);
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, 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
Expand Down Expand Up @@ -899,6 +899,14 @@ public void consume(ConnectionContext context,

private void onConsumeFinished(ClientHandshakeContext chc,
ByteBuffer message) throws IOException {
// Ensure that the Finished message has not been sent w/o
// an EncryptedExtensions preceding
if (chc.handshakeConsumers.containsKey(
SSLHandshake.ENCRYPTED_EXTENSIONS.id)) {
throw chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
"Unexpected Finished handshake message");
}

// Make sure that any expected CertificateVerify message
// has been received and processed.
if (!chc.isResumption) {
Expand Down
Loading