-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when enabling FIPS in OpenSSL #3123
Comments
This might be an issue for https://github.com/aws/s2n-tls. Looks like their init is failing to validate DRBG in the fips version of openssl. Im not seeing any tickets on their side for it, so might be a bug or some sort of limitation in s2n integration with v3.0.2 (which itself is pretty old at this point) |
Seems that s2n-tls isn't included by this project directly. This project includes https://github.com/awslabs/aws-crt-cpp.git which then includes s2n-tls. I'm confused because the documentation for aws-crt-cpp says:
I think aws-sdk-cpp does set Line 50 in a35dba1
So why is |
Openssl has 2 parts to it - libssl and libcrypto. Historically, libssl had issues discovered in it periodically, while libcrypto has been fairly stabe. |
Hey thanks for reaching out. Elaborating on what Dmitriy said I spent some time looking into this and I could not reproduce. Using a custom crypto with the SDK has a lot of gotchas and without being able to view your entire environment I cannot diagnose it. However i spent time and created a workspace that will work with fips enabled openssl. I would also highly suggest looking at our developer guide My project where it works as expected: Project Structure:
Dockerfile # Using offical Amazon Linux 2023 image from public ECR
FROM public.ecr.aws/amazonlinux/amazonlinux:2023
# Install compiler et al.
RUN yum groupinstall "Development Tools" -y
# Install required dependencies
RUN yum install -y ninja-build cmake3 wget perl
# Install openssl in fips mode
RUN wget https://github.com/openssl/openssl/releases/download/openssl-3.0.9/openssl-3.0.9.tar.gz &&\
tar -xf openssl-3.0.9.tar.gz &&\
cd openssl-3.0.9 &&\
./Configure enable-fips --prefix=/fips-install --openssldir=/fips-install &&\
make &&\
make install
# Verify install
RUN cd openssl-3.0.9 &&\
./util/wrap.pl -fips /fips-install/bin/openssl list -provider-path providers -provider fips -providers
# Build and install curl targeting openssl with fips provider
RUN git clone --depth 1 -b curl-8_10_1 https://github.com/curl/curl && \
cd curl && \
autoreconf -fi && \
mkdir build && \
cd build && \
cmake -DCMAKE_PREFIX_PATH="/fips-install" -DCMAKE_INSTALL_PREFIX="/curl-install" .. && \
cmake --build . && \
cmake --install .
# Install sdk
RUN git clone --depth 1 --recurse-submodules https://github.com/aws/aws-sdk-cpp && \
cd aws-sdk-cpp && \
mkdir build && \
cd build && \
cmake -G Ninja -DBUILD_ONLY="core" \
-DCMAKE_PREFIX_PATH="/curl-install;/fips-install" \
-DAUTORUN_UNIT_TESTS=OFF .. && \
cmake --build . && \
cmake --install .
## Copy over and build
RUN mkdir sdk-example
COPY CMakeLists.txt /sdk-example/CMakeLists.txt
COPY main.cpp /sdk-example/main.cpp
RUN cd sdk-example &&\
mkdir build &&\
cd build &&\
cmake -G Ninja -DCMAKE_PREFIX_PATH="/curl-install;/fips-install;" .. && \
cmake --build . CMakeLists.txt cmake_minimum_required(VERSION 3.13)
project(sdk_usage_workspace)
set(CMAKE_CXX_STANDARD 20)
find_package(AWSSDK REQUIRED COMPONENTS core)
add_executable(${PROJECT_NAME} "main.cpp")
target_link_libraries(${PROJECT_NAME} PRIVATE ${AWSSDK_LINK_LIBRARIES}) main.cpp #include <aws/core/Aws.h>
using namespace Aws;
auto main() -> int
{
SDKOptions options;
Aws::InitAPI(options);
Aws::ShutdownAPI(options);
} replicate.sh #!/bin/zsh
set -u
# build image
docker build -t test-image .
# run example
docker run \
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
-e AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} \
-e LD_LIBRARY_PATH="/fips-install/lib;/curl-install/lib64" \
--name test-image test-image /sdk-example/build/sdk_usage_workspace when we run with
additionally when we shell into the enviornment we can see the project setup as expected
So with this we know it works as intended in a isolated environment. If I were to guess there is something incorrectly set up in your environment that is leading to the issues that you are seeing. If you can update the example above to replicate your issue we would be happy to look into but it looks to be working as intended. |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Strangely we found the crash went away when we used an unstripped binary for FIPS. |
I'm glad that you were able to get it working without crashing. Did you have questions/problems with using FIPS with this sdk? |
Sorry I'm late, just created #3198 |
Describe the bug
We've had the SDK working with our app fine, but we've recently added FIPS support to OpenSSL. When we run our app and it initialises the SDK it crashes.
Expected Behavior
The SDK should work as before.
Current Behavior
Reproduction Steps
We're using Ubuntu 22 with OpenSSL v3.0.2 and we've built the OpenSSL FIPS library from v3.0.0:
Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
1.11.404
Compiler and Version used
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Operating System and version
Ubuntu 22
The text was updated successfully, but these errors were encountered: