aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-01-25 20:54:39 -0800
committerAndreas Schneider <asn@cryptomilk.org>2020-05-05 14:32:15 +0200
commitd35fdfbdb4171331bfdf2ac3753fe4bc3fdf5407 (patch)
treebee60771abe87eaa6e88af7328466a99b4d3f173
parent7ee7ff94ba31c99934077c838ab27441ccd2c51d (diff)
downloadlibssh-d35fdfbdb4171331bfdf2ac3753fe4bc3fdf5407.tar.gz
libssh-d35fdfbdb4171331bfdf2ac3753fe4bc3fdf5407.tar.xz
libssh-d35fdfbdb4171331bfdf2ac3753fe4bc3fdf5407.zip
libcrypto-compat: add extra functions
Added extra functions. The next commit will switch to them. Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit 70478619cec751d9ba6c87ac1d034f1cf8df47be)
-rw-r--r--src/libcrypto-compat.c14
-rw-r--r--src/libcrypto-compat.h6
2 files changed, 20 insertions, 0 deletions
diff --git a/src/libcrypto-compat.c b/src/libcrypto-compat.c
index 048d1781..3604763f 100644
--- a/src/libcrypto-compat.c
+++ b/src/libcrypto-compat.c
@@ -280,6 +280,11 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
OPENSSL_free(ctx);
}
+int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
+{
+ EVP_CIPHER_CTX_init(ctx);
+}
+
HMAC_CTX *HMAC_CTX_new(void)
{
HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));
@@ -394,3 +399,12 @@ int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
}
return 1;
}
+
+const char *OpenSSL_version(int type)
+{
+ return SSLeay_version(type);
+}
+unsigned long OpenSSL_version_num(void)
+{
+ return SSLeay();
+}
diff --git a/src/libcrypto-compat.h b/src/libcrypto-compat.h
index bda0473e..0082e207 100644
--- a/src/libcrypto-compat.h
+++ b/src/libcrypto-compat.h
@@ -34,6 +34,8 @@ int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
EVP_MD_CTX *EVP_MD_CTX_new(void);
void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
+int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx);
+
HMAC_CTX *HMAC_CTX_new(void);
int HMAC_CTX_reset(HMAC_CTX *ctx);
void HMAC_CTX_free(HMAC_CTX *ctx);
@@ -44,6 +46,10 @@ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
void DH_get0_key(const DH *dh,
const BIGNUM **pub_key, const BIGNUM **priv_key);
int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
+
+const char *OpenSSL_version(int type);
+unsigned long OpenSSL_version_num(void);
+
#endif /* OPENSSL_VERSION_NUMBER */
#endif /* LIBCRYPTO_COMPAT_H */