Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-12-SP2:Update
openssl.11276
openssl-fips-selftests_in_nonfips_mode.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openssl-fips-selftests_in_nonfips_mode.patch of Package openssl.11276
Index: openssl-1.0.1i/crypto/fips/fips.c =================================================================== --- openssl-1.0.1i.orig/crypto/fips/fips.c 2015-04-28 20:07:30.388906858 +0200 +++ openssl-1.0.1i/crypto/fips/fips.c 2015-04-28 20:11:08.498171218 +0200 @@ -454,6 +454,44 @@ end: return ret; } +/* In non-FIPS mode, the selftests must succeed if the + * checksum files are present + */ +void NONFIPS_selftest_check(void) + { + int rv; + char *hmacpath; + char path[PATH_MAX+1]; + + if (fips_selftest_fail) + { + /* check if the checksum files are installed */ + rv = get_library_path("libcrypto.so." SHLIB_VERSION_NUMBER, "FIPS_mode_set", path, sizeof(path)); + if (rv < 0) + OpenSSLDie(__FILE__,__LINE__, "FATAL FIPS SELFTEST FAILURE"); + + hmacpath = make_hmac_path(path); + if (hmacpath == NULL) + OpenSSLDie(__FILE__,__LINE__, "FATAL FIPS SELFTEST FAILURE"); + + if (access(hmacpath, F_OK)) + { + /* no hmac file is present, ignore the failed selftests */ + if (errno == ENOENT) + { + free(hmacpath); + return; + } + /* we fail on any other error */ + } + /* if the file exists, but the selftests failed + (eg wrong checksum), we fail too */ + free(hmacpath); + OpenSSLDie(__FILE__,__LINE__, "FATAL FIPS SELFTEST FAILURE"); + } + /* otherwise ok, selftests were successful */ + } + static CRYPTO_THREADID fips_thread; static int fips_thread_set = 0; Index: openssl-1.0.1i/crypto/fips/fips.h =================================================================== --- openssl-1.0.1i.orig/crypto/fips/fips.h 2015-04-28 20:07:30.396906978 +0200 +++ openssl-1.0.1i/crypto/fips/fips.h 2015-04-28 20:09:13.844455194 +0200 @@ -107,6 +107,7 @@ int FIPS_selftest_hmac(void); int FIPS_selftest_drbg(void); int FIPS_selftest_drbg_all(void); int FIPS_selftest_cmac(void); +void NONFIPS_selftest_check(void); void FIPS_get_timevec(unsigned char *buf, unsigned long *pctr); Index: openssl-1.0.1i/crypto/o_init.c =================================================================== --- openssl-1.0.1i.orig/crypto/o_init.c 2015-04-28 20:07:30.388906858 +0200 +++ openssl-1.0.1i/crypto/o_init.c 2015-04-28 20:12:48.283664793 +0200 @@ -90,6 +90,8 @@ static void init_fips_mode(void) if (buf[0] != '1') { + /* abort if selftest failed and the module is complete */ + NONFIPS_selftest_check(); /* drop down to non-FIPS mode if it is not requested */ FIPS_mode_set(0); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor