1

I execute the following code in Netbeans and get the error : FIPS_mode_set failed: f06d065.

How to enable FIPS mode and get the code running?

#include <openssl/crypto.h>

int main()
{
int mode = FIPS_mode(), ret = 0; unsigned long err = 0;

/* Toggle FIPS mode */
if(mode == 0)
{
ret = FIPS_mode_set(1 /*on*/);
if(ret != 1)
{
    err = ERR_get_error();
}
}
else
{
ret = FIPS_mode_set(0 /*off*/);
if(ret != 1)
{
    err = ERR_get_error();
}
}

if(ret != 1)
printf("FIPS_mode_set failed: %lx.", err);

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.