[libsoup] Fix reserved bit



commit 3eadca3ed2c529af67d0710a58af57689bb68d44
Author: Italo Guerrieri <guerital amazon it>
Date:   Thu Dec 28 11:48:51 2017 +0100

    Fix reserved bit
    
    Close connection if reserved bits are different than zero.
    These bits should always be 000 because libsoup does not
    support extentions that need to use these reserved bits.
    Fix Autobahn test cases 3.*
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792113

 libsoup/soup-websocket-connection.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c
index 08387e5..ef984b5 100644
--- a/libsoup/soup-websocket-connection.c
+++ b/libsoup/soup-websocket-connection.c
@@ -804,6 +804,11 @@ process_frame (SoupWebsocketConnection *self)
        opcode = header[0] & 0x0f;
        masked = ((header[1] & 0x80) != 0);
 
+       /* We do not support extensions, reserved bits must be 0 */
+       if (header[0] & 0x70) {
+               protocol_error_and_close (self);
+       }
+
        switch (header[1] & 0x7f) {
        case 126:
                at = 4;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]