wpiutil: WebSocket: Fix Sec-Websocket-Accept computation

It needs to use the raw SHA1 bytes, not the hex-decoded text.
This commit is contained in:
Peter Johnson
2018-11-18 18:27:06 -08:00
parent 75cc3cda28
commit e4aa45f34b
3 changed files with 4 additions and 3 deletions

View File

@@ -71,7 +71,7 @@ static StringRef AcceptHash(StringRef key, SmallVectorImpl<char>& buf) {
hash.Update(key);
hash.Update("258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
SmallString<64> hashBuf;
return Base64Encode(hash.Final(hashBuf), buf);
return Base64Encode(hash.RawFinal(hashBuf), buf);
}
WebSocket::WebSocket(uv::Stream& stream, bool server, const private_init&)