5 Commits

Author SHA1 Message Date
Cœur
b84fee24ab Fix "Value stored to 'a' is never read" in SHA1Transform()
Using same fix as used in android [1].

  [1]: android.googlesource.com/platform/dalvik/+/android-4.4.2_r2/libdex/sha1.cpp#193
2023-03-02 07:29:18 +01:00
Azat Khuzhin
e1d7d3e40a sha1: ignore -Wstringop-overread warning
Fixes the following:

    [4/38] Building C object CMakeFiles/event_shared.dir/sha1.c.o
    In function ‘SHA1Update’,
        inlined from ‘SHA1Final’ at /src/le/libevent/sha1.c:274:5,
        inlined from ‘builtin_SHA1’ at /src/le/libevent/sha1.c:292:5:
    /src/le/libevent/sha1.c:228:13: warning: ‘SHA1Transform’ reading 64 bytes from a region of size 7 [-Wstringop-overread]
      228 |             SHA1Transform(context->state, *(const unsigned char (*)[64])&data[i]);
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /src/le/libevent/sha1.c:228:13: note: referencing argument 2 of type ‘const unsigned char[64]’
    /src/le/libevent/sha1.c: In function ‘builtin_SHA1’:
    /src/le/libevent/sha1.c:80:13: note: in a call to function ‘SHA1Transform’
       80 | static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) {
          |             ^~~~~~~~~~~~~
2022-11-12 17:56:51 +01:00
Azat Khuzhin
23a01aa227 sha1: hide SHA1_CTX 2022-11-12 16:42:10 +01:00
Dmitry Ilyin
53f9c42095 Fix conflict with SHA1 function from openssl 2022-09-14 23:10:55 +03:00
Dmitry Ilyin
e8313084f9
Add minimal WebSocket server implementation for evhttp (#1322)
This adds few functions to use evhttp-based webserver to handle incoming
WebSockets connections. We've tried to use both libevent and libwebsockets in
our application, but found that we need to have different ports at the same
time to handle standard HTTP and WebSockets traffic. This change can help to
stick only with libevent library.

Implementation was inspired by modified Libevent source code in ipush project
[1].

  [1]: https://github.com/sqfasd/ipush/tree/master/deps/libevent-2.0.21-stable

Also, WebSocket-based chat server was added as a sample.
2022-09-12 22:16:56 +03:00