Openssl build was successful with no errors. I get this error when i try to run gcc ../heartleech/heartleech.c libssl.a libcrypto.a -ldl -lpthread -o heartleech -I./include
root@kali:~/openssl# gcc ../heartleech/heartleech.c libssl.a libcrypto.a -ldl -lpthread -o heartleech -I./include
../heartleech/heartleech.c:111:2: error: #error You are using the wrong version of OpenSSL headers.
#error You are using the wrong version of OpenSSL headers.
^
../heartleech/heartleech.c:263:12: error: field ‘n’ has incomplete type
BIGNUM n;
^
../heartleech/heartleech.c:264:12: error: field ‘e’ has incomplete type
BIGNUM e;
^
../heartleech/heartleech.c: In function ‘receive_heartbeat’:
../heartleech/heartleech.c:562:10: error: ‘TLS1_RT_HEARTBEAT’ undeclared (first use in this function)
case TLS1_RT_HEARTBEAT:
^
../heartleech/heartleech.c:562:10: note: each undeclared identifier is reported only once for each function it appears in
../heartleech/heartleech.c: In function ‘rsa_gen’:
../heartleech/heartleech.c:762:12: error: array type has incomplete element type
BIGNUM p1[1], q1[1], r[1];
^
../heartleech/heartleech.c:762:19: error: array type has incomplete element type
BIGNUM p1[1], q1[1], r[1];
^
../heartleech/heartleech.c:762:26: error: array type has incomplete element type
BIGNUM p1[1], q1[1], r[1];
^
../heartleech/heartleech.c:768:8: error: dereferencing pointer to incomplete type
rsa->p = BN_new();
^
../heartleech/heartleech.c:769:16: error: dereferencing pointer to incomplete type
BN_copy(rsa->p, p);
^
../heartleech/heartleech.c:770:8: error: dereferencing pointer to incomplete type
rsa->q = BN_new();
^
../heartleech/heartleech.c:771:16: error: dereferencing pointer to incomplete type
BN_copy(rsa->q, q);
^
../heartleech/heartleech.c:772:8: error: dereferencing pointer to incomplete type
rsa->e = BN_new();
^
../heartleech/heartleech.c:773:16: error: dereferencing pointer to incomplete type
BN_copy(rsa->e, e);
^
../heartleech/heartleech.c:779:8: error: dereferencing pointer to incomplete type
rsa->n = BN_new();
^
../heartleech/heartleech.c:780:15: error: dereferencing pointer to incomplete type
BN_mul(rsa->n, rsa->p, rsa->q, ctx);
^
../heartleech/heartleech.c:780:23: error: dereferencing pointer to incomplete type
BN_mul(rsa->n, rsa->p, rsa->q, ctx);
^
../heartleech/heartleech.c:780:31: error: dereferencing pointer to incomplete type
BN_mul(rsa->n, rsa->p, rsa->q, ctx);
^
../heartleech/heartleech.c:785:8: error: dereferencing pointer to incomplete type
rsa->d = BN_new();
^
../heartleech/heartleech.c:786:19: error: dereferencing pointer to incomplete type
BN_sub(p1, rsa->p, BN_value_one());
^
../heartleech/heartleech.c:787:19: error: dereferencing pointer to incomplete type
BN_sub(q1, rsa->q, BN_value_one());
^
../heartleech/heartleech.c:789:23: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->d, rsa->e, r, ctx);
^
../heartleech/heartleech.c:789:31: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->d, rsa->e, r, ctx);
^
../heartleech/heartleech.c:792:8: error: dereferencing pointer to incomplete type
rsa->dmp1 = BN_new();
^
In file included from ./include/openssl/asn1.h:72:0,
from ./include/openssl/objects.h:964,
from ./include/openssl/evp.h:75,
from ./include/openssl/x509.h:70,
from ./include/openssl/ssl.h:150,
from ../heartleech/heartleech.c:98:
../heartleech/heartleech.c:793:15: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmp1, rsa->d, p1, ctx);
^
./include/openssl/bn.h:297:43: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:793:26: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmp1, rsa->d, p1, ctx);
^
./include/openssl/bn.h:297:49: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:796:8: error: dereferencing pointer to incomplete type
rsa->dmq1 = BN_new();
^
In file included from ./include/openssl/asn1.h:72:0,
from ./include/openssl/objects.h:964,
from ./include/openssl/evp.h:75,
from ./include/openssl/x509.h:70,
from ./include/openssl/ssl.h:150,
from ../heartleech/heartleech.c:98:
../heartleech/heartleech.c:797:15: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmq1, rsa->d, q1, ctx);
^
./include/openssl/bn.h:297:43: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:797:26: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmq1, rsa->d, q1, ctx);
^
./include/openssl/bn.h:297:49: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:800:8: error: dereferencing pointer to incomplete type
rsa->iqmp = BN_new();
^
../heartleech/heartleech.c:801:23: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx);
^
../heartleech/heartleech.c:801:34: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx);
^
../heartleech/heartleech.c:801:42: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx);
^
../heartleech/heartleech.c: At top level:
../heartleech/heartleech.c:819:31: error: parameter 1 (‘n’) has incomplete type
find_private_key(const BIGNUM n, const BIGNUM e,
^
../heartleech/heartleech.c:819:47: error: parameter 2 (‘e’) has incomplete type
find_private_key(const BIGNUM n, const BIGNUM e,
^
../heartleech/heartleech.c: In function ‘find_private_key’:
../heartleech/heartleech.c:825:12: error: storage size of ‘p’ isn’t known
BIGNUM p;
^
../heartleech/heartleech.c:826:12: error: storage size of ‘q’ isn’t known
BIGNUM q;
^
../heartleech/heartleech.c:827:12: error: storage size of ‘remainder’ isn’t known
BIGNUM remainder;
^
../heartleech/heartleech.c: At top level:
../heartleech/heartleech.c:906:22: error: parameter 4 (‘n’) has incomplete type
BIGNUM n, BIGNUM e)
^
../heartleech/heartleech.c:906:32: error: parameter 5 (‘e’) has incomplete type
BIGNUM n, BIGNUM e)
^
../heartleech/heartleech.c: In function ‘parse_cert’:
../heartleech/heartleech.c:973:25: error: dereferencing pointer to incomplete type
if (rsakey && rsakey->type == 6) {
^
../heartleech/heartleech.c:974:27: error: dereferencing pointer to incomplete type
BIGNUM _n = rsakey->pkey.rsa->n;
^
../heartleech/heartleech.c:975:35: error: dereferencing pointer to incomplete type
memcpy(modulus, n, sizeof(_modulus));
^
../heartleech/heartleech.c:976:25: error: dereferencing pointer to incomplete type
memcpy(e, rsakey->pkey.rsa->e, sizeof(_e));
^
../heartleech/heartleech.c:976:47: error: dereferencing pointer to incomplete type
memcpy(e, rsakey->pkey.rsa->e, sizeof(_e));
^
../heartleech/heartleech.c:978:38: error: dereferencing pointer to incomplete type
n->top * sizeof(BN_ULONG) * 8);
^
../heartleech/heartleech.c: In function ‘ssl_thread’:
../heartleech/heartleech.c:2057:12: error: dereferencing pointer to incomplete type
if (ssl->tlsext_heartbeat != 1) {
^
../heartleech/heartleech.c:2154:31: error: ‘TLS1_RT_HEARTBEAT’ undeclared (first use in this function)
ssl3_write_bytes(ssl, TLS1_RT_HEARTBEAT,
^
../heartleech/heartleech.c: In function ‘process_offline_file’:
../heartleech/heartleech.c:2344:12: error: storage size of ‘n’ isn’t known
BIGNUM n;
^
../heartleech/heartleech.c:2345:12: error: storage size of ‘e’ isn’t known
BIGNUM e;
Openssl build was successful with no errors. I get this error when i try to run gcc ../heartleech/heartleech.c libssl.a libcrypto.a -ldl -lpthread -o heartleech -I./include
root@kali:~/openssl# gcc ../heartleech/heartleech.c libssl.a libcrypto.a -ldl -lpthread -o heartleech -I./include
../heartleech/heartleech.c:111:2: error: #error You are using the wrong version of OpenSSL headers.
#error You are using the wrong version of OpenSSL headers.
^
../heartleech/heartleech.c:263:12: error: field ‘n’ has incomplete type
BIGNUM n;
^
../heartleech/heartleech.c:264:12: error: field ‘e’ has incomplete type
BIGNUM e;
^
../heartleech/heartleech.c: In function ‘receive_heartbeat’:
../heartleech/heartleech.c:562:10: error: ‘TLS1_RT_HEARTBEAT’ undeclared (first use in this function)
case TLS1_RT_HEARTBEAT:
^
../heartleech/heartleech.c:562:10: note: each undeclared identifier is reported only once for each function it appears in
../heartleech/heartleech.c: In function ‘rsa_gen’:
../heartleech/heartleech.c:762:12: error: array type has incomplete element type
BIGNUM p1[1], q1[1], r[1];
^
../heartleech/heartleech.c:762:19: error: array type has incomplete element type
BIGNUM p1[1], q1[1], r[1];
^
../heartleech/heartleech.c:762:26: error: array type has incomplete element type
BIGNUM p1[1], q1[1], r[1];
^
../heartleech/heartleech.c:768:8: error: dereferencing pointer to incomplete type
rsa->p = BN_new();
^
../heartleech/heartleech.c:769:16: error: dereferencing pointer to incomplete type
BN_copy(rsa->p, p);
^
../heartleech/heartleech.c:770:8: error: dereferencing pointer to incomplete type
rsa->q = BN_new();
^
../heartleech/heartleech.c:771:16: error: dereferencing pointer to incomplete type
BN_copy(rsa->q, q);
^
../heartleech/heartleech.c:772:8: error: dereferencing pointer to incomplete type
rsa->e = BN_new();
^
../heartleech/heartleech.c:773:16: error: dereferencing pointer to incomplete type
BN_copy(rsa->e, e);
^
../heartleech/heartleech.c:779:8: error: dereferencing pointer to incomplete type
rsa->n = BN_new();
^
../heartleech/heartleech.c:780:15: error: dereferencing pointer to incomplete type
BN_mul(rsa->n, rsa->p, rsa->q, ctx);
^
../heartleech/heartleech.c:780:23: error: dereferencing pointer to incomplete type
BN_mul(rsa->n, rsa->p, rsa->q, ctx);
^
../heartleech/heartleech.c:780:31: error: dereferencing pointer to incomplete type
BN_mul(rsa->n, rsa->p, rsa->q, ctx);
^
../heartleech/heartleech.c:785:8: error: dereferencing pointer to incomplete type
rsa->d = BN_new();
^
../heartleech/heartleech.c:786:19: error: dereferencing pointer to incomplete type
BN_sub(p1, rsa->p, BN_value_one());
^
../heartleech/heartleech.c:787:19: error: dereferencing pointer to incomplete type
BN_sub(q1, rsa->q, BN_value_one());
^
../heartleech/heartleech.c:789:23: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->d, rsa->e, r, ctx);
^
../heartleech/heartleech.c:789:31: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->d, rsa->e, r, ctx);
^
../heartleech/heartleech.c:792:8: error: dereferencing pointer to incomplete type
rsa->dmp1 = BN_new();
^
In file included from ./include/openssl/asn1.h:72:0,
from ./include/openssl/objects.h:964,
from ./include/openssl/evp.h:75,
from ./include/openssl/x509.h:70,
from ./include/openssl/ssl.h:150,
from ../heartleech/heartleech.c:98:
../heartleech/heartleech.c:793:15: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmp1, rsa->d, p1, ctx);
^
./include/openssl/bn.h:297:43: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:793:26: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmp1, rsa->d, p1, ctx);
^
./include/openssl/bn.h:297:49: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:796:8: error: dereferencing pointer to incomplete type
rsa->dmq1 = BN_new();
^
In file included from ./include/openssl/asn1.h:72:0,
from ./include/openssl/objects.h:964,
from ./include/openssl/evp.h:75,
from ./include/openssl/x509.h:70,
from ./include/openssl/ssl.h:150,
from ../heartleech/heartleech.c:98:
../heartleech/heartleech.c:797:15: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmq1, rsa->d, q1, ctx);
^
./include/openssl/bn.h:297:43: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:797:26: error: dereferencing pointer to incomplete type
BN_mod(rsa->dmq1, rsa->d, q1, ctx);
^
./include/openssl/bn.h:297:49: note: in definition of macro ‘BN_mod’
define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
../heartleech/heartleech.c:800:8: error: dereferencing pointer to incomplete type
rsa->iqmp = BN_new();
^
../heartleech/heartleech.c:801:23: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx);
^
../heartleech/heartleech.c:801:34: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx);
^
../heartleech/heartleech.c:801:42: error: dereferencing pointer to incomplete type
BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx);
^
../heartleech/heartleech.c: At top level:
../heartleech/heartleech.c:819:31: error: parameter 1 (‘n’) has incomplete type
find_private_key(const BIGNUM n, const BIGNUM e,
^
../heartleech/heartleech.c:819:47: error: parameter 2 (‘e’) has incomplete type
find_private_key(const BIGNUM n, const BIGNUM e,
^
../heartleech/heartleech.c: In function ‘find_private_key’:
../heartleech/heartleech.c:825:12: error: storage size of ‘p’ isn’t known
BIGNUM p;
^
../heartleech/heartleech.c:826:12: error: storage size of ‘q’ isn’t known
BIGNUM q;
^
../heartleech/heartleech.c:827:12: error: storage size of ‘remainder’ isn’t known
BIGNUM remainder;
^
../heartleech/heartleech.c: At top level:
../heartleech/heartleech.c:906:22: error: parameter 4 (‘n’) has incomplete type
BIGNUM n, BIGNUM e)
^
../heartleech/heartleech.c:906:32: error: parameter 5 (‘e’) has incomplete type
BIGNUM n, BIGNUM e)
^
../heartleech/heartleech.c: In function ‘parse_cert’:
../heartleech/heartleech.c:973:25: error: dereferencing pointer to incomplete type
if (rsakey && rsakey->type == 6) {
^
../heartleech/heartleech.c:974:27: error: dereferencing pointer to incomplete type
BIGNUM _n = rsakey->pkey.rsa->n;
^
../heartleech/heartleech.c:975:35: error: dereferencing pointer to incomplete type
memcpy(modulus, n, sizeof(_modulus));
^
../heartleech/heartleech.c:976:25: error: dereferencing pointer to incomplete type
memcpy(e, rsakey->pkey.rsa->e, sizeof(_e));
^
../heartleech/heartleech.c:976:47: error: dereferencing pointer to incomplete type
memcpy(e, rsakey->pkey.rsa->e, sizeof(_e));
^
../heartleech/heartleech.c:978:38: error: dereferencing pointer to incomplete type
n->top * sizeof(BN_ULONG) * 8);
^
../heartleech/heartleech.c: In function ‘ssl_thread’:
../heartleech/heartleech.c:2057:12: error: dereferencing pointer to incomplete type
if (ssl->tlsext_heartbeat != 1) {
^
../heartleech/heartleech.c:2154:31: error: ‘TLS1_RT_HEARTBEAT’ undeclared (first use in this function)
ssl3_write_bytes(ssl, TLS1_RT_HEARTBEAT,
^
../heartleech/heartleech.c: In function ‘process_offline_file’:
../heartleech/heartleech.c:2344:12: error: storage size of ‘n’ isn’t known
BIGNUM n;
^
../heartleech/heartleech.c:2345:12: error: storage size of ‘e’ isn’t known
BIGNUM e;