<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello,<div><br></div><div>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. </div><div><br></div><div>Now I have a new problem.</div><div><br></div><div>I executed this code to set the FIPS mode and no error is prompted:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">                 </span>result = FIPS_mode_set(1);<span class="Apple-tab-span" style="white-space:pre">  </span></div><div><span class="Apple-tab-span" style="white-space:pre">                     </span>if(result != 1)</div><div><span class="Apple-tab-span" style="white-space:pre">                      </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                            </span>ERR_load_crypto_strings();</div><div><span class="Apple-tab-span" style="white-space:pre">                           </span>printf("*** Failed to enable FIPS module. ***\n");<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                             </span>printf("%s\n", ERR_error_string(ERR_get_error(), NULL));</div><div><span class="Apple-tab-span" style="font-size: 12pt; white-space: pre;">                        </span><span style="font-size: 12pt;">}</span><span class="Apple-tab-span" style="font-size: 12pt; white-space: pre;">    </span></div></div><div><br></div><div>But when I check the FIPS mode I still get mode 0.</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">           </span>mode = FIPS_mode();</div><div><span class="Apple-tab-span" style="white-space:pre">          </span>if(mode == 0)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>printf("*** FIPS module is disabled. ***\n");</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>if(mode == 1)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>printf("*** FIPS module is enabled. ***\n");</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>}</div></div><div><br></div><div>When I execute the code as sudo, I get this error:</div><div><br></div><div><div>error:0F06D065:common libcrypto routines:FIPS_mode_set:fips mode not supported</div><div><br></div><div>Does anybody know why it is happening?</div><div><br></div><div>Thanks.</div><div><br></div><div><hr id="stopSpelling">From: marcosbontempo@hotmail.com<br>To: openssl-users@openssl.org<br>Date: Sun, 20 Dec 2015 14:47:29 -0200<br>Subject: [openssl-users] undefined reference to `FIPS_mode'<br><br>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>
<div dir="ltr">Hello,<div><br></div><div>I'm programming an application that only gets and sets FIPS mode.</div><div><br></div><div>Here is my Makefile:</div><div><br></div><div>-------------------------------------------------------------------------------------------------------------------------------------------</div><div><div>TOOLCHAIN:=/home/marcos/work/nitere/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin:$PATH</div><div>CROSS_COMPILE:=arm-linux-gnueabihf-</div><div><br></div><div>OPENSSLDIR = /usr/local/ssl</div><div>#INCLUDES = -I$(OPENSSLDIR)/include -I$(OPENSSLDIR)/fips-2.0/include -I$(OPENSSLDIR)/lib</div><div>INCLUDES = -I$(OPENSSLDIR)/include -I$(OPENSSLDIR)/fips-2.0/include</div><div>LIBS= -Lcrypto</div><div><br></div><div>PATH:=${TOOLCHAIN}:${PATH}</div><div><br></div><div>all:</div><div><span class="ecxApple-tab-span" style="white-space:pre;">    </span>${CROSS_COMPILE}gcc fipsctl.c -o fipsctl $(INCLUDES) $(LIBS)</div><div><br></div><div>clean:</div><div><span class="ecxApple-tab-span" style="white-space:pre;">       </span>rm -Rf *.o fipsctl</div></div><div>-------------------------------------------------------------------------------------------------------------------------------------------</div><div><br></div><div>And here is my code:</div><div><br></div><div>-------------------------------------------------------------------------------------------------------------------------------------------</div><div><span style="font-size:12pt;">#include <openssl/crypto.h></span></div><div><div>#include <stdio.h></div><div><br></div><div>int main ( int argc, char *argv[] )</div><div>{</div><div>    if(argv[0] == "get")</div><div>    {</div><div>        int mode = FIPS_mode();</div><div>        if(mode == 0)</div><div>        {</div><div>            printf("*** FIPS module is disabled. ***");</div><div>        }</div><div>        if(mode == 1)</div><div>        {</div><div>            printf("*** FIPS module is enabled. ***");</div><div>        }</div><div>    }</div><div>    else if(argv[0] == "set")</div><div>    {</div><div>        printf("*** Enabling FIPS module. ***");        </div><div>    }</div><div>    else</div><div>    {</div><div>        printf("*** Error: unsupported option. ***");</div><div>    }</div><div>}   </div></div><div>-------------------------------------------------------------------------------------------------------------------------------------------</div><div><br></div><div>When I try to cross-compile, I get this error:</div><div><br></div><div><div>marcos@marcos-X450LD:~/work/nitere/app/nitere$ make</div><div>arm-linux-gnueabihf-gcc fipsctl.c -o fipsctl -I/usr/local/ssl/include -I/usr/local/ssl/fips-2.0/include -Lcrypto</div><div>/tmp/ccSQhRme.o: In function `main':</div><div>fipsctl.c:(.text+0x1a): undefined reference to `FIPS_mode'</div><div>collect2: error: ld returned 1 exit status</div><div>make: *** [all] Error 1</div></div><div><br></div><div>Does anybody know why I'm getting this error? </div><div><br></div><div>Any tip will be very helpful,</div><div>Thanks.</div><div><br></div>                                      </div>
<br>_______________________________________________
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users</div></div>                                    </div></body>
</html>