Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid use of incomplete type ‘BIGNUM {aka struct bignum_st}’ #327

Closed
xeroc opened this issue Jul 12, 2017 · 14 comments
Closed

invalid use of incomplete type ‘BIGNUM {aka struct bignum_st}’ #327

xeroc opened this issue Jul 12, 2017 · 14 comments
Labels
2h Accepted Status indicating the solution passed final review, and is ready for implementation compatibility

Comments

@xeroc
Copy link
Member

xeroc commented Jul 12, 2017

I have updated my system (Archlinux) and no longer can compile BitShares (or peerplays...)
This seems to be a fc issue.

@dnotestein peerplays affected too!

In bitcoin, they seemed to have had a similar issue related to openSSL:
bitcoin/bitcoin#7086

There, they seemed to have replaced the C++ implementation of openssl's BIGNUM by something else:
laanwj/bitcoin@4ec3561

Logs

[ 21%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/base58.cpp.o
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:69:24: error: invalid use of incomplete type ‘BIGNUM {aka struct bignum_st}’
 class CBigNum : public BIGNUM
                        ^
In file included from /usr/include/openssl/bn.h:32:0,
                 from /home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:30:
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
 typedef struct bignum_st BIGNUM;
                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum()’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:74:21: error: ‘BN_init’ was not declared in this scope
         BN_init(this);
                     ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In copy constructor ‘CBigNum::CBigNum(const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:79:21: error: ‘BN_init’ was not declared in this scope
         BN_init(this);
                     ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:80:30: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘BIGNUM* BN_copy(BIGNUM*, const BIGNUM*)’
         if (!BN_copy(this, &b))
                              ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:82:31: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_clear_free(BIGNUM*)’
             BN_clear_free(this);
                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::operator=(const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:89:30: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘BIGNUM* BN_copy(BIGNUM*, const BIGNUM*)’
         if (!BN_copy(this, &b))
                              ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In destructor ‘CBigNum::~CBigNum()’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:96:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_clear_free(BIGNUM*)’
         BN_clear_free(this);
                           ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(signed char)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:100:47: error: ‘BN_init’ was not declared in this scope
     CBigNum(signed char n)      { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(short int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:101:47: error: ‘BN_init’ was not declared in this scope
     CBigNum(short n)            { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:102:47: error: ‘BN_init’ was not declared in this scope
     CBigNum(int n)              { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(int64_t)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:104:47: error: ‘BN_init’ was not declared in this scope
     CBigNum(int64_t n)          { BN_init(this); setint64(n); }
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(unsigned char)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:105:47: error: ‘BN_init’ was not declared in this scope
     CBigNum(unsigned char n)    { BN_init(this); setulong(n); }
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(short unsigned int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:106:47: error: ‘BN_init’ was not declared in this scope
     CBigNum(unsigned short n)   { BN_init(this); setulong(n); }
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(unsigned int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:107:47: error: ‘BN_init’ was not declared in this scope
     CBigNum(unsigned int n)     { BN_init(this); setulong(n); }
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(uint64_t)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:109:49: error: ‘BN_init’ was not declared in this scope
     CBigNum(uint64_t n)           { BN_init(this); setuint64(n); }
                                                 ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In constructor ‘CBigNum::CBigNum(const std::vector<unsigned char>&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:113:21: error: ‘BN_init’ was not declared in this scope
         BN_init(this);
                     ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘void CBigNum::setulong(long unsigned int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:119:33: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_set_word(BIGNUM*, long unsigned int)’
         if (!BN_set_word(this, n))
                                 ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘long unsigned int CBigNum::getulong() const’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:125:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
         return BN_get_word(this);
                                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘unsigned int CBigNum::getuint() const’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:130:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
         return BN_get_word(this);
                                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘int CBigNum::getint() const’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:135:43: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
         unsigned long n = BN_get_word(this);
                                           ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:136:33: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
         if (!BN_is_negative(this))
                                 ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘void CBigNum::setint64(int64_t)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:174:37: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(pch, p - pch, this);
                                     ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘void CBigNum::setuint64(uint64_t)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:201:37: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(pch, p - pch, this);
                                     ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘void CBigNum::setvch(const std::vector<unsigned char>&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:217:46: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(&vch2[0], vch2.size(), this);
                                              ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘std::vector<unsigned char> CBigNum::getvch() const’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:222:50: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         unsigned int nSize = BN_bn2mpi(this, NULL);
                                                  ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:226:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         BN_bn2mpi(this, &vch[0]);
                                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::SetCompact(unsigned int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:240:44: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
         BN_mpi2bn(&vch[0], vch.size(), this);
                                            ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘unsigned int CBigNum::GetCompact() const’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:246:50: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         unsigned int nSize = BN_bn2mpi(this, NULL);
                                                  ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:249:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
         BN_bn2mpi(this, &vch[0]);
                                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘std::__cxx11::string CBigNum::ToString(int) const’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:294:35: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_set_negative(BIGNUM*, int)’
         BN_set_negative(&bn, false);
                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:297:29: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
         if (BN_cmp(&bn, &bn0) == 0)
                             ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:299:32: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
         while (BN_cmp(&bn, &bn0) > 0)
                                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:301:54: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
             if (!BN_div(&dv, &rem, &bn, &bnBase, pctx))
                                                      ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:307:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
         if (BN_is_negative(this))
                                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘bool CBigNum::operator!() const’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:322:31: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_zero(const BIGNUM*)’
         return BN_is_zero(this);
                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::operator+=(const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:327:35: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)’
         if (!BN_add(this, this, &b))
                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::operator*=(const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:341:41: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_mul(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
         if (!BN_mul(this, this, &b, pctx))
                                         ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::operator<<=(unsigned int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:360:41: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_lshift(BIGNUM*, const BIGNUM*, int)’
         if (!BN_lshift(this, this, shift))
                                         ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::operator>>=(unsigned int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:371:28: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
         if (BN_cmp(&a, this) > 0)
                            ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:377:41: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_rshift(BIGNUM*, const BIGNUM*, int)’
         if (!BN_rshift(this, this, shift))
                                         ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::operator++()’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:386:47: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)’
         if (!BN_add(this, this, BN_value_one()))
                                               ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In member function ‘CBigNum& CBigNum::operator--()’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:403:45: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_sub(BIGNUM*, const BIGNUM*, const BIGNUM*)’
         if (!BN_sub(&r, this, BN_value_one()))
                                             ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘const CBigNum operator+(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:428:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)’
     if (!BN_add(&r, &a, &b))
                           ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘const CBigNum operator-(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:436:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_sub(BIGNUM*, const BIGNUM*, const BIGNUM*)’
     if (!BN_sub(&r, &a, &b))
                           ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘const CBigNum operator-(const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:444:43: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
     BN_set_negative(&r, !BN_is_negative(&r));
                                           ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘const CBigNum operator*(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:452:33: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_mul(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
     if (!BN_mul(&r, &a, &b, pctx))
                                 ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘const CBigNum operator/(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:461:39: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
     if (!BN_div(&r, NULL, &a, &b, pctx))
                                       ^
In file included from /home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:30:0:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘const CBigNum operator%(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:470:10: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘2’ to ‘int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
     if (!BN_mod(&r, &a, &b, pctx))
          ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘const CBigNum operator<<(const CBigNum&, unsigned int)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:478:33: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_lshift(BIGNUM*, const BIGNUM*, int)’
     if (!BN_lshift(&r, &a, shift))
                                 ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘bool operator==(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:490:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); }
                                                                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘bool operator!=(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:491:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); }
                                                                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘bool operator<=(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:492:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); }
                                                                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘bool operator>=(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:493:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
                                                                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘bool operator<(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:494:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator<(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) < 0); }
                                                                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘bool operator>(const CBigNum&, const CBigNum&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:495:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
 inline bool operator>(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) > 0); }
                                                                                   ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘std::__cxx11::string EncodeBase58(const unsigned char*, const unsigned char*)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:525:48: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
         if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
                                                ^
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp: In function ‘bool DecodeBase58(const char*, std::vector<unsigned char>&)’:
/home/xeroc/PeerPlays/peerplays-graphene/libraries/fc/src/crypto/base58.cpp:575:42: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_mul(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
         if (!BN_mul(&bn, &bn, &bn58, pctx))
                                          ^
make[2]: *** [libraries/fc/CMakeFiles/fc.dir/build.make:1287: libraries/fc/CMakeFiles/fc.dir/src/crypto/base58.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:138: libraries/fc/CMakeFiles/fc.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
@ghost
Copy link

ghost commented Jul 12, 2017

You can build on Ubuntu and use binaries on Archlinux (quick hack)

@pmconrad
Copy link
Contributor

Which openssl version?

@xeroc
Copy link
Member Author

xeroc commented Jul 12, 2017

$ pacman -Q openssl
openssl 1.1.0.f-1

@pmconrad
Copy link
Contributor

Should work with openssl 1.0.2.
Should also be fixed in fc of course.

@oxarbitrage
Copy link
Member

there is a commit by @nathanhourt about this here:
bitshares/bitshares-fc@fee06a4
reversed later by @vikramrajkumar with comment "Max compatible Boost version is not compatible with OpenSSL 1.1.0" here:
bitshares/bitshares-fc@a30647d

@vikramrajkumar
Copy link
Contributor

There are different fc patches in steem-fc and eos-fc that attempt to enable OpenSSL 1.1.x compatibility. However, when I tried to integrate them, I still ran into issues with Boost that I was not able to resolve. I believe eos-fc does not have the issue because it has stripped out some parts of fc that they don't need. I don't remember the details with steem-fc, it might be worth another shot looking at their patch(es) but I think they may also be stripping out some parts of fc soon.

I ended up just noting that BitShares requires an OpenSSL older than 1.1.0 (just like we require Boost 1.60 or older). I made notes about this in the README and the wiki https://github.com/bitshares/bitshares-core/wiki

@vikramrajkumar
Copy link
Contributor

Related: steemit/fc#18

@nathanielhourt
Copy link
Contributor

In eos, we stripped out all of fc's threading, fibering, and scheduling stuff which all required old boost, so eos-fc now supports current boost, and no longer supports fibers. It also supports current openssl. I don't remember exactly, but there might have been some conflicts between old boost and new openssl which would be why you can't update openssl without also updating boost.

The main issue for BTS is that it uses fc's fibers, so until it gives up those, it's in a bad way.

@xeroc
Copy link
Member Author

xeroc commented Oct 11, 2017

From
EOSIO/eos@a431618

  • remove BTS P2P code which depended on fc threads which depended on
    deprecated boost::context API

@pmconrad
Copy link
Contributor

Sounds interesting, but they have just excluded the p2p code from the build :-/

@xeroc
Copy link
Member Author

xeroc commented Oct 12, 2017

Well, I just wanted to note the results of my (poor) research and let everyone know that the p2p code is what makes us use boost <=1.60 .. and that when/if we fix this, we can also add nathans fix for the openssl-1.1 compatibility (bitshares/bitshares-fc@fee06a4)

@pmconrad
Copy link
Contributor

Yes, that is an important piece of information.

@ryanRfox
Copy link
Contributor

Ubuntu 18.04 LTS defaults to OpenSSL 1.1.0g

@abitmore abitmore added feature and removed build About build process help wanted labels May 21, 2018
@abitmore abitmore added this to the 201807 - Next Non-Consensus-Changing Release milestone May 21, 2018
@abitmore abitmore removed the feature label May 25, 2018
@jmjatlanta
Copy link
Contributor

jmjatlanta commented Jun 1, 2018

I believe this ticket has been fixed by merging in the fc changes for OpenSSL 1.1. Hence, compiling the lastest bitshares-core/develop branch should compile fine with OpenSSL versions 1.0 or 1.1.

See #921

I have tested this on Ubuntu 16.04//Boost 1.63// OpenSSL 1.0.2g as well as their branch openssl-1.1-stable. No compilation errors were encountered.

I'll leave this ticket open for a while to see if anyone thinks there is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2h Accepted Status indicating the solution passed final review, and is ready for implementation compatibility
Projects
None yet
Development

No branches or pull requests

8 participants