Openssl 3.0.8 fips compliant integration in ios

I am writing to seek assistance with building OpenSSL 3.0.8 with FIPS for an iOS device. This is my first time undertaking such a task, and I am encountering some issues that I hope get solution from anyone here.

Here are the steps I have followed so far:

Downloaded OpenSSL 3.0.8:
I downloaded the OpenSSL 3.0.8 source code and configured it to build for iOS with FIPS enabled using the following script:

`

configure_and_build_openssl() {
ARCH=$1
TARGET=$2
SDK_VERSION=$3
SDK_PATH=$4
PREFIX=$5

export CROSS_TOP=$(xcode-select --print-path)/Platforms/${TARGET}.platform/Developer
export CROSS_SDK=${TARGET}${SDK_VERSION}.sdk
export SDKROOT=${SDK_PATH}
export BUILD_TOOLS=$(xcode-select --print-path)/Toolchains/XcodeDefault.xctoolchain
export CROSS_COMPILE="${BUILD_TOOLS}/usr/bin/"

export CC="cc -isysroot $SDK_PATH -I$SDK_PATH/usr/include -I$SDK_PATH/usr/include/$(basename $BUILD_TOOLS)"
export CFLAGS="-isysroot $SDK_PATH -I$SDK_PATH/usr/include -I$SDK_PATH/usr/include/$(basename $BUILD_TOOLS)"
export LDFLAGS="-isysroot $SDK_PATH"

# Configure and build for the specified architecture
./Configure ${ARCH} enable-fips no-async no-shared no-tests enable-ec_nistp_64_gcc_128 --prefix=$PREFIX --openssldir=$PREFIX
make -j$(sysctl -n hw.ncpu)
make install
make clean
}

`

Updated openssl.cnf:
I updated the openssl.cnf file as directed in the OpenSSL FIPS module documentation.
openssl

Copied Libraries and Configuration Files:
I copied libssl.a and libcrypto.a to my project, and placed openssl.cnf, fipsmodule.cnf, and fips.dylib in my project.

Enabled FIPS Mode:
I wrote the following code to enable FIPS and check if it is enabled:

`

BOOL isFIPSModeEnabled() {
OSSL_PROVIDER *fips;
OSSL_PROVIDER *base;

fips = OSSL_PROVIDER_load(NULL, "fips");
if (fips == NULL) {
    printf("Failed to load FIPS providern");
    ERR_print_errors_fp(stderr);
}

base = OSSL_PROVIDER_load(NULL, "base");
if (base == NULL) {
    OSSL_PROVIDER_unload(fips);
    printf("Failed to load base providern");
    return false;
}

if (EVP_default_properties_enable_fips(NULL, 1) == 0) {
    printf("Failed to enable FIPS moden");
    OSSL_PROVIDER_unload(base);
    OSSL_PROVIDER_unload(fips);
    return false;
}

if (EVP_default_properties_is_fips_enabled(NULL) == 1) {
    printf("FIPS mode is enabledn");
    OSSL_PROVIDER_unload(base);
    OSSL_PROVIDER_unload(fips);
    return true;
} else {
    printf("FIPS mode is not enabledn");
    OSSL_PROVIDER_unload(base);
    OSSL_PROVIDER_unload(fips);
    return false;
}
}

`

When I run this code, it prints “FIPS mode is enabled.” However, the provider is not loading, and I receive the following error message:

`

Failed to load FIPS provider

C0BEC7F701000000:error:12800067:DSO support routines:dlfcn_load:could not load the shared                                      library:crypto/dso/dso_dlfcn.c:118:
C0BEC7F701000000:error:12800067:DSO support routines:DSO_load:could not load the shared library:crypto/dso/dso_lib.c:152:
C0BEC7F701000000:error:07880025:common libcrypto routines:provider_init:reason(524325):crypto/provider_core.c:912:name=fips`

I would greatly appreciate your guidance on why the FIPS provider is not loading and what steps I might be missing or doing incorrectly in this process.

New contributor

Abhishek Sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật