-
Notifications
You must be signed in to change notification settings - Fork 229
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
Compilation error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’ #129
Comments
The problem appears to be fixed by this patch: diff --git a/crypto/rsa_pem_openssl.c b/crypto/rsa_pem_openssl.c index db653f2..49a9e3f 100644 --- a/crypto/rsa_pem_openssl.c +++ b/crypto/rsa_pem_openssl.c @@ -36,18 +36,28 @@ TGLC_WRAPPER_ASSOC(rsa,RSA) // TODO: Refactor crucial struct-identity into its own header. TGLC_WRAPPER_ASSOC(bn,BIGNUM) +/* + * Note: Since OpenSSL version 1.1.0-pre5 the RSA struct (rsa_st) is opaque, + * see https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes + */ TGLC_rsa *TGLC_rsa_new (unsigned long e, int n_bytes, const unsigned char *n) { RSA *ret = RSA_new (); - ret->e = unwrap_bn (TGLC_bn_new ()); - TGLC_bn_set_word (wrap_bn (ret->e), e); - ret->n = unwrap_bn (TGLC_bn_bin2bn (n, n_bytes, NULL)); + BIGNUM *ret_e = unwrap_bn (TGLC_bn_new ()); + BIGNUM *ret_n = unwrap_bn (TGLC_bn_bin2bn (n, n_bytes, NULL)); + RSA_set0_key (ret, ret_n, ret_e, NULL); + TGLC_bn_set_word (wrap_bn (ret_e), e); return wrap_rsa (ret); } -#define RSA_GETTER(M) \ - TGLC_bn *TGLC_rsa_ ## M (TGLC_rsa *key) { \ - return wrap_bn (unwrap_rsa (key)->M); \ - } \ +#define RSA_GETTER(M) \ +TGLC_bn *TGLC_rsa_ ## M (TGLC_rsa *key) { \ + BIGNUM *rsa_n, *rsa_e, *rsa_d; \ + RSA_get0_key(unwrap_rsa (key), \ + (const BIGNUM **) &rsa_n, \ + (const BIGNUM **) &rsa_e, \ + (const BIGNUM **) &rsa_d); \ + return wrap_bn (rsa_ ## M); \ +} RSA_GETTER(n); RSA_GETTER(e); |
Implemented support for opaque structs (since OpenSSL version 1.1.0). Compilation tested successfully with libssl-dev versions 1.0.2k and 1.1.0e.
Thx. patch fixed the make error for me. |
…ing patch from this page vysheng#129
Hey Guys, After searching the web and a lot of trial and error, I found this fix. Big thanks in advance and hats off to you programmer guys! |
The compilation with the patch fails during make with the following error:
|
@cskowronnek: I can't reproduce your problem. Since the above patch is confirmed working by various people, I suspect, you didn't apply it properly. If you wish assistance, please provide:
|
sorry for the question but I'm new on unix, how can I apply the patch and on what? thanks |
thank you very much for the answer, I change the file rsa_perm_openssl.c but the make doesn't work, |
Add extra-patch to fix build on 12.0-CURRENT after updating OpenSSL to version 1.1.1 See vysheng/tgl#129 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@482679 35697150-7ecd-e111-bb59-0022644237b5
Add extra-patch to fix build on 12.0-CURRENT after updating OpenSSL to version 1.1.1 See vysheng/tgl#129
Add extra-patch to fix build on 12.0-CURRENT after updating OpenSSL to version 1.1.1 See vysheng/tgl#129 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@482679 35697150-7ecd-e111-bb59-0022644237b5
Add extra-patch to fix build on 12.0-CURRENT after updating OpenSSL to version 1.1.1 See vysheng/tgl#129 git-svn-id: svn+ssh://svn.freebsd.org/ports/head@482679 35697150-7ecd-e111-bb59-0022644237b5
net-im/telegram: Unbreak build on 12.0-CURRENT Add extra-patch to fix build on 12.0-CURRENT after updating OpenSSL to version 1.1.1 See vysheng/tgl#129
…RSA {aka struct rsa_st}’ vysheng#129
I'm having a similar if slightly different problem when I try to configure and make telegram on my pi. tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_new’: |
net-im/telegram: Unbreak build on 12.0-CURRENT Add extra-patch to fix build on 12.0-CURRENT after updating OpenSSL to version 1.1.1 See vysheng/tgl#129
Sorry, the previously reported issue vysheng/tg#1338 is actually located in this repository.
The problem was:
I was trying to compile vysheng/tg@6547c0b,
but got the following error:
Cheers, Matthias
The text was updated successfully, but these errors were encountered: