Skip to content

Commit

Permalink
feat: Add EVP_CIPHER_CTX_init_wrapper (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Lees11 authored Feb 15, 2019
1 parent a39f934 commit 273fe9f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions shim.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ static inline EVP_CIPHER_CTX *EVP_CIPHER_CTX_new_wrapper(void) {
#endif
}

// This wrapper allows for a common call for both versions of OpenSSL when initalizing an EVP_CIPHER_CTX.
static inline void EVP_CIPHER_CTX_init_wrapper(EVP_CIPHER_CTX *ctx) {

#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
EVP_CIPHER_CTX_reset(ctx);
#else
EVP_CIPHER_CTX_init(ctx);
#endif
}

// This wrapper allows for a common call for both versions of OpenSSL when resetting an EVP_CIPHER_CTX.
static inline int EVP_CIPHER_CTX_reset_wrapper(EVP_CIPHER_CTX *ctx) {

Expand Down

0 comments on commit 273fe9f

Please sign in to comment.