aws-crt 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/auth.h +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/aws_imds_client.h +5 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/credentials.h +5 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/aws_signing.h +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/credentials_utils.h +2 -0
- data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/signing_config.h +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/source/auth.c +3 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/aws_imds_client.c +146 -63
- data/aws-crt-ffi/crt/aws-c-auth/source/aws_signing.c +41 -19
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_imds.c +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/source/credentials_utils.c +1 -0
- data/aws-crt-ffi/crt/aws-c-auth/source/signable_http_request.c +2 -1
- data/aws-crt-ffi/crt/aws-c-auth/source/signing_config.c +25 -0
- data/aws-crt-ffi/crt/aws-c-auth/tests/CMakeLists.txt +3 -0
- data/aws-crt-ffi/crt/aws-c-auth/tests/aws_imds_client_test.c +197 -31
- data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_imds_tests.c +16 -18
- data/aws-crt-ffi/crt/aws-c-auth/tests/sigv4_signing_tests.c +3 -1
- data/aws-crt-ffi/crt/aws-c-cal/include/aws/cal/private/opensslcrypto_common.h +22 -0
- data/aws-crt-ffi/crt/aws-c-cal/source/darwin/commoncrypto_aes.c +46 -17
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_aes.c +1 -0
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_platform_init.c +7 -0
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/openssl_rsa.c +59 -2
- data/aws-crt-ffi/crt/aws-c-cal/source/unix/opensslcrypto_ecc.c +1 -0
- data/aws-crt-ffi/crt/aws-c-common/CMakeLists.txt +13 -1
- data/aws-crt-ffi/crt/aws-c-common/THIRD-PARTY-LICENSES.txt +28 -7
- data/aws-crt-ffi/crt/aws-c-common/bin/system_info/CMakeLists.txt +18 -0
- data/aws-crt-ffi/crt/aws-c-common/bin/system_info/print_system_info.c +48 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/allocator.h +23 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/byte_buf.h +12 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/cross_process_lock.h +35 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/hash_table.h +1 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/priority_queue.h +24 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/private/system_info_priv.h +37 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/system_info.h +47 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/common/system_resource_util.h +30 -0
- data/aws-crt-ffi/crt/aws-c-common/include/aws/testing/aws_test_harness.h +3 -2
- data/aws-crt-ffi/crt/aws-c-common/source/allocator.c +64 -13
- data/aws-crt-ffi/crt/aws-c-common/source/android/logging.c +14 -0
- data/aws-crt-ffi/crt/aws-c-common/source/common.c +3 -3
- data/aws-crt-ffi/crt/aws-c-common/source/file.c +96 -35
- data/aws-crt-ffi/crt/aws-c-common/source/linux/system_info.c +24 -0
- data/aws-crt-ffi/crt/aws-c-common/source/memtrace.c +10 -3
- data/aws-crt-ffi/crt/aws-c-common/source/platform_fallback_stubs/system_info.c +21 -0
- data/aws-crt-ffi/crt/aws-c-common/source/posix/cross_process_lock.c +141 -0
- data/aws-crt-ffi/crt/aws-c-common/source/posix/system_info.c +1 -1
- data/aws-crt-ffi/crt/aws-c-common/source/posix/system_resource_utils.c +32 -0
- data/aws-crt-ffi/crt/aws-c-common/source/priority_queue.c +24 -0
- data/aws-crt-ffi/crt/aws-c-common/source/system_info.c +80 -0
- data/aws-crt-ffi/crt/aws-c-common/source/task_scheduler.c +2 -2
- data/aws-crt-ffi/crt/aws-c-common/source/windows/cross_process_lock.c +93 -0
- data/aws-crt-ffi/crt/aws-c-common/source/windows/system_resource_utils.c +31 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/CMakeLists.txt +16 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/alloc_test.c +83 -22
- data/aws-crt-ffi/crt/aws-c-common/tests/cross_process_lock_tests.c +116 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/file_test.c +103 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/priority_queue_test.c +36 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/system_info_tests.c +19 -0
- data/aws-crt-ffi/crt/aws-c-common/tests/system_resource_util_test.c +37 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection.h +9 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/http.h +1 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_impl.h +5 -4
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_manager_system_vtable.h +10 -18
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/proxy_impl.h +5 -1
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/request_response_impl.h +5 -0
- data/aws-crt-ffi/crt/aws-c-http/include/aws/http/request_response.h +10 -0
- data/aws-crt-ffi/crt/aws-c-http/source/connection.c +5 -2
- data/aws-crt-ffi/crt/aws-c-http/source/connection_manager.c +22 -21
- data/aws-crt-ffi/crt/aws-c-http/source/h1_connection.c +102 -17
- data/aws-crt-ffi/crt/aws-c-http/source/h1_stream.c +1 -0
- data/aws-crt-ffi/crt/aws-c-http/source/http.c +3 -0
- data/aws-crt-ffi/crt/aws-c-http/source/proxy_connection.c +2 -2
- data/aws-crt-ffi/crt/aws-c-http/tests/CMakeLists.txt +2 -0
- data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_manager.c +18 -18
- data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_client.c +111 -1
- data/aws-crt-ffi/crt/aws-c-http/tests/test_proxy.c +2 -2
- data/aws-crt-ffi/crt/aws-c-http/tests/test_stream_manager.c +2 -2
- data/aws-crt-ffi/crt/aws-c-io/include/aws/io/retry_strategy.h +1 -1
- data/aws-crt-ffi/crt/aws-c-io/source/exponential_backoff_retry_strategy.c +1 -1
- data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_tls_op_handler.c +2 -4
- data/aws-crt-ffi/crt/aws-lc/CMakeLists.txt +16 -8
- data/aws-crt-ffi/crt/aws-lc/cmake/go.cmake +6 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/CMakeLists.txt +6 -9
- data/aws-crt-ffi/crt/aws-lc/crypto/asn1/a_time.c +34 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/asn1/a_utctm.c +4 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/asn1/asn1_test.cc +41 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/bio_mem.c +6 -7
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/bio_test.cc +152 -16
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/connect.c +6 -12
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/fd.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/file.c +20 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/socket.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/bio/socket_helper.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/blake2/blake2.c +11 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/bytestring/cbb.c +13 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/bytestring/cbs.c +9 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/asm/chacha-armv8.pl +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/chacha.c +49 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/chacha_test.cc +110 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/chacha/internal.h +8 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/compiler_test.cc +4 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/conf/conf_test.cc +1 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/crypto_test.cc +9 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/curve25519.c +189 -108
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/curve25519_nohw.c +78 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/ed25519_test.cc +9 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/internal.h +24 -10
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/spake25519.c +4 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/curve25519/x25519_test.cc +80 -11
- data/aws-crt-ffi/crt/aws-lc/crypto/decrepit/evp/evp_do_all.c +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/digest_extra/digest_extra.c +8 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/digest_extra/digest_test.cc +110 -45
- data/aws-crt-ffi/crt/aws-lc/crypto/dsa/dsa_test.cc +8 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/dsa/internal.h +18 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/dynamic_loading_test.c +8 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/ec_extra/ec_derive.c +4 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/ec_extra/hash_to_curve.c +6 -18
- data/aws-crt-ffi/crt/aws-lc/crypto/endian_test.cc +308 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/err/ssl.errordata +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_extra_test.cc +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_test.cc +11 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/evp_tests.txt +25 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_ec_asn1.c +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_kem.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/p_rsa_asn1.c +1 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/print.c +7 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/evp_extra/scrypt.c +13 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/CMakeLists.txt +13 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/aes/aes_nohw.c +18 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bcm.c +12 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bn_assert_test.cc +77 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bn_test.cc +30 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/bytes.c +112 -22
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/div.c +12 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/exponentiation.c +54 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/gcd.c +5 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/internal.h +37 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/montgomery.c +4 -11
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/bn/montgomery_inv.c +51 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/cipher/aead.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/digest.c +29 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/digests.c +89 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/digest/internal.h +4 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec.c +19 -36
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_key.c +3 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_montgomery.c +9 -7
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/ec_test.cc +33 -9
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/internal.h +17 -12
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p224-64.c +5 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p256-nistz.c +8 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p256.c +9 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p384.c +33 -16
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/p521.c +14 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/scalar.c +26 -24
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/simple_mul.c +8 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ec/wnaf.c +3 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/ecdsa/ecdsa.c +9 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/evp/evp.c +43 -12
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/evp/p_ec.c +4 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/hmac/hmac.c +3 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/modes/xts.c +26 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/cpu_jitter_test.cc +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/internal.h +20 -11
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/rand.c +10 -10
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rand/urandom.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/internal.h +59 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/padding.c +9 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/rsa.c +7 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/rsa/rsa_impl.c +51 -60
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/service_indicator/service_indicator.c +5 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/service_indicator/service_indicator_test.cc +205 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/asm/sha1-armv8.pl +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/asm/sha512-armv8.pl +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/internal.h +8 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha3.c +37 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha3_test.cc +115 -110
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sha/sha512.c +55 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/fipsmodule/sshkdf/sshkdf.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/hmac_extra/hmac_test.cc +12 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/hmac_extra/hmac_tests.txt +10 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/hrss/asm/poly_rq_mul.S +2 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/impl_dispatch_test.cc +9 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/internal.h +90 -8
- data/aws-crt-ffi/crt/aws-lc/crypto/kem/kem.c +28 -27
- data/aws-crt-ffi/crt/aws-lc/crypto/kyber/kem_kyber.h +14 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/obj/obj_dat.h +52 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/obj/obj_mac.num +5 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/obj/objects.txt +7 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/arm-xlate.pl +3 -14
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/ppc-xlate.pl +1 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/x86_64-xlate.pl +4 -15
- data/aws-crt-ffi/crt/aws-lc/crypto/perlasm/x86asm.pl +4 -13
- data/aws-crt-ffi/crt/aws-lc/crypto/poly1305/poly1305_arm_asm.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/deterministic.c +4 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/fuchsia.c +4 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/rand_test.cc +0 -63
- data/aws-crt-ffi/crt/aws-lc/crypto/rand_extra/windows.c +41 -19
- data/aws-crt-ffi/crt/aws-lc/crypto/rsa_extra/rsa_test.cc +3 -3
- data/aws-crt-ffi/crt/aws-lc/crypto/siphash/siphash.c +12 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/siphash/siphash_test.cc +5 -5
- data/aws-crt-ffi/crt/aws-lc/crypto/stack/stack.c +68 -46
- data/aws-crt-ffi/crt/aws-lc/crypto/trust_token/pmbtoken.c +4 -4
- data/aws-crt-ffi/crt/aws-lc/crypto/trust_token/voprf.c +2 -2
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/by_dir.c +0 -6
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/internal.h +4 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_lu.c +33 -9
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_test.cc +87 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_trs.c +1 -1
- data/aws-crt-ffi/crt/aws-lc/crypto/x509/x509_vfy.c +35 -13
- data/aws-crt-ffi/crt/aws-lc/crypto/x509v3/v3_lib.c +2 -0
- data/aws-crt-ffi/crt/aws-lc/crypto/x509v3/v3_purp.c +4 -6
- data/aws-crt-ffi/crt/aws-lc/generated-src/crypto_test_data.cc +179 -151
- data/aws-crt-ffi/crt/aws-lc/generated-src/err_data.c +353 -349
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/chacha/chacha-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/bn-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-aarch64/crypto/test/trampoline-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/chacha/chacha-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/armv4-mont.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/bsaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/ghash-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha1-armv4-large.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha256-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/sha512-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/fipsmodule/vpaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/ios-arm/crypto/test/trampoline-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/chacha/chacha-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/bn-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-aarch64/crypto/test/trampoline-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/chacha/chacha-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/armv4-mont.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/bsaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/ghash-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha1-armv4-large.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha256-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/sha512-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/fipsmodule/vpaes-armv7.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-arm/crypto/test/trampoline-armv4.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S +1 -5
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S +1 -5
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-ppc64le/crypto/test/trampoline-ppc.S +1 -5
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/chacha/chacha-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/aesni-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/bn-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/co-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/ghash-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/md5-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha1-586.S +4 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha256-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/sha512-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/vpaes-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/fipsmodule/x86-mont.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86/crypto/test/trampoline-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/chacha/chacha-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-xts-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/md5-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/linux-x86_64/crypto/test/trampoline-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/chacha/chacha-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/aesni-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/bn-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/co-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/ghash-ssse3-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/ghash-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/md5-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha1-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha256-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/sha512-586.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/vpaes-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/fipsmodule/x86-mont.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86/crypto/test/trampoline-x86.S +3 -12
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/chacha/chacha-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/aesni-xts-avx512.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/md5-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/mac-x86_64/crypto/test/trampoline-x86_64.S +2 -11
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/chacha/chacha-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/armv8-mont.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/bn-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/ghash-neon-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/ghashv8-armx.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/keccak1600-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/md5-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/p256-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha1-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha256-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/sha512-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/fipsmodule/vpaes-armv8.S +3 -13
- data/aws-crt-ffi/crt/aws-lc/generated-src/win-aarch64/crypto/test/trampoline-armv8.S +4 -14
- data/aws-crt-ffi/crt/aws-lc/go.mod +4 -4
- data/aws-crt-ffi/crt/aws-lc/go.sum +8 -10
- data/aws-crt-ffi/crt/aws-lc/include/openssl/aead.h +2 -2
- data/aws-crt-ffi/crt/aws-lc/include/openssl/arm_arch.h +4 -119
- data/aws-crt-ffi/crt/aws-lc/include/openssl/asm_base.h +185 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/asn1.h +5 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/base.h +31 -134
- data/aws-crt-ffi/crt/aws-lc/include/openssl/bio.h +30 -18
- data/aws-crt-ffi/crt/aws-lc/include/openssl/bn.h +0 -2
- data/aws-crt-ffi/crt/aws-lc/include/openssl/chacha.h +6 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/cipher.h +2 -2
- data/aws-crt-ffi/crt/aws-lc/include/openssl/digest.h +9 -6
- data/aws-crt-ffi/crt/aws-lc/include/openssl/dsa.h +0 -21
- data/aws-crt-ffi/crt/aws-lc/include/openssl/ec.h +1 -1
- data/aws-crt-ffi/crt/aws-lc/include/openssl/err.h +1 -1
- data/aws-crt-ffi/crt/aws-lc/include/openssl/evp.h +8 -5
- data/aws-crt-ffi/crt/aws-lc/include/openssl/nid.h +21 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/rsa.h +1 -65
- data/aws-crt-ffi/crt/aws-lc/include/openssl/sha.h +22 -1
- data/aws-crt-ffi/crt/aws-lc/include/openssl/ssl.h +121 -13
- data/aws-crt-ffi/crt/aws-lc/include/openssl/stack.h +229 -208
- data/aws-crt-ffi/crt/aws-lc/include/openssl/target.h +166 -0
- data/aws-crt-ffi/crt/aws-lc/include/openssl/x509.h +30 -10
- data/aws-crt-ffi/crt/aws-lc/include/openssl/x509v3.h +6 -4
- data/aws-crt-ffi/crt/aws-lc/sources.cmake +2 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/extensions.cc +12 -7
- data/aws-crt-ffi/crt/aws-lc/ssl/handshake_server.cc +28 -18
- data/aws-crt-ffi/crt/aws-lc/ssl/internal.h +41 -6
- data/aws-crt-ffi/crt/aws-lc/ssl/s3_both.cc +9 -17
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_cipher.cc +13 -5
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_key_share.cc +542 -2
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_lib.cc +35 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_test.cc +1847 -14
- data/aws-crt-ffi/crt/aws-lc/ssl/ssl_x509.cc +128 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/test/PORTING.md +10 -7
- data/aws-crt-ffi/crt/aws-lc/ssl/test/bssl_shim.cc +133 -77
- data/aws-crt-ffi/crt/aws-lc/ssl/test/handshake_util.cc +3 -3
- data/aws-crt-ffi/crt/aws-lc/ssl/test/handshaker.cc +4 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_client.go +6 -2
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_messages.go +894 -1042
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/handshake_server.go +24 -23
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/prf.go +6 -5
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/runner.go +56 -55
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/shim_dispatcher.go +188 -0
- data/aws-crt-ffi/crt/aws-lc/ssl/test/runner/ticket.go +37 -39
- data/aws-crt-ffi/crt/aws-lc/ssl/test/test_config.cc +59 -24
- data/aws-crt-ffi/crt/aws-lc/ssl/test/test_config.h +3 -2
- data/aws-crt-ffi/crt/aws-lc/ssl/tls13_server.cc +10 -11
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/app.py +4 -4
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/{aws_lc_mac_arm_ci_stack.py → aws_lc_ec2_test_framework_ci_stack.py} +13 -29
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/ssm/general_test_run_ssm_document.yaml +43 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/common_posix_setup.sh +10 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-aarch/amazonlinux-2023_base/Dockerfile +5 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-aarch/ubuntu-22.04_base/Dockerfile +19 -3
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/amazonlinux-2_gcc-7x-intel-sde/Dockerfile +5 -4
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/build_images.sh +1 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/push_images.sh +2 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-20.04_clang-10x_formal-verification/create_image.sh +1 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-22.04_base/Dockerfile +1 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/linux-x86/ubuntu-22.04_clang-14x-sde/Dockerfile +42 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/windows/vs2017/Dockerfile +14 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/docker_images/windows/windows_base/Dockerfile +3 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/README.md +12 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/nginx_patch/aws-lc-nginx.patch +68 -23
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/run_crt_integration.sh +27 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/run_monit_integration.sh +56 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/integration/sslproxy_patch/aws-lc-sslproxy.patch +2 -2
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_ec2_test_framework.sh +135 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_fips_tests.sh +14 -2
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_tests_with_sde.sh +4 -1
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_tests_with_sde_asan.sh +14 -0
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_windows_tests.bat +39 -3
- data/aws-crt-ffi/crt/aws-lc/third_party/fiat/README.md +21 -6
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519.S +284 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_madd_n25519_alt.S +210 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_mod_n25519.S +186 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/bignum_neg_p25519.S +65 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_alt.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_byte.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519_byte_alt.S +1043 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base.S +1042 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_alt.S +1042 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_byte.S +1042 -352
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/curve25519_x25519base_byte_alt.S +1043 -354
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_decode.S +700 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_decode_alt.S +563 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_encode.S +131 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmulbase.S +9626 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmulbase_alt.S +9468 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmuldouble.S +3157 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/curve25519/edwards25519_scalarmuldouble_alt.S +2941 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/p384/Makefile +1 -1
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/arm/p521/Makefile +1 -1
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/include/s2n-bignum_aws-lc.h +34 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_madd_n25519.S +219 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_madd_n25519_alt.S +245 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_mod_n25519.S +228 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/bignum_neg_p25519.S +86 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519.S +1350 -407
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519_alt.S +1350 -407
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519base.S +1344 -400
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/curve25519_x25519base_alt.S +1348 -402
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_decode.S +670 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_decode_alt.S +751 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_encode.S +81 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmulbase.S +9910 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmulbase_alt.S +9986 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmuldouble.S +3619 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/s2n-bignum/x86_att/curve25519/edwards25519_scalarmuldouble_alt.S +3736 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_224_test.json +1978 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_224_test.txt +1403 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_256_test.json +1993 -0
- data/aws-crt-ffi/crt/aws-lc/third_party/wycheproof_testvectors/hmac_sha512_256_test.txt +1416 -0
- data/aws-crt-ffi/crt/aws-lc/tool/digest.cc +4 -0
- data/aws-crt-ffi/crt/aws-lc/tool/internal.h +1 -0
- data/aws-crt-ffi/crt/aws-lc/tool/speed.cc +53 -6
- data/aws-crt-ffi/crt/aws-lc/util/all_tests.go +43 -12
- data/aws-crt-ffi/crt/aws-lc/util/all_tests.json +13 -5
- data/aws-crt-ffi/crt/aws-lc/util/bot/DEPS +4 -4
- data/aws-crt-ffi/crt/aws-lc/util/bot/update_clang.py +8 -2
- data/aws-crt-ffi/crt/aws-lc/util/codecov-ci.sh +82 -0
- data/aws-crt-ffi/crt/aws-lc/util/convert_wycheproof/convert_wycheproof.go +7 -5
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/ACVP.md +7 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/hash.go +24 -9
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/rsa.go +3 -4
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/subprocess/subprocess.go +15 -10
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/HMAC-SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHAKE-128.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/expected/SHAKE-256.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/sha512-224-tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/shake-128-tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/sha-tests/shake-256-tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/tests.json +1 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/HMAC-SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHA2-512-224.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHAKE-128.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/acvptool/test/vectors/SHAKE-256.bz2 +0 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/modulewrapper/main.cc +4 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/acvp/modulewrapper/modulewrapper.cc +144 -1
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/delocate.go +9 -3
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/testdata/aarch64-Basic/in.s +4 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/delocate/testdata/aarch64-Basic/out.s +11 -0
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/inject_hash/inject_hash.go +13 -4
- data/aws-crt-ffi/crt/aws-lc/util/fipstools/test-break-kat.sh +2 -0
- data/aws-crt-ffi/crt/aws-lc/util/testconfig/testconfig.go +2 -1
- data/aws-crt-ffi/crt/s2n/api/s2n.h +9 -5
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/handshake.rs +9 -6
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/resumption.rs +14 -14
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/benches/throughput.rs +9 -6
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/harness.rs +106 -102
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/openssl.rs +24 -20
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/rustls.rs +28 -24
- data/aws-crt-ffi/crt/s2n/bindings/rust/bench/src/s2n_tls.rs +52 -50
- data/aws-crt-ffi/crt/s2n/bindings/rust/generate/Cargo.toml +1 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/integration/Cargo.toml +3 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/Cargo.toml +2 -2
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/src/connection.rs +9 -0
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/templates/Cargo.template +2 -1
- data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/Cargo.toml +2 -2
- data/aws-crt-ffi/crt/s2n/tests/cbmc/sources/make_common_datastructures.c +9 -2
- data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_client_cert_verify_recv_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_hybrid_ecdhe_kyber_r3_fuzz_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/fuzz/s2n_tls13_cert_verify_recv_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_version_negotiation.py +4 -4
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_auth_selection_test.c +19 -9
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_auth_handshake_test.c +3 -3
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_cert_verify_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_recv_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_test.c +4 -4
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_signature_algorithms_extension_test.c +4 -5
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_protocol_versions_test.c +390 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_test.c +8 -4
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_handshake_test.c +2 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_quic_support_io_test.c +106 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_security_policies_test.c +6 -2
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_offload_signing_test.c +3 -3
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_session_resumption_test.c +135 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_server_new_session_ticket_test.c +32 -0
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_server_signature_algorithms_extension_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_signature_algorithms_test.c +307 -283
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_cert_request_test.c +1 -1
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_cert_verify_test.c +18 -17
- data/aws-crt-ffi/crt/s2n/tests/unit/s2n_x509_validator_test.c +125 -0
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_signature_algorithms.c +8 -1
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_supported_versions.c +43 -11
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_client_supported_versions.h +3 -0
- data/aws-crt-ffi/crt/s2n/tls/extensions/s2n_server_signature_algorithms.c +8 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_auth_selection.c +4 -2
- data/aws-crt-ffi/crt/s2n/tls/s2n_client_cert_verify.c +7 -10
- data/aws-crt-ffi/crt/s2n/tls/s2n_client_hello.c +2 -2
- data/aws-crt-ffi/crt/s2n/tls/s2n_connection.c +75 -14
- data/aws-crt-ffi/crt/s2n/tls/s2n_handshake.h +2 -2
- data/aws-crt-ffi/crt/s2n/tls/s2n_post_handshake.c +1 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_post_handshake.h +1 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.c +29 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.h +5 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_security_policies.c +40 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_security_policies.h +4 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_cert_request.c +1 -1
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_hello.c +0 -3
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_key_exchange.c +8 -9
- data/aws-crt-ffi/crt/s2n/tls/s2n_server_new_session_ticket.c +8 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_algorithms.c +111 -72
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_algorithms.h +11 -9
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_scheme.c +9 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_signature_scheme.h +2 -0
- data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_certificate_verify.c +12 -18
- data/aws-crt-ffi/crt/s2n/tls/s2n_x509_validator.c +7 -7
- data/aws-crt-ffi/src/api.h +1 -0
- data/lib/aws-crt/native.rb +1 -1
- metadata +68 -5
- data/aws-crt-ffi/crt/aws-lc/tests/ci/cdk/cdk/ssm/m1_tests_ssm_document.yaml +0 -34
- data/aws-crt-ffi/crt/aws-lc/tests/ci/run_m1_ec2_instance.sh +0 -96
@@ -36,6 +36,9 @@ const char *aws_signing_algorithm_to_string(enum aws_signing_algorithm algorithm
|
|
36
36
|
case AWS_SIGNING_ALGORITHM_V4:
|
37
37
|
return "SigV4";
|
38
38
|
|
39
|
+
case AWS_SIGNING_ALGORITHM_V4_S3EXPRESS:
|
40
|
+
return "SigV4S3Express";
|
41
|
+
|
39
42
|
case AWS_SIGNING_ALGORITHM_V4_ASYMMETRIC:
|
40
43
|
return "SigV4Asymmetric";
|
41
44
|
|
@@ -114,6 +117,28 @@ int aws_validate_aws_signing_config_aws(const struct aws_signing_config_aws *con
|
|
114
117
|
}
|
115
118
|
}
|
116
119
|
break;
|
120
|
+
case AWS_SIGNING_ALGORITHM_V4_S3EXPRESS:
|
121
|
+
if (config->credentials == NULL && config->credentials_provider == NULL) {
|
122
|
+
AWS_LOGF_ERROR(
|
123
|
+
AWS_LS_AUTH_SIGNING,
|
124
|
+
"(id=%p) Sigv4 S3 Express signing config is missing a credentials provider or credentials",
|
125
|
+
(void *)config);
|
126
|
+
return aws_raise_error(AWS_AUTH_SIGNING_INVALID_CONFIGURATION);
|
127
|
+
}
|
128
|
+
|
129
|
+
if (config->credentials != NULL) {
|
130
|
+
if (aws_credentials_is_anonymous(config->credentials) ||
|
131
|
+
aws_credentials_get_access_key_id(config->credentials).len == 0 ||
|
132
|
+
aws_credentials_get_secret_access_key(config->credentials).len == 0 ||
|
133
|
+
aws_credentials_get_session_token(config->credentials).len == 0) {
|
134
|
+
AWS_LOGF_ERROR(
|
135
|
+
AWS_LS_AUTH_SIGNING,
|
136
|
+
"(id=%p) Sigv4 S3 Express signing configured with invalid credentials",
|
137
|
+
(void *)config);
|
138
|
+
return aws_raise_error(AWS_AUTH_SIGNING_INVALID_CREDENTIALS);
|
139
|
+
}
|
140
|
+
}
|
141
|
+
break;
|
117
142
|
|
118
143
|
case AWS_SIGNING_ALGORITHM_V4_ASYMMETRIC:
|
119
144
|
if (config->credentials == NULL && config->credentials_provider == NULL) {
|
@@ -146,6 +146,8 @@ add_net_test_case(credentials_provider_sso_basic_success_after_failure)
|
|
146
146
|
add_test_case(imds_client_new_release)
|
147
147
|
add_test_case(imds_client_connect_failure)
|
148
148
|
add_test_case(imds_client_token_request_failure)
|
149
|
+
add_test_case(imds_client_insecure_fallback_request_failure)
|
150
|
+
add_test_case(imds_client_v1_fallback_disabled_failure)
|
149
151
|
add_test_case(imds_client_resource_request_failure)
|
150
152
|
add_test_case(imds_client_resource_request_success)
|
151
153
|
add_test_case(imds_client_insecure_resource_request_success)
|
@@ -156,6 +158,7 @@ add_test_case(imds_client_get_ancestor_ami_ids_success)
|
|
156
158
|
add_test_case(imds_client_get_iam_profile_success)
|
157
159
|
add_test_case(imds_client_get_instance_info_success)
|
158
160
|
add_test_case(imds_client_get_credentials_success)
|
161
|
+
add_test_case(imds_client_cache_token_refresh)
|
159
162
|
|
160
163
|
if(AWS_BUILDING_ON_EC2)
|
161
164
|
add_test_case(imds_client_real_success)
|
@@ -24,15 +24,16 @@
|
|
24
24
|
# pragma warning(disable : 4244)
|
25
25
|
#endif /* _MSC_VER */
|
26
26
|
|
27
|
-
#define IMDS_CLIENT_MAX_REQUESTS
|
27
|
+
#define IMDS_CLIENT_MAX_REQUESTS 15
|
28
28
|
struct aws_mock_imds_client_tester {
|
29
29
|
struct aws_byte_buf request_uris[IMDS_CLIENT_MAX_REQUESTS];
|
30
30
|
struct aws_array_list response_data_callbacks[IMDS_CLIENT_MAX_REQUESTS];
|
31
31
|
struct aws_allocator *allocator;
|
32
32
|
int current_request;
|
33
|
-
int
|
33
|
+
int response_code[IMDS_CLIENT_MAX_REQUESTS];
|
34
34
|
int token_request_idx;
|
35
|
-
|
35
|
+
int error_code;
|
36
|
+
uint64_t timestamp;
|
36
37
|
bool is_connection_acquire_successful;
|
37
38
|
|
38
39
|
struct aws_mutex lock;
|
@@ -199,11 +200,8 @@ static int s_aws_http_stream_get_incoming_response_status_mock(
|
|
199
200
|
const struct aws_http_stream *stream,
|
200
201
|
int *out_status_code) {
|
201
202
|
(void)stream;
|
202
|
-
if (s_tester.
|
203
|
-
*out_status_code = s_tester.
|
204
|
-
} else if (s_tester.current_request == 1 && s_tester.insecure_then_secure_attempt) {
|
205
|
-
/* for testing insecure then switch to secure way */
|
206
|
-
*out_status_code = AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED;
|
203
|
+
if (s_tester.response_code[s_tester.current_request - 1] != 0) {
|
204
|
+
*out_status_code = s_tester.response_code[s_tester.current_request - 1];
|
207
205
|
} else {
|
208
206
|
*out_status_code = AWS_HTTP_STATUS_CODE_200_OK;
|
209
207
|
}
|
@@ -219,6 +217,11 @@ static void s_aws_http_connection_close_mock(struct aws_http_connection *connect
|
|
219
217
|
(void)connection;
|
220
218
|
}
|
221
219
|
|
220
|
+
static int s_aws_high_res_clock_get_ticks_mock(uint64_t *timestamp) {
|
221
|
+
*timestamp = s_tester.timestamp;
|
222
|
+
return AWS_OP_SUCCESS;
|
223
|
+
}
|
224
|
+
|
222
225
|
static struct aws_auth_http_system_vtable s_mock_function_table = {
|
223
226
|
.aws_http_connection_manager_new = s_aws_http_connection_manager_new_mock,
|
224
227
|
.aws_http_connection_manager_release = s_aws_http_connection_manager_release_mock,
|
@@ -229,12 +232,16 @@ static struct aws_auth_http_system_vtable s_mock_function_table = {
|
|
229
232
|
.aws_http_stream_get_connection = s_aws_http_stream_get_connection_mock,
|
230
233
|
.aws_http_stream_get_incoming_response_status = s_aws_http_stream_get_incoming_response_status_mock,
|
231
234
|
.aws_http_stream_release = s_aws_http_stream_release_mock,
|
232
|
-
.aws_http_connection_close = s_aws_http_connection_close_mock
|
235
|
+
.aws_http_connection_close = s_aws_http_connection_close_mock,
|
236
|
+
.aws_high_res_clock_get_ticks = s_aws_high_res_clock_get_ticks_mock,
|
237
|
+
};
|
233
238
|
|
234
239
|
static int s_aws_imds_tester_init(struct aws_allocator *allocator) {
|
235
240
|
|
236
241
|
aws_auth_library_init(allocator);
|
237
242
|
|
243
|
+
AWS_ZERO_STRUCT(s_tester);
|
244
|
+
|
238
245
|
s_tester.allocator = allocator;
|
239
246
|
for (size_t i = 0; i < IMDS_CLIENT_MAX_REQUESTS; i++) {
|
240
247
|
if (aws_array_list_init_dynamic(
|
@@ -246,9 +253,6 @@ static int s_aws_imds_tester_init(struct aws_allocator *allocator) {
|
|
246
253
|
}
|
247
254
|
}
|
248
255
|
|
249
|
-
s_tester.token_response_code = 0;
|
250
|
-
s_tester.token_request_idx = 0;
|
251
|
-
s_tester.insecure_then_secure_attempt = false;
|
252
256
|
if (aws_mutex_init(&s_tester.lock)) {
|
253
257
|
return AWS_OP_ERR;
|
254
258
|
}
|
@@ -257,8 +261,6 @@ static int s_aws_imds_tester_init(struct aws_allocator *allocator) {
|
|
257
261
|
return AWS_OP_ERR;
|
258
262
|
}
|
259
263
|
|
260
|
-
s_tester.current_request = 0;
|
261
|
-
|
262
264
|
/* default to everything successful */
|
263
265
|
s_tester.is_connection_acquire_successful = true;
|
264
266
|
|
@@ -312,9 +314,9 @@ static void s_aws_wait_for_resource_result(void) {
|
|
312
314
|
|
313
315
|
static void s_get_resource_callback(const struct aws_byte_buf *resource, int error_code, void *user_data) {
|
314
316
|
(void)user_data;
|
315
|
-
(void)error_code;
|
316
317
|
aws_mutex_lock(&s_tester.lock);
|
317
318
|
s_tester.has_received_resource_callback = true;
|
319
|
+
s_tester.error_code = error_code;
|
318
320
|
if (resource && resource->len) {
|
319
321
|
struct aws_byte_cursor cursor = aws_byte_cursor_from_buf(resource);
|
320
322
|
aws_byte_buf_append_dynamic(&s_tester.resource, &cursor);
|
@@ -518,7 +520,7 @@ static int s_imds_client_token_request_failure(struct aws_allocator *allocator,
|
|
518
520
|
(void)ctx;
|
519
521
|
|
520
522
|
s_aws_imds_tester_init(allocator);
|
521
|
-
s_tester.
|
523
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_400_BAD_REQUEST;
|
522
524
|
struct aws_imds_client_options options = {
|
523
525
|
.bootstrap = s_tester.bootstrap,
|
524
526
|
.function_table = &s_mock_function_table,
|
@@ -558,14 +560,14 @@ static int s_imds_client_token_request_failure(struct aws_allocator *allocator,
|
|
558
560
|
|
559
561
|
AWS_TEST_CASE(imds_client_token_request_failure, s_imds_client_token_request_failure);
|
560
562
|
|
561
|
-
static int
|
563
|
+
static int s_imds_client_insecure_fallback_request_failure(struct aws_allocator *allocator, void *ctx) {
|
562
564
|
(void)ctx;
|
563
565
|
|
564
566
|
s_aws_imds_tester_init(allocator);
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
567
|
+
/* secure data flow is not supported, fallback to insecurity */
|
568
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_403_FORBIDDEN;
|
569
|
+
/* Insecurity fails as well */
|
570
|
+
s_tester.response_code[1] = AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED;
|
569
571
|
struct aws_imds_client_options options = {
|
570
572
|
.bootstrap = s_tester.bootstrap,
|
571
573
|
.function_table = &s_mock_function_table,
|
@@ -577,19 +579,21 @@ static int s_imds_client_resource_request_failure(struct aws_allocator *allocato
|
|
577
579
|
};
|
578
580
|
|
579
581
|
struct aws_imds_client *client = aws_imds_client_new(allocator, &options);
|
582
|
+
|
580
583
|
aws_imds_client_get_resource_async(
|
581
584
|
client, aws_byte_cursor_from_string(s_expected_imds_resource_uri), s_get_resource_callback, NULL);
|
582
585
|
|
583
586
|
s_aws_wait_for_resource_result();
|
584
587
|
|
588
|
+
ASSERT_TRUE(s_tester.has_received_resource_callback == true);
|
589
|
+
ASSERT_TRUE(s_tester.resource.len == 0);
|
590
|
+
|
585
591
|
ASSERT_TRUE(s_validate_uri_path_and_resource(2, false /*no resource*/) == 0);
|
586
592
|
ASSERT_TRUE(s_tester.token_ttl_header_exist[0]);
|
587
593
|
ASSERT_TRUE(s_tester.token_ttl_header_expected[0]);
|
588
594
|
ASSERT_FALSE(s_tester.token_header_exist[0]);
|
589
595
|
|
590
|
-
|
591
|
-
ASSERT_TRUE(s_tester.token_header_exist[1]);
|
592
|
-
ASSERT_TRUE(s_tester.token_header_expected[1]);
|
596
|
+
ASSERT_UINT_EQUALS(s_tester.error_code, AWS_AUTH_IMDS_CLIENT_SOURCE_FAILURE);
|
593
597
|
|
594
598
|
aws_imds_client_release(client);
|
595
599
|
|
@@ -599,10 +603,11 @@ static int s_imds_client_resource_request_failure(struct aws_allocator *allocato
|
|
599
603
|
aws_mem_release(allocator, client);
|
600
604
|
|
601
605
|
ASSERT_SUCCESS(s_aws_imds_tester_cleanup());
|
606
|
+
|
602
607
|
return 0;
|
603
608
|
}
|
604
609
|
|
605
|
-
AWS_TEST_CASE(
|
610
|
+
AWS_TEST_CASE(imds_client_insecure_fallback_request_failure, s_imds_client_insecure_fallback_request_failure);
|
606
611
|
|
607
612
|
AWS_STATIC_STRING_FROM_LITERAL(
|
608
613
|
s_good_response,
|
@@ -613,6 +618,104 @@ AWS_STATIC_STRING_FROM_LITERAL(s_secret_key, "SuccessfulSecret");
|
|
613
618
|
AWS_STATIC_STRING_FROM_LITERAL(s_token, "TokenSuccess");
|
614
619
|
AWS_STATIC_STRING_FROM_LITERAL(s_expiration, "2020-02-25T06:03:31Z");
|
615
620
|
|
621
|
+
static int s_imds_client_v1_fallback_disabled_failure(struct aws_allocator *allocator, void *ctx) {
|
622
|
+
(void)ctx;
|
623
|
+
|
624
|
+
s_aws_imds_tester_init(allocator);
|
625
|
+
/* secure data flow is not supported */
|
626
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_403_FORBIDDEN;
|
627
|
+
/* v1 would have worked if fallback was not disabled */
|
628
|
+
struct aws_byte_cursor good_response_cursor = aws_byte_cursor_from_string(s_good_response);
|
629
|
+
aws_array_list_push_back(&s_tester.response_data_callbacks[1], &good_response_cursor);
|
630
|
+
|
631
|
+
struct aws_imds_client_options options = {
|
632
|
+
.bootstrap = s_tester.bootstrap,
|
633
|
+
.function_table = &s_mock_function_table,
|
634
|
+
.ec2_metadata_v1_disabled = true,
|
635
|
+
.shutdown_options =
|
636
|
+
{
|
637
|
+
.shutdown_callback = s_on_shutdown_complete,
|
638
|
+
.shutdown_user_data = NULL,
|
639
|
+
},
|
640
|
+
};
|
641
|
+
|
642
|
+
struct aws_imds_client *client = aws_imds_client_new(allocator, &options);
|
643
|
+
|
644
|
+
aws_imds_client_get_resource_async(
|
645
|
+
client, aws_byte_cursor_from_string(s_expected_imds_resource_uri), s_get_resource_callback, NULL);
|
646
|
+
|
647
|
+
s_aws_wait_for_resource_result();
|
648
|
+
|
649
|
+
ASSERT_TRUE(s_tester.has_received_resource_callback == true);
|
650
|
+
ASSERT_TRUE(s_tester.resource.len == 0);
|
651
|
+
/* There was no fallback so we didn't get any resource */
|
652
|
+
ASSERT_TRUE(s_validate_uri_path_and_resource(1, false /*no resource*/) == 0);
|
653
|
+
ASSERT_TRUE(s_tester.token_ttl_header_exist[0]);
|
654
|
+
ASSERT_TRUE(s_tester.token_ttl_header_expected[0]);
|
655
|
+
ASSERT_FALSE(s_tester.token_header_exist[0]);
|
656
|
+
|
657
|
+
ASSERT_UINT_EQUALS(s_tester.error_code, AWS_AUTH_IMDS_CLIENT_SOURCE_FAILURE);
|
658
|
+
|
659
|
+
aws_imds_client_release(client);
|
660
|
+
|
661
|
+
s_aws_wait_for_imds_client_shutdown_callback();
|
662
|
+
|
663
|
+
/* Because we mock the http connection manager, we never get a callback back from it */
|
664
|
+
aws_mem_release(allocator, client);
|
665
|
+
|
666
|
+
ASSERT_SUCCESS(s_aws_imds_tester_cleanup());
|
667
|
+
|
668
|
+
return 0;
|
669
|
+
}
|
670
|
+
|
671
|
+
AWS_TEST_CASE(imds_client_v1_fallback_disabled_failure, s_imds_client_v1_fallback_disabled_failure);
|
672
|
+
|
673
|
+
static int s_imds_client_resource_request_failure(struct aws_allocator *allocator, void *ctx) {
|
674
|
+
(void)ctx;
|
675
|
+
|
676
|
+
s_aws_imds_tester_init(allocator);
|
677
|
+
|
678
|
+
struct aws_byte_cursor test_token_cursor = aws_byte_cursor_from_string(s_test_imds_token);
|
679
|
+
aws_array_list_push_back(&s_tester.response_data_callbacks[0], &test_token_cursor);
|
680
|
+
|
681
|
+
struct aws_imds_client_options options = {
|
682
|
+
.bootstrap = s_tester.bootstrap,
|
683
|
+
.function_table = &s_mock_function_table,
|
684
|
+
.shutdown_options =
|
685
|
+
{
|
686
|
+
.shutdown_callback = s_on_shutdown_complete,
|
687
|
+
.shutdown_user_data = NULL,
|
688
|
+
},
|
689
|
+
};
|
690
|
+
|
691
|
+
struct aws_imds_client *client = aws_imds_client_new(allocator, &options);
|
692
|
+
aws_imds_client_get_resource_async(
|
693
|
+
client, aws_byte_cursor_from_string(s_expected_imds_resource_uri), s_get_resource_callback, NULL);
|
694
|
+
|
695
|
+
s_aws_wait_for_resource_result();
|
696
|
+
|
697
|
+
ASSERT_TRUE(s_validate_uri_path_and_resource(2, false /*no resource*/) == 0);
|
698
|
+
ASSERT_TRUE(s_tester.token_ttl_header_exist[0]);
|
699
|
+
ASSERT_TRUE(s_tester.token_ttl_header_expected[0]);
|
700
|
+
ASSERT_FALSE(s_tester.token_header_exist[0]);
|
701
|
+
|
702
|
+
ASSERT_FALSE(s_tester.token_ttl_header_exist[1]);
|
703
|
+
ASSERT_TRUE(s_tester.token_header_exist[1]);
|
704
|
+
ASSERT_TRUE(s_tester.token_header_expected[1]);
|
705
|
+
|
706
|
+
aws_imds_client_release(client);
|
707
|
+
|
708
|
+
s_aws_wait_for_imds_client_shutdown_callback();
|
709
|
+
|
710
|
+
/* Because we mock the http connection manager, we never get a callback back from it */
|
711
|
+
aws_mem_release(allocator, client);
|
712
|
+
|
713
|
+
ASSERT_SUCCESS(s_aws_imds_tester_cleanup());
|
714
|
+
return 0;
|
715
|
+
}
|
716
|
+
|
717
|
+
AWS_TEST_CASE(imds_client_resource_request_failure, s_imds_client_resource_request_failure);
|
718
|
+
|
616
719
|
static int s_imds_client_resource_request_success(struct aws_allocator *allocator, void *ctx) {
|
617
720
|
(void)ctx;
|
618
721
|
|
@@ -670,7 +773,7 @@ static int s_imds_client_insecure_resource_request_success(struct aws_allocator
|
|
670
773
|
(void)ctx;
|
671
774
|
|
672
775
|
s_aws_imds_tester_init(allocator);
|
673
|
-
s_tester.
|
776
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_403_FORBIDDEN;
|
674
777
|
|
675
778
|
struct aws_byte_cursor good_response_cursor = aws_byte_cursor_from_string(s_good_response);
|
676
779
|
aws_array_list_push_back(&s_tester.response_data_callbacks[1], &good_response_cursor);
|
@@ -716,10 +819,8 @@ static int s_imds_client_insecure_then_secure_resource_request_success(struct aw
|
|
716
819
|
(void)ctx;
|
717
820
|
|
718
821
|
s_aws_imds_tester_init(allocator);
|
719
|
-
s_tester.insecure_then_secure_attempt = true;
|
720
822
|
s_tester.token_request_idx = 1;
|
721
|
-
s_tester.
|
722
|
-
|
823
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED;
|
723
824
|
struct aws_byte_cursor test_token_cursor = aws_byte_cursor_from_string(s_test_imds_token);
|
724
825
|
aws_array_list_push_back(&s_tester.response_data_callbacks[1], &test_token_cursor);
|
725
826
|
|
@@ -742,6 +843,7 @@ static int s_imds_client_insecure_then_secure_resource_request_success(struct aw
|
|
742
843
|
client, aws_byte_cursor_from_string(s_expected_imds_resource_uri), s_get_resource_callback, NULL);
|
743
844
|
s_aws_wait_for_resource_result();
|
744
845
|
|
846
|
+
ASSERT_TRUE(s_tester.has_received_resource_callback == true);
|
745
847
|
ASSERT_TRUE(s_validate_uri_path_and_resource(3, true /*no creds*/) == 0);
|
746
848
|
|
747
849
|
ASSERT_FALSE(s_tester.token_ttl_header_exist[0]);
|
@@ -777,9 +879,9 @@ static int s_aws_http_stream_get_multiple_incoming_response_status_mock(
|
|
777
879
|
int *out_status_code) {
|
778
880
|
|
779
881
|
(void)stream;
|
780
|
-
/* randomly return
|
882
|
+
/* randomly return 403/200 */
|
781
883
|
uint32_t rand_output;
|
782
|
-
int ret[2] = {AWS_HTTP_STATUS_CODE_200_OK,
|
884
|
+
int ret[2] = {AWS_HTTP_STATUS_CODE_200_OK, AWS_HTTP_STATUS_CODE_403_FORBIDDEN};
|
783
885
|
aws_device_random_u32(&rand_output);
|
784
886
|
*out_status_code = ret[rand_output % 2];
|
785
887
|
return AWS_OP_SUCCESS;
|
@@ -1385,3 +1487,67 @@ static int s_imds_client_get_credentials_success(struct aws_allocator *allocator
|
|
1385
1487
|
return 0;
|
1386
1488
|
}
|
1387
1489
|
AWS_TEST_CASE(imds_client_get_credentials_success, s_imds_client_get_credentials_success);
|
1490
|
+
|
1491
|
+
static int s_imds_client_cache_token_refresh(struct aws_allocator *allocator, void *ctx) {
|
1492
|
+
(void)ctx;
|
1493
|
+
|
1494
|
+
s_aws_imds_tester_init(allocator);
|
1495
|
+
|
1496
|
+
s_tester.timestamp = 0;
|
1497
|
+
|
1498
|
+
struct aws_byte_cursor test_token_cursor = aws_byte_cursor_from_string(s_test_imds_token);
|
1499
|
+
struct aws_byte_cursor good_response_cursor = aws_byte_cursor_from_string(s_good_response);
|
1500
|
+
|
1501
|
+
aws_array_list_push_back(&s_tester.response_data_callbacks[0], &test_token_cursor);
|
1502
|
+
aws_array_list_push_back(&s_tester.response_data_callbacks[1], &good_response_cursor);
|
1503
|
+
aws_array_list_push_back(&s_tester.response_data_callbacks[2], &good_response_cursor);
|
1504
|
+
aws_array_list_push_back(&s_tester.response_data_callbacks[3], &test_token_cursor);
|
1505
|
+
aws_array_list_push_back(&s_tester.response_data_callbacks[4], &good_response_cursor);
|
1506
|
+
|
1507
|
+
struct aws_imds_client_options options = {
|
1508
|
+
.bootstrap = s_tester.bootstrap,
|
1509
|
+
.function_table = &s_mock_function_table,
|
1510
|
+
.shutdown_options =
|
1511
|
+
{
|
1512
|
+
.shutdown_callback = s_on_shutdown_complete,
|
1513
|
+
.shutdown_user_data = NULL,
|
1514
|
+
},
|
1515
|
+
};
|
1516
|
+
|
1517
|
+
struct aws_imds_client *client = aws_imds_client_new(allocator, &options);
|
1518
|
+
/* 1. request a resource */
|
1519
|
+
aws_imds_client_get_credentials(client, aws_byte_cursor_from_c_str("test_role"), s_get_credentails_callback, NULL);
|
1520
|
+
s_aws_wait_for_resource_result();
|
1521
|
+
/* Currently have 2 requests, one to get the token, the other to fetch resource */
|
1522
|
+
ASSERT_UINT_EQUALS(2, s_tester.current_request);
|
1523
|
+
ASSERT_UINT_EQUALS(AWS_ERROR_SUCCESS, s_tester.error_code);
|
1524
|
+
|
1525
|
+
/* 2. Request another resource without change the timestamp. So that the cached token should be used */
|
1526
|
+
s_tester.has_received_resource_callback = false;
|
1527
|
+
aws_imds_client_get_credentials(client, aws_byte_cursor_from_c_str("test_role"), s_get_credentails_callback, NULL);
|
1528
|
+
s_aws_wait_for_resource_result();
|
1529
|
+
/* Currently have 3 requests, only one more to fetch the resource as the cached token being used. */
|
1530
|
+
ASSERT_UINT_EQUALS(3, s_tester.current_request);
|
1531
|
+
ASSERT_UINT_EQUALS(AWS_ERROR_SUCCESS, s_tester.error_code);
|
1532
|
+
|
1533
|
+
/* 3. Update the time to expired time. Request another resource without change the timestamp. So that the cached
|
1534
|
+
* token should be expired, and will fetch another token. */
|
1535
|
+
s_tester.has_received_resource_callback = false;
|
1536
|
+
s_tester.timestamp = aws_timestamp_convert(21600, AWS_TIMESTAMP_SECS, AWS_TIMESTAMP_NANOS, NULL);
|
1537
|
+
aws_imds_client_get_credentials(client, aws_byte_cursor_from_c_str("test_role"), s_get_credentails_callback, NULL);
|
1538
|
+
s_aws_wait_for_resource_result();
|
1539
|
+
/* Currently have 3 requests, only one more to fetch the resource as the cached token being used. */
|
1540
|
+
ASSERT_UINT_EQUALS(5, s_tester.current_request);
|
1541
|
+
ASSERT_UINT_EQUALS(AWS_ERROR_SUCCESS, s_tester.error_code);
|
1542
|
+
aws_imds_client_release(client);
|
1543
|
+
|
1544
|
+
s_aws_wait_for_imds_client_shutdown_callback();
|
1545
|
+
|
1546
|
+
/* Because we mock the http connection manager, we never get a callback back from it */
|
1547
|
+
aws_mem_release(allocator, client);
|
1548
|
+
|
1549
|
+
ASSERT_SUCCESS(s_aws_imds_tester_cleanup());
|
1550
|
+
|
1551
|
+
return 0;
|
1552
|
+
}
|
1553
|
+
AWS_TEST_CASE(imds_client_cache_token_refresh, s_imds_client_cache_token_refresh);
|
@@ -40,9 +40,9 @@ struct aws_mock_imds_tester {
|
|
40
40
|
struct aws_array_list response_data_callbacks[IMDS_MAX_REQUESTS];
|
41
41
|
|
42
42
|
int current_request;
|
43
|
-
int
|
43
|
+
int response_code[IMDS_MAX_REQUESTS];
|
44
44
|
int token_request_idx;
|
45
|
-
|
45
|
+
|
46
46
|
bool is_connection_acquire_successful;
|
47
47
|
|
48
48
|
struct aws_mutex lock;
|
@@ -213,11 +213,8 @@ static int s_aws_http_stream_get_incoming_response_status_mock(
|
|
213
213
|
const struct aws_http_stream *stream,
|
214
214
|
int *out_status_code) {
|
215
215
|
(void)stream;
|
216
|
-
if (s_tester.
|
217
|
-
*out_status_code = s_tester.
|
218
|
-
} else if (s_tester.current_request == 1 && s_tester.insecure_then_secure_attempt) {
|
219
|
-
/* for testing insecure then switch to secure way */
|
220
|
-
*out_status_code = AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED;
|
216
|
+
if (s_tester.response_code[s_tester.current_request - 1] != 0) {
|
217
|
+
*out_status_code = s_tester.response_code[s_tester.current_request - 1];
|
221
218
|
} else {
|
222
219
|
*out_status_code = AWS_HTTP_STATUS_CODE_200_OK;
|
223
220
|
}
|
@@ -233,6 +230,10 @@ static void s_aws_http_connection_close_mock(struct aws_http_connection *connect
|
|
233
230
|
(void)connection;
|
234
231
|
}
|
235
232
|
|
233
|
+
static int s_aws_high_res_clock_get_ticks_mock(uint64_t *timestamp) {
|
234
|
+
return aws_high_res_clock_get_ticks(timestamp);
|
235
|
+
}
|
236
|
+
|
236
237
|
static struct aws_auth_http_system_vtable s_mock_function_table = {
|
237
238
|
.aws_http_connection_manager_new = s_aws_http_connection_manager_new_mock,
|
238
239
|
.aws_http_connection_manager_release = s_aws_http_connection_manager_release_mock,
|
@@ -243,11 +244,14 @@ static struct aws_auth_http_system_vtable s_mock_function_table = {
|
|
243
244
|
.aws_http_stream_get_connection = s_aws_http_stream_get_connection_mock,
|
244
245
|
.aws_http_stream_get_incoming_response_status = s_aws_http_stream_get_incoming_response_status_mock,
|
245
246
|
.aws_http_stream_release = s_aws_http_stream_release_mock,
|
246
|
-
.aws_http_connection_close = s_aws_http_connection_close_mock
|
247
|
+
.aws_http_connection_close = s_aws_http_connection_close_mock,
|
248
|
+
.aws_high_res_clock_get_ticks = s_aws_high_res_clock_get_ticks_mock,
|
249
|
+
};
|
247
250
|
|
248
251
|
static int s_aws_imds_tester_init(struct aws_allocator *allocator) {
|
249
252
|
|
250
253
|
aws_auth_library_init(allocator);
|
254
|
+
AWS_ZERO_STRUCT(s_tester);
|
251
255
|
|
252
256
|
for (size_t i = 0; i < IMDS_MAX_REQUESTS; i++) {
|
253
257
|
if (aws_array_list_init_dynamic(
|
@@ -258,10 +262,8 @@ static int s_aws_imds_tester_init(struct aws_allocator *allocator) {
|
|
258
262
|
return AWS_OP_ERR;
|
259
263
|
}
|
260
264
|
}
|
265
|
+
|
261
266
|
s_tester.allocator = allocator;
|
262
|
-
s_tester.token_response_code = 0;
|
263
|
-
s_tester.token_request_idx = 0;
|
264
|
-
s_tester.insecure_then_secure_attempt = false;
|
265
267
|
if (aws_mutex_init(&s_tester.lock)) {
|
266
268
|
return AWS_OP_ERR;
|
267
269
|
}
|
@@ -270,11 +272,8 @@ static int s_aws_imds_tester_init(struct aws_allocator *allocator) {
|
|
270
272
|
return AWS_OP_ERR;
|
271
273
|
}
|
272
274
|
|
273
|
-
s_tester.current_request = 0;
|
274
|
-
|
275
275
|
/* default to everything successful */
|
276
276
|
s_tester.is_connection_acquire_successful = true;
|
277
|
-
s_tester.error_code = AWS_ERROR_SUCCESS;
|
278
277
|
|
279
278
|
s_tester.el_group = aws_event_loop_group_new_default(allocator, 1, NULL);
|
280
279
|
struct aws_client_bootstrap_options bootstrap_options = {
|
@@ -491,7 +490,7 @@ static int s_credentials_provider_imds_token_request_failure(struct aws_allocato
|
|
491
490
|
(void)ctx;
|
492
491
|
|
493
492
|
s_aws_imds_tester_init(allocator);
|
494
|
-
s_tester.
|
493
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_400_BAD_REQUEST;
|
495
494
|
struct aws_credentials_provider_imds_options options = {
|
496
495
|
.bootstrap = s_tester.bootstrap,
|
497
496
|
.function_table = &s_mock_function_table,
|
@@ -824,7 +823,7 @@ static int s_credentials_provider_imds_insecure_success(struct aws_allocator *al
|
|
824
823
|
(void)ctx;
|
825
824
|
|
826
825
|
s_aws_imds_tester_init(allocator);
|
827
|
-
s_tester.
|
826
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_403_FORBIDDEN;
|
828
827
|
|
829
828
|
struct aws_byte_cursor test_role_cursor = aws_byte_cursor_from_string(s_test_role_response);
|
830
829
|
aws_array_list_push_back(&s_tester.response_data_callbacks[1], &test_role_cursor);
|
@@ -882,9 +881,8 @@ static int s_credentials_provider_imds_insecure_then_secure_success(struct aws_a
|
|
882
881
|
(void)ctx;
|
883
882
|
|
884
883
|
s_aws_imds_tester_init(allocator);
|
885
|
-
s_tester.insecure_then_secure_attempt = true;
|
886
884
|
s_tester.token_request_idx = 1;
|
887
|
-
s_tester.
|
885
|
+
s_tester.response_code[0] = AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED;
|
888
886
|
|
889
887
|
struct aws_byte_cursor test_token_cursor = aws_byte_cursor_from_string(s_test_imds_token);
|
890
888
|
aws_array_list_push_back(&s_tester.response_data_callbacks[1], &test_token_cursor);
|
@@ -1527,6 +1527,9 @@ static int s_do_header_skip_test(
|
|
1527
1527
|
ASSERT_SUCCESS(s_parse_request(allocator, aws_byte_cursor_from_string(request_contents), &message, &body_stream));
|
1528
1528
|
struct aws_signable *signable = aws_signable_new_http_request(allocator, message);
|
1529
1529
|
|
1530
|
+
/* release reference to message early, to ensure signable keeps it alive */
|
1531
|
+
aws_http_message_release(message);
|
1532
|
+
|
1530
1533
|
struct aws_signing_state_aws *signing_state = aws_signing_state_new(allocator, &config, signable, NULL, NULL);
|
1531
1534
|
ASSERT_NOT_NULL(signing_state);
|
1532
1535
|
|
@@ -1539,7 +1542,6 @@ static int s_do_header_skip_test(
|
|
1539
1542
|
signing_state->canonical_request.len);
|
1540
1543
|
|
1541
1544
|
aws_input_stream_destroy(body_stream);
|
1542
|
-
aws_http_message_release(message);
|
1543
1545
|
aws_signing_state_destroy(signing_state);
|
1544
1546
|
aws_credentials_release(credentials);
|
1545
1547
|
aws_signable_destroy(signable);
|
@@ -1,10 +1,32 @@
|
|
1
1
|
#ifndef AWS_C_CAL_OPENSSLCRYPTO_COMMON_H
|
2
2
|
#define AWS_C_CAL_OPENSSLCRYPTO_COMMON_H
|
3
3
|
|
4
|
+
/**
|
5
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
6
|
+
* SPDX-License-Identifier: Apache-2.0.
|
7
|
+
*/
|
8
|
+
|
9
|
+
#define OPENSSL_SUPPRESS_DEPRECATED
|
4
10
|
#include <openssl/crypto.h>
|
5
11
|
#include <openssl/evp.h>
|
6
12
|
#include <openssl/hmac.h>
|
7
13
|
|
14
|
+
#if !defined(OPENSSL_IS_AWSLC) && !defined(OPENSSL_IS_BORINGSSL)
|
15
|
+
# define OPENSSL_IS_OPENSSL
|
16
|
+
#endif
|
17
|
+
|
18
|
+
/*
|
19
|
+
* There are some differences in function definitions between OpenSSL 1.0.2 and
|
20
|
+
* 1.1.1, aws-lc and boringssl.
|
21
|
+
* This file defines some common wrappers that abstract away those differences.
|
22
|
+
* For OpenSSL we currently support building against 1.0.2 or 1.1.1, and can
|
23
|
+
* detect version used at runtime and dyn load those symbols correctly.
|
24
|
+
* For OpenSSL 3.0 the code will compile and run, but largely because we disable
|
25
|
+
* deprecation warnings.
|
26
|
+
* For aws-lc and boringssl code must be compiled against the same version as
|
27
|
+
* the runtime lib.
|
28
|
+
*/
|
29
|
+
|
8
30
|
typedef HMAC_CTX *(*hmac_ctx_new)(void);
|
9
31
|
typedef void (*hmac_ctx_free)(HMAC_CTX *);
|
10
32
|
typedef void (*hmac_ctx_init)(HMAC_CTX *);
|