[openssl-users] undefined reference to `FIPS_mode'

Marcos Bontempo marcosbontempo at hotmail.com
Mon Dec 21 12:31:15 UTC 2015


Hello,
I resolved the error after compiling FIPS with ./config fips shared. I also needed to export LD_LIBRARY_PATH=/usr/local/ssl/lib:$LD_LIBRARY_PATH. 
Now I have a new problem.
I executed this code to set the FIPS mode and no error is prompted:
			result = FIPS_mode_set(1);				if(result != 1)			{				ERR_load_crypto_strings();				printf("*** Failed to enable FIPS module. ***\n");					printf("%s\n", ERR_error_string(ERR_get_error(), NULL));			}	
But when I check the FIPS mode I still get mode 0.
		mode = FIPS_mode();		if(mode == 0)		{			printf("*** FIPS module is disabled. ***\n");		}		if(mode == 1)		{			printf("*** FIPS module is enabled. ***\n");		}
When I execute the code as sudo, I get this error:
error:0F06D065:common libcrypto routines:FIPS_mode_set:fips mode not supported
Does anybody know why it is happening?
Thanks.
From: marcosbontempo at hotmail.com
To: openssl-users at openssl.org
Date: Sun, 20 Dec 2015 14:47:29 -0200
Subject: [openssl-users] undefined reference to `FIPS_mode'




Hello,
I'm programming an application that only gets and sets FIPS mode.
Here is my Makefile:
-------------------------------------------------------------------------------------------------------------------------------------------TOOLCHAIN:=/home/marcos/work/nitere/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin:$PATHCROSS_COMPILE:=arm-linux-gnueabihf-
OPENSSLDIR = /usr/local/ssl#INCLUDES = -I$(OPENSSLDIR)/include -I$(OPENSSLDIR)/fips-2.0/include -I$(OPENSSLDIR)/libINCLUDES = -I$(OPENSSLDIR)/include -I$(OPENSSLDIR)/fips-2.0/includeLIBS= -Lcrypto
PATH:=${TOOLCHAIN}:${PATH}
all:	${CROSS_COMPILE}gcc fipsctl.c -o fipsctl $(INCLUDES) $(LIBS)
clean:	rm -Rf *.o fipsctl-------------------------------------------------------------------------------------------------------------------------------------------
And here is my code:
-------------------------------------------------------------------------------------------------------------------------------------------#include <openssl/crypto.h>#include <stdio.h>
int main ( int argc, char *argv[] ){    if(argv[0] == "get")    {        int mode = FIPS_mode();        if(mode == 0)        {            printf("*** FIPS module is disabled. ***");        }        if(mode == 1)        {            printf("*** FIPS module is enabled. ***");        }    }    else if(argv[0] == "set")    {        printf("*** Enabling FIPS module. ***");            }    else    {        printf("*** Error: unsupported option. ***");    }}   -------------------------------------------------------------------------------------------------------------------------------------------
When I try to cross-compile, I get this error:
marcos at marcos-X450LD:~/work/nitere/app/nitere$ makearm-linux-gnueabihf-gcc fipsctl.c -o fipsctl -I/usr/local/ssl/include -I/usr/local/ssl/fips-2.0/include -Lcrypto/tmp/ccSQhRme.o: In function `main':fipsctl.c:(.text+0x1a): undefined reference to `FIPS_mode'collect2: error: ld returned 1 exit statusmake: *** [all] Error 1
Does anybody know why I'm getting this error? 
Any tip will be very helpful,Thanks.
 		 	   		  

_______________________________________________
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151221/df2a762c/attachment-0001.html>


More information about the openssl-users mailing list