Commit Graph

15 Commits

Author SHA1 Message Date
Aleksandr Yeganov aefef8987f Free SSL object when redisSSLConnect fails 2020-11-10 11:59:41 -05:00
michael-grunder e7dda97859 Formatting 2020-10-18 14:24:22 -07:00
Alessio M 6693863f4c Add support for system CA certificate store on Windows 2020-09-08 20:09:39 +01:00
Michael Grunder d8ff72387d
Move SSL management to a distinct private pointer. (#855)
We need to allow our users to use redisContext->privdata as context
for any RESP3 PUSH messages, which means we can't use it for managing
SSL connections.

Bulletpoints:

* Create a secondary redisContext member for internal use only called
  privctx and rename the redisContextFuncs->free_privdata accordingly.

* Adds a `free_privdata` function pointer so the user can tie allocated
  memory to the lifetime of a redisContext (like they can already do
  with redisAsyncContext)

* Enables SSL tests in .travis.yml
2020-07-29 11:53:03 -07:00
Michael Grunder ada3665279
Use _WIN32 define instead of WIN32 (#845)
It appears that _WIN32 is always defined by MSVC whereas WIN32 may not
be, depending on configuration.
2020-07-08 17:44:30 -07:00
Michael Grunder 6448f735d5
sdsrange overflow fix (#830)
Fix overflow bug in `sdsrange`
2020-06-07 14:38:16 -07:00
michael-grunder 904bf7fe00 Tiny OOM fix 2020-05-30 11:03:45 -07:00
Yossi Gottlieb 190bca88d0 New SSL API to replace redisSecureConnection(). 2020-05-24 23:37:47 +03:00
Michael Grunder 8e0264cfd6
Allow users to replace allocator and handle OOM everywhere. (#800)
* Adds an indirection to every allocation/deallocation to allow users to 
  plug in ones of their choosing (use custom functions, jemalloc, etc).

* Gracefully handle OOM everywhere in hiredis.  This should make it possible
  for users of the library to have more flexibility in how they handle such situations.

* Changes `redisReaderTask->elements` from an `int` to a `long long` to prevent
  a possible overflow when transferring the task elements into a `redisReply`.

* Adds a configurable `max elements` member to `redisReader` that defaults to
  2^32 - 1.  This can be set to "unlimited" by setting the value to zero.
2020-05-22 09:27:49 -07:00
Michael Grunder ec08c2b94a
Added CMake package config and fixed hiredis_ssl on Windows (#783)
* Add CMake package configuration so hiredis can be more easily included in 
  other projects.

* Fixes hiredis_ssl such that it compiles and works in windows

Co-authored-by: nrivera <nrivera@blizzard.com>
Co-authored-by: Nick <heronr1@gmail.com>
2020-04-09 08:05:14 -07:00
Michael Grunder 669ac9d0c8
Safe allocation wrappers (#754)
Create allocation wrappers with a configurable OOM handler (defaults to abort()).

See #752, #747
2020-01-28 12:13:05 -08:00
Nathan Scott 42697bd45a Fix dead code in sslLogCallback relating to should_log variable.
Coverity scans found that the should_log logic in sslLogCallback
is not working as expected because the variable is not correctly
initialised (the conditional code before logging always sets the
value to 1, which it already is).
2019-11-25 15:21:05 +11:00
Yossi Gottlieb a1e538092d Make SSL timeout error compatible with rest. 2019-09-16 17:30:35 +03:00
Yossi Gottlieb 5872d818d9 Separate hiredis and hiredis_ssl library build. 2019-09-01 13:46:27 +03:00
Yossi Gottlieb df68d7d8bd Rename sslio. 2019-08-29 22:14:09 +03:00