mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-05 01:34:13 +00:00
openssl 1.1 DSA functions
This commit is contained in:
parent
8182f97c15
commit
e45e5df377
@ -135,11 +135,8 @@ namespace crypto
|
|||||||
DSA * CreateDSA ()
|
DSA * CreateDSA ()
|
||||||
{
|
{
|
||||||
DSA * dsa = DSA_new ();
|
DSA * dsa = DSA_new ();
|
||||||
dsa->p = BN_dup (dsap);
|
DSA_set0_pqg (dsa, BN_dup (dsap), BN_dup (dsaq), BN_dup (dsag));
|
||||||
dsa->q = BN_dup (dsaq);
|
DSA_set0_key (dsa, NULL, NULL);
|
||||||
dsa->g = BN_dup (dsag);
|
|
||||||
dsa->priv_key = NULL;
|
|
||||||
dsa->pub_key = NULL;
|
|
||||||
return dsa;
|
return dsa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
Crypto.h
10
Crypto.h
@ -279,6 +279,16 @@ namespace crypto
|
|||||||
|
|
||||||
void InitCrypto (bool precomputation);
|
void InitCrypto (bool precomputation);
|
||||||
void TerminateCrypto ();
|
void TerminateCrypto ();
|
||||||
|
|
||||||
|
// take care about openssl version
|
||||||
|
#include <openssl/opensslv.h>
|
||||||
|
#if (OPENSSL_VERSION_NUMBER < 0x010100000) // 1.1.0
|
||||||
|
// define getters and setters introduced in 1.1.0
|
||||||
|
inline int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) { d->p = p; d->q = q; d->g = g; return 1; }
|
||||||
|
inline int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) { d->pub_key = pub_key; d->priv_key = priv_key; return 1; }
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user