aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-06-28 13:12:28 -0400
committerFranklin Wei <me@fwei.tk>2018-06-28 13:12:28 -0400
commitd60cbe8d333e8fc11d5d79898c6ebfa5153950e0 (patch)
treeeaabf38e73421e232038338054e68d748f7dd0eb
parentedc1562fb2f2724570ab7d2bc6fd47f6115df4ab (diff)
downloadcsaa-d60cbe8d333e8fc11d5d79898c6ebfa5153950e0.zip
csaa-d60cbe8d333e8fc11d5d79898c6ebfa5153950e0.tar.gz
csaa-d60cbe8d333e8fc11d5d79898c6ebfa5153950e0.tar.bz2
csaa-d60cbe8d333e8fc11d5d79898c6ebfa5153950e0.tar.xz
Add more workaround functions
-rw-r--r--crypto.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/crypto.c b/crypto.c
index ce77461..d63e36a 100644
--- a/crypto.c
+++ b/crypto.c
@@ -227,6 +227,27 @@ hash_t hash_increment(hash_t h)
#include <string.h>
#include <openssl/engine.h>
+
+ const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx)
+ {
+ return ctx->iv;
+ }
+
+ unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx)
+ {
+ return ctx->iv;
+ }
+
+ EVP_MD_CTX *EVP_MD_CTX_new(void)
+ {
+ return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
+ }
+
+ void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+ {
+ EVP_MD_CTX_cleanup(ctx);
+ OPENSSL_free(ctx);
+ }
HMAC_CTX *HMAC_CTX_new(void)
{
HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
@@ -242,13 +263,14 @@ hash_t hash_increment(hash_t h)
void HMAC_CTX_free(HMAC_CTX *ctx)
{
if (ctx != NULL) {
- hmac_ctx_cleanup(ctx);
EVP_MD_CTX_free(ctx->i_ctx);
EVP_MD_CTX_free(ctx->o_ctx);
EVP_MD_CTX_free(ctx->md_ctx);
OPENSSL_free(ctx);
}
- }
+
+}
+
#endif
/* simple XOR cipher, so encryption and decryption are symmetric */