Error: “invalid use of incomplete type ‘RSA {aka struct rsa_st}” in OpenSSL 1.1.0

前端 未结 3 2001
一向
一向 2020-11-29 11:24

I have old code that was written to link against an old version of openssl. Part of this code loads a key from a PEM file, and tries to understand whether this key is a priv

3条回答
  •  旧巷少年郎
    2020-11-29 12:21

    After 1.1.1 OpenSSL Supports getter what return each parameter like this.

    const BIGNUM *RSA_get0_n(const RSA *d);
    const BIGNUM *RSA_get0_e(const RSA *d);
    const BIGNUM *RSA_get0_d(const RSA *d);
    const BIGNUM *RSA_get0_p(const RSA *d);
    const BIGNUM *RSA_get0_q(const RSA *d);
    const BIGNUM *RSA_get0_dmp1(const RSA *r);
    const BIGNUM *RSA_get0_dmq1(const RSA *r);
    const BIGNUM *RSA_get0_iqmp(const RSA *r);
    

    So if you don't need to considerate below version of OpenSSL less than 1.1.1 these code will make simple code. AND other structures support kind of this getter too. You can find more information of functions this. https://www.openssl.org/docs/man1.1.1/man3/

提交回复
热议问题