PDA

View Full Version : how to add new crypto algorithm inside the kernel


solomonml
October 21st, 2010, 09:19
Hi all,

I am using FreeBSD 7.2. I am trying to add one new encryption algorithm to the crypto library of IPsec. I added the .h and .c files of my new algorithm to opencrypto directory. I also modified the xform.h and xform.c of opencrypto to suite my needs. Finally I buildt the kernel.

My .c file is not compiled. I thought every .c file inside opencrypto will be compiled by default. But, this is not the case and there are undefined reference errors. I tried to see the makefile in /sys/ directory but I cant figure it out.

Please tell me where can I add some lines so that my .c file will be compiled and linked properly.

Thanx in advance
Solomon

richardpl
October 21st, 2010, 10:38
Hmm, if I'm not wrong crypto stuff is built as module so you will need to modify /sys/modules/* stuff.

For building inside kernel, look into /sys/conf/files.*

solomonml
October 24th, 2010, 16:55
Thanks richardpl.

I modified the /sys/conf/ files and the build and installation process completed successfully. But, when I try to add some IPsec security associations manually, there is "invalid argument" error. May be it's the reason since I didn't modify /sys/modules/*. I will try to modify and I will post my findings soon.