From e30e6dca8aa1073c65b325a45c58fcddd23c9964 Mon Sep 17 00:00:00 2001 From: mcarlton00 Date: Wed, 12 Feb 2020 17:22:49 -0500 Subject: [PATCH] Add link to magic string --- jellyfin_kodi/jellyfin/websocket.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jellyfin_kodi/jellyfin/websocket.py b/jellyfin_kodi/jellyfin/websocket.py index b0d91f34..47bbf05c 100644 --- a/jellyfin_kodi/jellyfin/websocket.py +++ b/jellyfin_kodi/jellyfin/websocket.py @@ -545,7 +545,9 @@ class WebSocket(object): return False result = result.lower() - value = key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11".encode() + # https://tools.ietf.org/html/rfc6455#page-6 + magic_string = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11".encode() + value = key + magic_string hashed = base64.encodestring(hashlib.sha1(value).digest()).strip().lower().decode() return hashed == result