I'm using libcrypto.a (OpenSSL) with a project. By default all the algorithms are available under libcrypto.a. For the project i just need RSA, AES and SHA.
How I can build libcrypto.a with just those algorithms?
I'm using libcrypto.a (OpenSSL) with a project. By default all the algorithms are available under libcrypto.a. For the project i just need RSA, AES and SHA.
How I can build libcrypto.a with just those algorithms?
If you build OpenSSL by running the
config
orConfigure
script, you provideno-<cipher>
as an argument to exclude the cipher. RunConfigure
with no options to see the available build options.The configuration script converts these arguments into options for the preprocessor. Here's a list of nearly everything you can disable at compile time. First is the configuration-script argument, and then the compiler argument it gets converted to.
Note that some things have dependencies. For example, you cannot build the SSL library without ciphers and digest algorithms because the SSL and TLS protocols demand them. So instead of doing
make all
, you want to domake build_crypto
so that it only builds libcrypto.a.Through experimentation, I found (in OpenSSL 0.9.8r) that libcrypto has 2 algorithm dependencies: MD5 for the random-number generator's algorithm (in crypto/rand_lib.c) and SHA-1 for printing certificate hashes (in crypto/asn1/t_x509.c). I'd say these dependencies are oversights by the developers.
This is how I build libcrypto.a with only MD5 and SHA:
I also successfully built it with everything except AES, RSA, SHA, and MD5 as the question asked.