Fix ECDSA_SIG_get0 compatibility function

This commit is contained in:
Stephane Bakhos 2020-05-15 00:09:46 -04:00
parent d99365b387
commit 7448e34ebf
2 changed files with 15 additions and 8 deletions

View File

@ -415,3 +415,15 @@ bool CKey::IsValid()
key2.SetSecret(secret, fCompr);
return GetPubKey() == key2.GetPubKey();
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
{
if (pr != NULL)
*pr = sig->r;
if (ps != NULL)
*ps = sig->s;
}
#endif

View File

@ -38,14 +38,9 @@
// see www.keylength.com
// script supports up to 75 for single byte push
#if OPENSSL_VERSION_NUMBER < 0x1010000
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
{
if (pr != NULL)
*pr = sig->r;
if (ps != NULL)
*ps = sig->s;
}
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#include <openssl/ecdsa.h>
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
#endif
class key_error : public std::runtime_error