libssh: libcrypto-compat.h Source File

libssh 0.10.4 The SSH library

Loading...
Searching...
No Matches
libcrypto-compat.h
1#ifndef LIBCRYPTO_COMPAT_H
2#define LIBCRYPTO_COMPAT_H
3
4#include <openssl/opensslv.h>
5
6#define NISTP256 "P-256"
7#define NISTP384 "P-384"
8#define NISTP521 "P-521"
9
10#if OPENSSL_VERSION_NUMBER < 0x10100000L
11
12#include <openssl/rsa.h>
13#include <openssl/dsa.h>
14#include <openssl/ecdsa.h>
15#include <openssl/dh.h>
16#include <openssl/evp.h>
17#include <openssl/hmac.h>
18#include <openssl/bn.h>
19
20int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
21int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
22int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
23void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d);
24void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q);
25void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp);
26
27void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
28int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
29void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key);
30int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
31
32void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
33int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
34
35void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
36int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
37
38EVP_MD_CTX *EVP_MD_CTX_new(void);
39void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
40
41void DH_get0_pqg(const DH *dh,
42 const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
43int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
44void DH_get0_key(const DH *dh,
45 const BIGNUM **pub_key, const BIGNUM **priv_key);
46int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key);
47
48const char *OpenSSL_version(int type);
49unsigned long OpenSSL_version_num(void);
50
51#endif /* OPENSSL_VERSION_NUMBER */
52
53#endif /* LIBCRYPTO_COMPAT_H */