Important News:SafeLogic's CryptoComply Achieves FIPS 140-3 Validation for 28 OEs and Receives Certificate #4781! Read the blog post!
The SafeLogic Blog
Supporting FIPS with OpenSSL 1.X for iOS Applications
November 21, 2024 •Alex Zaslavsky
To achieve FIPS compliance, many enterprises rely on OpenSSL 1.X-compatible libraries, even though these versions have reached end of life (EOL). The latest OpenSSL releases (3.x) bring significant architectural changes and streamlined FIPS support. However, migrating to OpenSSL 3.x often requires extensive codebase modifications, particularly in critical areas like encryption. For enterprises with complex codebases or legacy systems, such changes introduce potential risks and demand rigorous testing, making immediate migration challenging. As a result, many organizations are opting to continue using OpenSSL 1.x, despite its EOL status.
On iOS, supporting FIPS-compliant OpenSSL 1.x presents unique challenges. The FIPS library is typically statically linked, and the application is cross-compiled, which requires embedding the FIPS module runtime signature into the application.
Here are several important guidelines to maintain FIPS Compliance with OpenSSL 1.x on iOS:
- Include fips_premain.c in the application source code
The FIPS module uses internal validation logic to ensure that the runtime-loaded image signature matches the value calculated at linkage time. fips_premain.c contains the logic to print the expected value during linkage. Ensure this file is included in your application source. - Ensure proper embedding of the expected FIPS module signature in the application
If your application, when compiled with fips_premain.c, only prints the expected FIPS module signature and exits (e.g., f1022ef5682e5d708ee5921e13f3051bbbb1a8c0), this usually indicates that the expected value was not embedded correctly into the application. Here are two methods to embed the signature properly:
-
- Manual update in fips_premain.c: Change the expected HMAC signature value in fips_premain.c to match the one printed in the console. For example:
#define HMAC_SHA1_SIG "f1022ef5682e5d708ee5921e13f3051bbbb1a8c0"
-
- Using the incore_macho tool: Run the incore_macho tool with the path to the application executable. This tool embeds the expected signature directly into the app executable. Note that you can run the incore_macho binary on macOS with an application compiled for an iOS device or simulator.
- Statically link libcrypto.a with FIPS support
The FIPS-compliant libcrypto.a library should be statically linked with the application. To validate this, run the following command:
nm <ios_app> | grep FIPS_rodata_start
By following these steps, you can ensure that your iOS application maintains FIPS compliance while using OpenSSL 1.X.
Alex Zaslavsky
Alex is a Lead Software Engineer with SafeLogic.
Popular Posts
Search for posts
Tags
- FIPS 140 (111)
- FIPS validation (85)
- Encryption (70)
- cryptography (68)
- NIST (62)
- CryptoComply (60)
- SafeLogic (58)
- Industry News (54)
- cryptographic module (51)
- Conversations (49)
- CMVP (48)
- RapidCert (46)
- compliance (41)
- Ray Potter (33)
- SafeLogic News (33)
- Event (27)
- federal (27)
- CAVP (23)
- Cybersecurity (23)
- FIPS 140-3 (18)
- OpenSSL (16)
- government (14)
- FedRAMP (13)
- CryptoCompact (12)
- Cryptology (12)
- DoD (12)
- RSA (12)
- healthcare (12)
- partners (12)
- NSA (11)
- post-quantum cryptography (11)
- Cloud (9)
- PQC (9)
- security (9)
- CMMC (8)
- Suite B (8)
- testing (8)
- whitepaper (8)
- Approved Products List (APL) (6)
- HITECH (6)
- ICMC (6)
- lab (6)
- CEO (5)
- NIST 800-171 (5)
- NIST 800-53 (5)
- OpenSSL 3.0 (5)
- iOS (5)
- procurement (5)
- C3PAO (4)
- Common Criteria (4)
- HITECH Act (4)
- deadline (4)
- encrypt (4)
- innovation (4)
- procure (4)
- public sector (4)
- Air Force (3)
- BSAFE (3)
- DFARS (3)
- HIPAA Safe Harbor (3)
- HITECH Safe Harbor (3)
- OpenSSL 1.1.1 (3)
- OpenSSL 3.x (3)
- POA&M (3)
- TLS 1.3 (3)
- magazine (3)
- queue (3)
- transition (3)
- 3PAO (2)
- ACVP (2)
- BAA (2)
- CIO (2)
- CSP (2)
- Cyber Defense Magazine (2)
- Defense Industrial Base (2)
- HIPAA security controls (2)
- Historical Status (2)
- MFA (2)
- OpenSSL 1.0.2 (2)
- SPRS (2)
- StateRAMP (2)
- entropy (2)
- excellence (2)
- finance (2)
- founder (2)
- gold (2)
- leader (2)
- maturity (2)
- overlap (2)
- pilot (2)
- rsa conference (2)
- solution (2)
- sponsors (2)
- sunset (2)
- vendor (2)
- year (2)
- Active Status (1)
- Alliance for Digital Innovation (1)
- Android (1)
- CIO Prime Views (1)
- DHS (1)
- DIU (1)
- DIUx (1)
- DOJ (1)
- DoDIN APL (1)
- Entropy Source Validation (1)
- FCA (1)
- FIPS Compliance (1)
- FISMA (1)
- GSA (1)
- HITRUST (1)
- Matt Cornelius (1)
- Matthew Cornelius (1)
- Maturity Model (1)
- NCCoE (1)
- OMB (1)
- SLED (1)
- SP800-131A (1)
- SP800-90A (1)
- TLS 1.1 (1)
- background (1)
- best (1)
- co-founder (1)
- codies (1)
- congress (1)
- cybertech (1)
- education (1)
- elliptic curve cryptography (1)
- extended (1)
- faq (1)
- fintech (1)
- fiscal (1)
- fiscal year (1)
- fraud (1)
- globee (1)
- hill (1)
- interview (1)
- kratos (1)
- libgcrypt (1)
- national cybersecurity strategy (1)
- opportunities (1)
- parallel (1)
- profile (1)
- public (1)
- representatives (1)
- reseller (1)
- senate (1)
- senators (1)
- simplify (1)
- state (1)
- stealth mode (1)
- story (1)
- terminology (1)
- trophy (1)
- whistleblower (1)
- whistleblowing (1)