> From: owner-openssl-us...@openssl.org On Behalf Of Leonardo Laface de
Almeida
> Sent: Monday, 15 October, 2012 15:14

> I was following the main function in genpkey.c file and 
> following the same
> sequence for generating key pair. I've got some executing 
> erros that took me
> some hours to get it. I still have the problem and I think it 
> might be some
> errors in openssl libs.
> 
> In fact, I'm developing a library (*.dll and *.so) that make 
> SSL connectios [and other crypto] 

Does your library dynamically-link the openssl libs,
or statically embed them (while being dynamic itself)? 

> Because the App can't load the library with the following 
> lines on dll code:
> 
> 1. EVP_PKEY_CTX *ctx;
> 2. EVP_PKEY *pkey = NULL;
> 3. ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);  
> 
> If the third line is commented, then the library is loaded 
> and everything
> works.
> 
If you are dynamic-linking openssl libs (as well as your lib), 
are you sure when your app runs it is finding the correct ones? 
Could there be an older version of openssl in your search path?
The EVP_PKEY_CTX_* routines were new in 1.0.0. If you are 
finding a version older than that, they will be missing.

For Windows note that the DLL search rules have changed 
several times over the last year or so as Microsoft puts out 
more and more security patches for "DLL planting" attacks.

> Instead this three lines, with the next two lines the App can 
> also load the dll and it works:
> 
> 4. RSA *rsa;
> 5. rsa = RSA_new_method(NULL);
> 
> Therefore, I'm developing using RSA_* functions now, and I 
> think it will work just fine. 
> 
Probably.

> It seems to be an error with some pointer from EVP_* 
> functions. Any EVP_*
> function called causes this error.
> 
Sounds like reference *to*, not pointer *from*. If the app/lib 
doesn't load, these function calls never get executed. 

All EVP_* or only all EVP_PKEY_CTX_* ? Most other parts of EVP_ 
are quite a bit older, although there have been minor changes.

> Anyway, as you said the EVC functions where recent development effort
> foccus, I think this may be some error in openssl lib. I also 
> think it might
> be openssl version problem or some cross-compiling error.
> 
It sounds like it well could be a version problem. 
How is cross-compiling involved?

> In any case, if it's possible I'm not importing or compiling 
> the openssl
> libs properly, please let me know. Maibe some directive 
> before compiling
> openssl, e.g. 
> I'm using Openssl version 1.0.1c
> 
You're compiling openssl yourself? Are you installing it 
in the system directory(s), or using in your own dir(s)?
If the latter, is there any openssl in the system dir(s)? 

The specific system directory(s) depend on your OS, 
and possibly build options. You imply you are doing at least 
Windows plus some Unix, which are different; if you do more 
than one Unix, those may also be different.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to