summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItalo Guerrieri <guerital@amazon.it>2017-12-28 11:48:51 +0100
committerIgnacio Casal Quinteiro <qignacio@amazon.com>2018-01-10 22:11:39 +0100
commit3eadca3ed2c529af67d0710a58af57689bb68d44 (patch)
treea1ecb4434d463197147379f88fae9fac1ef36615
parent14c33979e7383ae52c75903cad41c623820e0947 (diff)
downloadlibsoup-3eadca3ed2c529af67d0710a58af57689bb68d44.tar.gz
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
-rw-r--r--libsoup/soup-websocket-connection.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c
index 08387e54..ef984b52 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;