@@ -591,9 +591,12 @@ static int wolfssl_init(void)
591591 total_other_r = 0 ;
592592#endif
593593
594- WC_SIG_IGNORE_BEGIN ();
595- fipsEntry ();
596- WC_SIG_IGNORE_END ();
594+ if (WC_SIG_IGNORE_BEGIN () >= 0 ) {
595+ fipsEntry ();
596+ (void )WC_SIG_IGNORE_END ();
597+ }
598+ else
599+ pr_err ("ERROR: WC_SIG_IGNORE_BEGIN() failed.\n" );
597600
598601#if defined(HAVE_LINUXKM_PIE_SUPPORT ) && defined(DEBUG_LINUXKM_PIE_SUPPORT )
599602 pr_info ("FIPS-bounded relocation normalizations: text=%d, rodata=%d, rwdata=%d, bss=%d, other=%d\n" ,
@@ -700,9 +703,12 @@ static int wolfssl_init(void)
700703 * because wc_GetCastStatus_fips(FIPS_CAST_HMAC_SHA2_256) isn't available
701704 * anymore.
702705 */
703- WC_SIG_IGNORE_BEGIN ();
704- fipsEntry ();
705- WC_SIG_IGNORE_END ();
706+ if (WC_SIG_IGNORE_BEGIN () >= 0 ) {
707+ fipsEntry ();
708+ (void )WC_SIG_IGNORE_END ();
709+ }
710+ else
711+ pr_err ("ERROR: WC_SIG_IGNORE_BEGIN() failed.\n" );
706712 ret = wolfCrypt_GetStatus_fips ();
707713 if (ret != 0 ) {
708714 pr_err ("ERROR: wolfCrypt_GetStatus_fips() after reset failed with code %d: %s\n" , ret , wc_GetErrorString (ret ));
@@ -1690,9 +1696,14 @@ static ssize_t FIPS_rerun_self_test_handler(struct kobject *kobj, struct kobj_at
16901696
16911697 pr_info ("wolfCrypt: rerunning FIPS self-test on command." );
16921698
1693- WC_SIG_IGNORE_BEGIN ();
1694- ret = wolfCrypt_IntegrityTest_fips ();
1695- WC_SIG_IGNORE_END ();
1699+ if (WC_SIG_IGNORE_BEGIN () >= 0 ) {
1700+ ret = wolfCrypt_IntegrityTest_fips ();
1701+ (void )WC_SIG_IGNORE_END ();
1702+ }
1703+ else {
1704+ pr_err ("ERROR: WC_SIG_IGNORE_BEGIN() failed.\n" );
1705+ ret = -1 ;
1706+ }
16961707 if (ret != 0 ) {
16971708 pr_err ("ERROR: wolfCrypt_IntegrityTest_fips: error %d" , ret );
16981709 return - EINVAL ;
@@ -1775,9 +1786,12 @@ static ssize_t FIPS_optest_trig_handler(struct kobject *kobj, struct kobj_attrib
17751786 * because wc_GetCastStatus_fips(FIPS_CAST_HMAC_SHA2_256) isn't available
17761787 * anymore.
17771788 */
1778- WC_SIG_IGNORE_BEGIN ();
1779- fipsEntry ();
1780- WC_SIG_IGNORE_END ();
1789+ if (WC_SIG_IGNORE_BEGIN () >= 0 ) {
1790+ fipsEntry ();
1791+ (void )WC_SIG_IGNORE_END ();
1792+ }
1793+ else
1794+ pr_err ("ERROR: WC_SIG_IGNORE_BEGIN() failed.\n" );
17811795 ret = wolfCrypt_GetStatus_fips ();
17821796 printf ("Status indicator of library reload/powercycle: %d\n" ,
17831797 ret );
0 commit comments