Skip to content

Commit a471fe9

Browse files
committed
8360539: DTLS handshakes fails due to improper cookie validation logic
Reviewed-by: ascarpino, hchao
1 parent 839cede commit a471fe9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -187,7 +187,7 @@ boolean isCookieValid(ServerHandshakeContext context,
187187
byte[] secret;
188188
d10ManagerLock.lock();
189189
try {
190-
if (((cookieVersion >> 24) & 0xFF) == cookie[0]) {
190+
if ((byte) ((cookieVersion >> 24) & 0xFF) == cookie[0]) {
191191
secret = cookieSecret;
192192
} else {
193193
secret = legacySecret; // including out of window cookies

0 commit comments

Comments
 (0)