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>
15int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
16int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
17int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
18void RSA_get0_key(
const RSA *r,
const BIGNUM **n,
const BIGNUM **e,
const BIGNUM **d);
19void RSA_get0_factors(
const RSA *r,
const BIGNUM **p,
const BIGNUM **q);
20void RSA_get0_crt_params(
const RSA *r,
const BIGNUM **dmp1,
const BIGNUM **dmq1,
const BIGNUM **iqmp);
22void DSA_get0_pqg(
const DSA *d,
const BIGNUM **p,
const BIGNUM **q,
const BIGNUM **g);
23int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
24void DSA_get0_key(
const DSA *d,
const BIGNUM **pub_key,
const BIGNUM **priv_key);
25int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
27void DSA_SIG_get0(
const DSA_SIG *sig,
const BIGNUM **pr,
const BIGNUM **ps);
28int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
30void ECDSA_SIG_get0(
const ECDSA_SIG *sig,
const BIGNUM **pr,
const BIGNUM **ps);
31int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
33int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
34EVP_MD_CTX *EVP_MD_CTX_new(
void);
35void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
37int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx);
39HMAC_CTX *HMAC_CTX_new(
void);
40int HMAC_CTX_reset(HMAC_CTX *ctx);
41void HMAC_CTX_free(HMAC_CTX *ctx);
43void DH_get0_pqg(
const DH *dh,
44 const BIGNUM **p,
const BIGNUM **q,
const BIGNUM **g);
45int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
46void DH_get0_key(
const DH *dh,
47 const BIGNUM **pub_key,
const BIGNUM **priv_key);
48int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
50const char *OpenSSL_version(
int type);
51unsigned long OpenSSL_version_num(
void);