Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,42 @@ jobs:
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }}

macos-s2n:
runs-on: macos-14 # latest
env:
AWS_CRT_USE_NON_FIPS_TLS_13: 1
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }}

macos-x64-s2n:
runs-on: macos-14-large # latest
env:
AWS_CRT_USE_NON_FIPS_TLS_13: 1
permissions:
id-token: write # This is required for requesting the JWT
steps:
- name: configure AWS credentials (containers)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }}

openbsd:
runs-on: ubuntu-24.04 # latest
strategy:
Expand Down
12 changes: 7 additions & 5 deletions crt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ option(AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE "Set this if you want to
string(REPLACE "-g" "-g1" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
string(REPLACE "-g" "-g1" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")

# On Unix we use S2N for TLS and AWS-LC crypto.
# (On Windows and Apple we use the default OS libraries)
if ((UNIX AND NOT APPLE) OR AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)
# On Linux and BSD, we use S2N for TLS and AWS-LC crypto.
# On Windows, we use the default OS libraries.
# On Apple, we use the default OS libraries by default, but support S2N usage.
if (UNIX OR AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)
option(USE_OPENSSL "Set this if you want to use your system's OpenSSL compatible libcrypto" OFF)
include(AwsPrebuildDependency)

Expand All @@ -48,7 +49,7 @@ if ((UNIX AND NOT APPLE) OR AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)
-DCMAKE_BUILD_TYPE=RelWithDebInfo # Use the same build type as the rest of the project
)

if (APPLE OR WIN32)
if (WIN32)
# Libcrypto implementations typically have several chunky pregenerated tables that add a lot
# to artifact size. We dont really need them for ed25519 case on win/mac, so favor
# smaller binary over perf here.
Expand All @@ -72,14 +73,15 @@ if ((UNIX AND NOT APPLE) OR AWS_USE_LIBCRYPTO_TO_SUPPORT_ED25519_EVERYWHERE)

endif()

if(UNIX AND NOT APPLE)
if(UNIX)
# prebuild s2n-tls.
aws_prebuild_dependency(
DEPENDENCY_NAME S2N
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/s2n
CMAKE_ARGUMENTS
-DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF
-DBUILD_TESTING=OFF
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion crt/aws-c-io
Submodule aws-c-io updated 44 files
+29 −0 .builder/actions/custom_keychain_test_setup.py
+14 −3 .builder/actions/pkcs11_test_setup.py
+53 −16 .builder/actions/tls_server_setup.py
+38 −2 .github/workflows/ci.yml
+3 −2 CMakeLists.txt
+4 −1 builder.json
+1 −1 cmake/aws-c-io-config.cmake
+9 −0 include/aws/io/pem.h
+30 −0 include/aws/io/private/tls_channel_handler_private.h
+42 −13 source/darwin/secure_transport_tls_channel_handler.c
+3 −1 source/io.c
+62 −0 source/pem.c
+171 −0 source/s2n/s2n_apple_keychain.c
+119 −52 source/s2n/s2n_tls_channel_handler.c
+123 −11 source/tls_channel_handler.c
+48 −18 source/windows/secure_channel_tls_handler.c
+10 −3 tests/CMakeLists.txt
+24 −2 tests/event_loop_test.c
+145 −0 tests/pem_test.c
+135 −0 tests/resources/generateCerts.sh
+22 −0 tests/resources/import_custom_cert_to_keychain.sh
+28 −0 tests/resources/mtls_device.key
+24 −0 tests/resources/mtls_device.pem.crt
+28 −0 tests/resources/mtls_device_root_ca.key
+24 −0 tests/resources/mtls_device_root_ca.pem.crt
+28 −0 tests/resources/mtls_server.key
+24 −0 tests/resources/mtls_server.pem.crt
+28 −0 tests/resources/mtls_server_root_ca.key
+24 −0 tests/resources/mtls_server_root_ca.pem.crt
+31 −0 tests/resources/mtls_server_root_ca_trust_settings.plist
+28 −0 tests/resources/mtls_untrusted_server.key
+24 −0 tests/resources/mtls_untrusted_server.pem.crt
+28 −0 tests/resources/mtls_untrusted_server_root_ca.key
+24 −0 tests/resources/mtls_untrusted_server_root_ca.pem.crt
+0 −28 tests/resources/tls13_device.key
+0 −24 tests/resources/tls13_device.pem.crt
+0 −28 tests/resources/tls13_device_root_ca.key
+0 −24 tests/resources/tls13_device_root_ca.pem.crt
+0 −28 tests/resources/tls13_server.key
+0 −24 tests/resources/tls13_server.pem.crt
+0 −28 tests/resources/tls13_server_root_ca.key
+0 −24 tests/resources/tls13_server_root_ca.pem.crt
+139 −48 tests/tls_handler_test.c
+59 −7 tests/tls_server/tls_server.py
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def __init__(self, name, extra_cmake_args=[], libname=None):
# aws-lc produces libcrypto.a
AWS_LIBS.append(AwsLib('aws-lc', libname='crypto'))

if sys.platform != 'darwin' and sys.platform != 'win32':
if sys.platform != 'win32':
AWS_LIBS.append(AwsLib('s2n'))

AWS_LIBS.append(AwsLib('aws-c-common'))
Expand Down
1 change: 1 addition & 0 deletions test/test_mqtt5_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def _test_mqtt5_cred_pkcs12(self):
client.stop()
callbacks.future_stopped.result(TIMEOUT)

@unittest.skipIf(os.environ.get('AWS_CRT_USE_NON_FIPS_TLS_13'), "PKCS12 not supported with non-FIPS TLS 1.3")
def test_mqtt5_cred_pkcs12(self):
test_retry_wrapper(self._test_mqtt5_cred_pkcs12)

Expand Down
1 change: 1 addition & 0 deletions test/test_mqtt_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def _test_mqtt311_cred_pkcs12(self):
connection.connect().result(TIMEOUT)
connection.disconnect().result(TIMEOUT)

@unittest.skipIf(os.environ.get('AWS_CRT_USE_NON_FIPS_TLS_13'), "PKCS12 not supported with non-FIPS TLS 1.3")
def test_mqtt311_cred_pkcs12(self):
test_retry_wrapper(self._test_mqtt311_cred_pkcs12)

Expand Down
Loading