1 #ifndef LIBCRYPTO_COMPAT_H 2 #define LIBCRYPTO_COMPAT_H 4 #include <openssl/opensslv.h> 5 #if OPENSSL_VERSION_NUMBER < 0x10100000L 7 #include <openssl/rsa.h> 8 #include <openssl/dsa.h> 9 #include <openssl/ecdsa.h> 10 #include <openssl/dh.h> 11 #include <openssl/evp.h> 12 #include <openssl/hmac.h> 13 #include <openssl/bn.h> 15 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
16 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
17 int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
18 void RSA_get0_key(
const RSA *r,
const BIGNUM **n,
const BIGNUM **e,
const BIGNUM **d);
19 void RSA_get0_factors(
const RSA *r,
const BIGNUM **p,
const BIGNUM **q);
20 void RSA_get0_crt_params(
const RSA *r,
const BIGNUM **dmp1,
const BIGNUM **dmq1,
const BIGNUM **iqmp);
22 void DSA_get0_pqg(
const DSA *d,
const BIGNUM **p,
const BIGNUM **q,
const BIGNUM **g);
23 int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
24 void DSA_get0_key(
const DSA *d,
const BIGNUM **pub_key,
const BIGNUM **priv_key);
25 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
27 void DSA_SIG_get0(
const DSA_SIG *sig,
const BIGNUM **pr,
const BIGNUM **ps);
28 int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
30 void ECDSA_SIG_get0(
const ECDSA_SIG *sig,
const BIGNUM **pr,
const BIGNUM **ps);
31 int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
33 int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
34 EVP_MD_CTX *EVP_MD_CTX_new(
void);
35 void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
37 int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx);
39 HMAC_CTX *HMAC_CTX_new(
void);
40 int HMAC_CTX_reset(HMAC_CTX *ctx);
41 void HMAC_CTX_free(HMAC_CTX *ctx);
43 void DH_get0_pqg(
const DH *dh,
44 const BIGNUM **p,
const BIGNUM **q,
const BIGNUM **g);
45 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
46 void DH_get0_key(
const DH *dh,
47 const BIGNUM **pub_key,
const BIGNUM **priv_key);
48 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
50 const char *OpenSSL_version(
int type);
51 unsigned long OpenSSL_version_num(
void);