rschm2> Hello,
rschm2> I am attempting to add a new cipher into the crypto library. I have
rschm2> done the following so far?
rschm2> 1. Added my code to the openssl/crypto folder
rschm2> 2. Created a<> for make to compile my code 
(created this
rschm2> based off of openssl/crypto/dh?s<>)
rschm2> 3. Added my cipher name to the list of ciphers to compile in Configure
rschm2> 4. Compiled and installed all code without errors and object files for
rschm2> my new cipher are created in openssl/crypto/mycipher/
rschm2> 5. Created a test.c file that verifies that the library is installed
rschm2> and working properly by generating a MD5 hash of a string
rschm2> Compiled as:
rschm2> gcc test.c -I/usr/local/openssl/include/openssl/ -o test -lcrypto -
rschm2> lssl -Wall
rschm2> 6. I am able to properly include <openssl/mycipher.h> in my test.c
rschm2> file
rschm2> However, as soon as I make a call to my cipher in test.c I get a
rschm2> linker error and gcc is unable to find any of my functions.
rschm2> It seems that the header file I have in the openssl/include folder
rschm2> isn?t being linked somehow to my code in the openssl/cypto folder.
rschm2> I feel like I?m missing a step here?
rschm2> Any help is much appreciated!

levitte>On way is to, as already mentioned, edit util/libcrypto.num.  The
levitte>other is to edit util/ and then run 'make update'.  In
levitte>, you'll find a bunch of lines like this:

levitte>   $crypto.="include/openssl/whatever.h"

levitte>Simply add a line like that for mycipher.h.

levitte>(note: might be a bit picky sometimes)


levitte>Richard Levitte<>
levitte>OpenSSL Project


I would just like to thank Richard Levitte and Viktor for their help as I was 
finally able to figure it out. In case anyone else would like this same process 
I have included some general documentation below:

1) git clone openssl project
2) edit util/<http://util/> for <openssl/mycipher.h> header 
file (header file must be extern and have (void) in function declaration if no 
arguments are being passed)
3) edit Configure (line 313ish) and add in crypto function amongst others
4) create<> under /crypto/mycipher/ (follow other 
crypto<>’s to create)
5) ./config
6) make update
7) make -j <thread count>


On Dec 31, 2016, at 5:52 PM,<> wrote:

Re: Linker error when adding new cipher in crypto folder

openssl-dev mailing list
To unsubscribe:

Reply via email to