Shallot icon indicating copy to clipboard operation
Shallot copied to clipboard

Shallot can not build against current OpenSSL

Open IngwiePhoenix opened this issue 4 years ago • 1 comments

...partially due to deprecation and moving of APIs or outright removal of such.

You think this is fixable or should I just see to find an alternative?

cc  -O3 -I/usr/include -I/usr/local/include -L/usr/lib -L/usr/local/lib  -Wall -o src/math.o -c src/math.c
clang: warning: argument unused during compilation: '-L/usr/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument]
src/math.c:30:11: warning: 'RSA_generate_key' is deprecated [-Wdeprecated-declarations]
    rsa = RSA_generate_key(num, 3, NULL, NULL);
          ^
/usr/include/openssl/rsa.h:234:1: note: 'RSA_generate_key' has been explicitly marked deprecated here
DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
^
/usr/include/x86_64-linux-gnu/openssl/opensslconf.h:164:34: note: expanded from macro 'DEPRECATEDIN_0_9_8'
# define DEPRECATEDIN_0_9_8(f)   DECLARE_DEPRECATED(f)
                                 ^
/usr/include/x86_64-linux-gnu/openssl/opensslconf.h:115:55: note: expanded from macro 'DECLARE_DEPRECATED'
#   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                                      ^
src/math.c:67:17: error: incomplete definition of type 'struct rsa_st'
  BN_sub(p1, rsa->p, BN_value_one()); // p - 1
             ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:68:17: error: incomplete definition of type 'struct rsa_st'
  BN_sub(q1, rsa->q, BN_value_one()); // q - 1
             ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:72:26: error: incomplete definition of type 'struct rsa_st'
  BN_gcd(chk, lambda, rsa->e, ctx); // check if e is coprime to lambda(n)
                      ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:77:18: error: incomplete definition of type 'struct rsa_st'
  BN_sub(chk, rsa->e, rsa->n); // subtract n from e to avoid checking BN_is_zero
              ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:77:26: error: incomplete definition of type 'struct rsa_st'
  BN_sub(chk, rsa->e, rsa->n); // subtract n from e to avoid checking BN_is_zero
                      ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:78:10: error: incomplete definition of type 'struct bignum_st'
  if(!chk->neg)
      ~~~^
/usr/include/openssl/ossl_typ.h:80:16: note: forward declaration of 'struct bignum_st'
typedef struct bignum_st BIGNUM;
               ^
src/math.c:81:21: error: incomplete definition of type 'struct rsa_st'
  BN_mod_inverse(rsa->d, rsa->e, lambda, ctx);    // d
                 ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:81:29: error: incomplete definition of type 'struct rsa_st'
  BN_mod_inverse(rsa->d, rsa->e, lambda, ctx);    // d
                         ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:82:13: error: incomplete definition of type 'struct rsa_st'
  BN_mod(rsa->dmp1, rsa->d, p1, ctx);             // d mod (p - 1)
         ~~~^
/usr/include/openssl/bn.h:247:43: note: expanded from macro 'BN_mod'
# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
                                          ^~~
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:82:24: error: incomplete definition of type 'struct rsa_st'
  BN_mod(rsa->dmp1, rsa->d, p1, ctx);             // d mod (p - 1)
                    ~~~^
/usr/include/openssl/bn.h:247:49: note: expanded from macro 'BN_mod'
# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
                                                ^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:83:13: error: incomplete definition of type 'struct rsa_st'
  BN_mod(rsa->dmq1, rsa->d, q1, ctx);             // d mod (q - 1)
         ~~~^
/usr/include/openssl/bn.h:247:43: note: expanded from macro 'BN_mod'
# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
                                          ^~~
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:83:24: error: incomplete definition of type 'struct rsa_st'
  BN_mod(rsa->dmq1, rsa->d, q1, ctx);             // d mod (q - 1)
                    ~~~^
/usr/include/openssl/bn.h:247:49: note: expanded from macro 'BN_mod'
# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
                                                ^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:84:21: error: incomplete definition of type 'struct rsa_st'
  BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx); // q ^ -1 mod p
                 ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:84:32: error: incomplete definition of type 'struct rsa_st'
  BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx); // q ^ -1 mod p
                            ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
src/math.c:84:40: error: incomplete definition of type 'struct rsa_st'
  BN_mod_inverse(rsa->iqmp, rsa->q, rsa->p, ctx); // q ^ -1 mod p
                                    ~~~^
/usr/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
               ^
1 warning and 15 errors generated.
make: *** [Makefile:44: src/math.o] Error 1

IngwiePhoenix avatar Nov 14 '21 17:11 IngwiePhoenix

If you are using OpenSSL 1.1.0 (or newer I guess) check out this PR https://github.com/katmagic/Shallot/pull/37 (or https://github.com/katmagic/Shallot/pull/44 including https://github.com/katmagic/Shallot/pull/37 and other fixes). Anyways I would suggest you to use a more up to date "key finder" like Scallion since this project, or at least this repo, is kind of dead. And you might want to use your GPU to do the key finding. If you want to tinker around a little bit this project is totally fine.

jroeger23 avatar Nov 14 '21 18:11 jroeger23