You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/07/24 13:24:20 UTC

[tomcat] branch 8.5.x updated (e8ab3a2 -> a9efebd)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from e8ab3a2  Polish. Align with master.
     new d5ae396  Back-port i18n updates from master
     new a9efebd  Fix h2spec test suite failure. EOS in Huffman encoded string literal.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/coyote/http2/HPackHuffman.java       | 5 +++++
 java/org/apache/coyote/http2/HpackDecoder.java       | 7 ++++---
 java/org/apache/coyote/http2/LocalStrings.properties | 6 +++++-
 webapps/docs/changelog.xml                           | 4 ++++
 4 files changed, 18 insertions(+), 4 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Fix h2spec test suite failure. EOS in Huffman encoded string literal.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit a9efebdeb37fdcadec7c5b9559cbc09bcff0b7c8
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jul 24 14:22:05 2019 +0100

    Fix h2spec test suite failure. EOS in Huffman encoded string literal.
    
    Patch by jfclere
---
 java/org/apache/coyote/http2/HPackHuffman.java       | 5 +++++
 java/org/apache/coyote/http2/LocalStrings.properties | 1 +
 webapps/docs/changelog.xml                           | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/java/org/apache/coyote/http2/HPackHuffman.java b/java/org/apache/coyote/http2/HPackHuffman.java
index 637e690..365a6f9 100644
--- a/java/org/apache/coyote/http2/HPackHuffman.java
+++ b/java/org/apache/coyote/http2/HPackHuffman.java
@@ -404,6 +404,11 @@ public class HPackHuffman {
                     if ((val & HIGH_TERMINAL_BIT) == 0) {
                         treePos = (val >> 16) & LOW_MASK;
                     } else {
+                        if (eosBitCount != 0) {
+                            // This must be the EOS symbol which MUST be treated
+                            // as an error
+                            throw new HpackException(sm.getString("hpackhuffman.stringLiteralEOS"));
+                        }
                         target.append((char) ((val >> 16) & LOW_MASK));
                         treePos = 0;
                         eosBits = true;
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties b/java/org/apache/coyote/http2/LocalStrings.properties
index e371865..b4f9925 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -44,6 +44,7 @@ hpackdecoder.tableSizeUpdateNotAtStart=Any table size update must be sent at the
 hpackdecoder.zeroNotValidHeaderTableIndex=Zero is not a valid header table index
 
 hpackhuffman.huffmanEncodedHpackValueDidNotEndWithEOS=Huffman encoded value in HPACK headers did not end with EOS padding
+hpackhuffman.stringLiteralEOS=Huffman encoded value in HPACK headers contained the EOS symbol
 hpackhuffman.stringLiteralTooMuchPadding=More than 7 bits of EOS padding were provided at the end of an Huffman encoded string literal
 
 http2Parser.headerLimitCount=Connection [{0}], Stream [{1}], Too many headers
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 624a4e0..8416e8a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -93,6 +93,10 @@
         <bug>63578</bug>: Improve handling of invalid requests so that 400
         responses are returned to the client rather than 500 responses. (markt)
       </fix>
+      <fix>
+        Fix h2spec test suite failure. It is an error if a Huffman encoded
+        string literal contains the EOS symbol. (jfclere)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: Back-port i18n updates from master

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit d5ae396e0803a057327343a02623b171ec12eac9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jul 24 14:23:22 2019 +0100

    Back-port i18n updates from master
---
 java/org/apache/coyote/http2/HpackDecoder.java       | 7 ++++---
 java/org/apache/coyote/http2/LocalStrings.properties | 5 ++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/http2/HpackDecoder.java b/java/org/apache/coyote/http2/HpackDecoder.java
index 2c68573..ea88aab 100644
--- a/java/org/apache/coyote/http2/HpackDecoder.java
+++ b/java/org/apache/coyote/http2/HpackDecoder.java
@@ -155,7 +155,7 @@ public class HpackDecoder {
                     return;
                 }
             } else {
-                throw new RuntimeException("Not yet implemented");
+                throw new RuntimeException(sm.getString("hpackdecoder.notImplemented"));
             }
         }
     }
@@ -171,7 +171,8 @@ public class HpackDecoder {
             return false;
         }
         if (size > maxMemorySizeHard) {
-            throw new HpackException();
+            throw new HpackException(sm.getString("hpackdecoder.maxMemorySizeExceeded",
+                    Integer.valueOf(size), Integer.valueOf(maxMemorySizeHard)));
         }
         maxMemorySizeSoft = size;
         if (currentMemorySize > maxMemorySizeSoft) {
@@ -249,7 +250,7 @@ public class HpackDecoder {
             int adjustedIndex = getRealIndex(index - Hpack.STATIC_TABLE_LENGTH);
             Hpack.HeaderField res = headerTable[adjustedIndex];
             if (res == null) {
-                throw new HpackException();
+                throw new HpackException(sm.getString("hpackdecoder.nullHeader", Integer.valueOf(index)));
             }
             return res.name;
         }
diff --git a/java/org/apache/coyote/http2/LocalStrings.properties b/java/org/apache/coyote/http2/LocalStrings.properties
index 88c8970..e371865 100644
--- a/java/org/apache/coyote/http2/LocalStrings.properties
+++ b/java/org/apache/coyote/http2/LocalStrings.properties
@@ -15,7 +15,7 @@
 
 abstractStream.windowSizeDec=Connection [{0}], Stream [{1}], reduce flow control window by [{2}] to [{3}]
 abstractStream.windowSizeInc=Connection [{0}], Stream [{1}], increase flow control window by [{2}] to [{3}]
-abstractStream.windowSizeTooBig=Connection [{0}], Stream [{1}], increase in window size of [{2}] to [{3}] exceeded permitted maximum
+abstractStream.windowSizeTooBig=Connection [{0}], Stream [{1}], increased window size by [{2}] to [{3}] which exceeded permitted maximum
 
 connectionPrefaceParser.eos=Unexpected end of stream while reading opening client preface byte sequence. Only [{0}] bytes read.
 connectionPrefaceParser.ioError=Failed to read opening client preface byte sequence
@@ -37,6 +37,9 @@ hpack.invalidCharacter=The Unicode character [{0}] at code point [{1}] cannot be
 hpackEncoder.encodeHeader=Encoding header [{0}] with value [{1}]
 
 hpackdecoder.headerTableIndexInvalid=The header table index [{0}] is not valid as there are [{1}] static entries and [{2}] dynamic entries
+hpackdecoder.maxMemorySizeExceeded=The header table size [{0}] exceeds the maximum size [{1}]
+hpackdecoder.notImplemented=Not yet implemented
+hpackdecoder.nullHeader=Null header at index [{0}]
 hpackdecoder.tableSizeUpdateNotAtStart=Any table size update must be sent at the start of a header block
 hpackdecoder.zeroNotValidHeaderTableIndex=Zero is not a valid header table index
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org