Anoncoin/oldrepo-backup

Update code to work with latest openssl so it compiles on Linux

Opened this issue · 0 comments

key.cpp: In function ‘int {anonymous}::ECDSA_SIG_recover_key_GFp(EC_KEY*, ECDSA_SIG*, const unsigned char*, int, int, int)’:
key.cpp:88:28: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (!BN_add(x, x, ecsig->r)) { ret=-1; goto err; }
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:88:30: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (!BN_add(x, x, ecsig->r)) { ret=-1; goto err; }
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:109:34: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (!BN_mod_inverse(rr, ecsig->r, order, ctx)) { ret=-1; goto err; }
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:109:36: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (!BN_mod_inverse(rr, ecsig->r, order, ctx)) { ret=-1; goto err; }
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:111:31: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (!BN_mod_mul(sor, ecsig->s, rr, order, ctx)) { ret=-1; goto err; }
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:111:33: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (!BN_mod_mul(sor, ecsig->s, rr, order, ctx)) { ret=-1; goto err; }
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp: In member function ‘void {anonymous}::CECKey::SetSecretBytes(const unsigned char*)’:
key.cpp:156:16: error: aggregate ‘BIGNUM bn’ has incomplete type and cannot be defined
BIGNUM bn;
^~
key.cpp:157:9: error: ‘BN_init’ was not declared in this scope
BN_init(&bn);
^~~~~~~
key.cpp:157:9: note: suggested alternative: ‘BN_print’
BN_init(&bn);
^~~~~~~
BN_print
key.cpp: In member function ‘bool {anonymous}::CECKey::Sign(const uint256&, std::vector&)’:
key.cpp:218:23: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (BN_cmp(sig->s, halforder) > 0) {
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:218:25: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
if (BN_cmp(sig->s, halforder) > 0) {
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:220:23: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_sub(sig->s, order, sig->s);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:220:25: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_sub(sig->s, order, sig->s);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:220:38: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_sub(sig->s, order, sig->s);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:220:40: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_sub(sig->s, order, sig->s);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp: In member function ‘bool {anonymous}::CECKey::SignCompact(const uint256&, unsigned char*, int&)’:
key.cpp:246:37: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
int nBitsR = BN_num_bits(sig->r);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:246:39: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
int nBitsR = BN_num_bits(sig->r);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:247:37: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
int nBitsS = BN_num_bits(sig->s);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:247:39: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
int nBitsS = BN_num_bits(sig->s);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:264:26: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bn2bin(sig->r,&p64[32-(nBitsR+7)/8]);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:264:28: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bn2bin(sig->r,&p64[32-(nBitsR+7)/8]);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:265:26: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bn2bin(sig->s,&p64[64-(nBitsS+7)/8]);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:265:28: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bn2bin(sig->s,&p64[64-(nBitsS+7)/8]);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp: In member function ‘bool {anonymous}::CECKey::Recover(const uint256&, const unsigned char*, int)’:
key.cpp:280:36: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bin2bn(&p64[0], 32, sig->r);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:280:38: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bin2bn(&p64[0], 32, sig->r);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:281:36: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bin2bn(&p64[32], 32, sig->s);
^~
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp:281:38: error: invalid use of incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
BN_bin2bn(&p64[32], 32, sig->s);
^
In file included from /usr/include/openssl/ecdsa.h:10:0,
from key.cpp:12:
/usr/include/openssl/ec.h:1039:16: note: forward declaration of ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
typedef struct ECDSA_SIG_st ECDSA_SIG;
^~~~~~~~~~~~
key.cpp: At global scope:
key.cpp:20:5: warning: ‘int {anonymous}::EC_KEY_regenerate_key(EC_KEY*, BIGNUM*)’ defined but not used [-Wunused-function]
int EC_KEY_regenerate_key(EC_KEY *eckey, BIGNUM *priv_key)

Installing openssl version "i" isn't an option because then you can't use qt4.6 since it's openssl is compiled against something else, just becomes a spaghetti factory of stupidity, besides installing all that shit leaves you open to probs since it's old.

Also get the chainparams.cpp up to date, I'm tired of copying mine over the shitty one you don't have updated to work with the latest GCC (for real WTF).