27 |
|
#include <openssl/pem.h> |
28 |
|
#include <openssl/rand.h> |
29 |
|
#include <openssl/rsa.h> |
30 |
– |
#include <openssl/md5.h> |
30 |
|
#include <openssl/bn.h> |
31 |
|
#include <openssl/evp.h> |
32 |
|
#include <openssl/err.h> |
98 |
|
return -1; |
99 |
|
} |
100 |
|
|
101 |
< |
/* |
103 |
< |
* jdc -- Let's do this a little differently. According to the |
104 |
< |
* OpenSSL documentation, you need to METHOD_free(key) before |
105 |
< |
* assigning it. Don't believe me? Check out the following |
106 |
< |
* URL: http://www.openssl.org/docs/crypto/pem.html#BUGS |
107 |
< |
* P.S. -- I have no idea why the key= assignment has to be typecasted. |
108 |
< |
* For some reason the system thinks PEM_read_bio_RSAPrivateKey |
109 |
< |
* is returning an int, not a RSA *. |
110 |
< |
* androsyn -- Thats because you didn't have a prototype and including |
111 |
< |
* pem.h breaks things for some reason.. |
112 |
< |
*/ |
113 |
< |
key = (RSA *) PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL); |
101 |
> |
key = PEM_read_bio_RSAPrivateKey(file, NULL, 0, NULL); |
102 |
|
|
103 |
|
if (key == NULL) |
104 |
|
{ |