This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push: new 8685695 Correct a regression in the fix for BZ 64110 8685695 is described below commit 86856951e3f95d429a887c72b2d31384eacfea67 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Jan 28 14:01:35 2021 +0000 Correct a regression in the fix for BZ 64110 Larger TLS grease values triggered an overflow when being converted to a String value for logging / reporting purposes. This broke the TLS handshake which in turn broke the TLS connection. --- java/org/apache/tomcat/util/buf/HexUtils.java | 4 ++-- test/org/apache/tomcat/util/buf/TestHexUtils.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/java/org/apache/tomcat/util/buf/HexUtils.java b/java/org/apache/tomcat/util/buf/HexUtils.java index c7bada8..e4aafdf 100644 --- a/java/org/apache/tomcat/util/buf/HexUtils.java +++ b/java/org/apache/tomcat/util/buf/HexUtils.java @@ -78,8 +78,8 @@ public final class HexUtils { // 2 bytes / 4 hex digits StringBuilder sb = new StringBuilder(4); - sb.append(hex[(c & 0xf000) >> 4]); - sb.append(hex[(c & 0x0f00)]); + sb.append(hex[(c & 0xf000) >> 12]); + sb.append(hex[(c & 0x0f00) >> 8]); sb.append(hex[(c & 0xf0) >> 4]); sb.append(hex[(c & 0x0f)]); diff --git a/test/org/apache/tomcat/util/buf/TestHexUtils.java b/test/org/apache/tomcat/util/buf/TestHexUtils.java index 5b78416..0dd3608 100644 --- a/test/org/apache/tomcat/util/buf/TestHexUtils.java +++ b/test/org/apache/tomcat/util/buf/TestHexUtils.java @@ -68,4 +68,9 @@ public class TestHexUtils { // Odd number of hex characters HexUtils.fromHexString("aaa"); } + + @Test + public void testToHex01() { + Assert.assertEquals("fedc", HexUtils.toHexString((char) 0xfedc)); + } } \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org