On Sun, Sep 7, 2014 at 7:52 AM, Amir Reda <amirale...@gmail.com> wrote:
> dear all
> i'm trying to generate rsa keypair to be used in a class that has an
> attribute
>    RSA        *rsa_keyPair;
> and i use function
>  RSA
>  AeroRoutingProtocol :: GenerateRSAKeyPair ( )
>  {
>      rsa_keyPair = RSA_generate_key(2084,RSA_F4,NULL,NULL);
>      return rsa_keyPair;
>   }
>
> when i try to compile this code i got this error
>
> In member function ‘RSA
> ns3::AeroRP::AeroRoutingProtocol::GenerateRSAKeyPair()’:
> ../src/aerorp/model/aerorp-routing-protocol.cc:1322:13: error: could not
> convert
> ‘((ns3::AeroRP::AeroRoutingProtocol*)this)->ns3::AeroRP::AeroRoutingProtocol::rsa_keyPair’
> from ‘RSA* {aka rsa_st*}’ to ‘RSA {aka rsa_st}’
> ../src/aerorp/model/aerorp-routing-protocol.cc:1323:3: error: control
> reaches end of non-void function [-Werror=return-type]
> cc1plus: all warnings being treated as errors
>

Return a pointer:

 RSA*
 AeroRoutingProtocol :: GenerateRSAKeyPair ( )
 {
     rsa_keyPair = RSA_generate_key(2084,RSA_F4,NULL,NULL);
     return rsa_keyPair;
  }
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to