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
@@ -0,0 +1,30 @@
|
|
1
|
+
#ifndef AWS_COMMON_SYSTEM_RESOURCE_UTIL_H
|
2
|
+
#define AWS_COMMON_SYSTEM_RESOURCE_UTIL_H
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
6
|
+
* SPDX-License-Identifier: Apache-2.0.
|
7
|
+
*/
|
8
|
+
#include <aws/common/common.h>
|
9
|
+
|
10
|
+
AWS_PUSH_SANE_WARNING_LEVEL
|
11
|
+
|
12
|
+
AWS_EXTERN_C_BEGIN
|
13
|
+
|
14
|
+
struct aws_memory_usage_stats {
|
15
|
+
size_t maxrss; /* max resident set size in kilobytes since program start */
|
16
|
+
size_t page_faults; /* num of page faults since program start */
|
17
|
+
|
18
|
+
size_t _reserved[8];
|
19
|
+
};
|
20
|
+
|
21
|
+
/*
|
22
|
+
* Get memory usage for current process.
|
23
|
+
* Raises AWS_ERROR_SYS_CALL_FAILURE on failure.
|
24
|
+
*/
|
25
|
+
AWS_COMMON_API int aws_init_memory_usage_for_current_process(struct aws_memory_usage_stats *memory_usage);
|
26
|
+
|
27
|
+
AWS_EXTERN_C_END
|
28
|
+
AWS_POP_SANE_WARNING_LEVEL
|
29
|
+
|
30
|
+
#endif /* AWS_COMMON_SYSTEM_RESOURCE_UTIL_H */
|
@@ -474,10 +474,11 @@ static inline int s_aws_run_test_case(struct aws_test_harness *harness) {
|
|
474
474
|
* but aws_mem_tracer_dump() needs a valid logger to be active */
|
475
475
|
aws_logger_set(&err_logger);
|
476
476
|
|
477
|
-
const size_t
|
477
|
+
const size_t leaked_allocations = aws_mem_tracer_count(allocator);
|
478
|
+
const size_t leaked_bytes = aws_mem_tracer_bytes(allocator);
|
478
479
|
if (leaked_bytes) {
|
479
480
|
aws_mem_tracer_dump(allocator);
|
480
|
-
PRINT_FAIL_INTERNAL0("Test leaked memory: %zu bytes", leaked_bytes);
|
481
|
+
PRINT_FAIL_INTERNAL0("Test leaked memory: %zu bytes %zu allocations", leaked_bytes, leaked_allocations);
|
481
482
|
goto fail;
|
482
483
|
}
|
483
484
|
|
@@ -34,7 +34,7 @@ bool aws_allocator_is_valid(const struct aws_allocator *alloc) {
|
|
34
34
|
return alloc && AWS_OBJECT_PTR_IS_READABLE(alloc) && alloc->mem_acquire && alloc->mem_release;
|
35
35
|
}
|
36
36
|
|
37
|
-
static void *
|
37
|
+
static void *s_aligned_malloc(struct aws_allocator *allocator, size_t size) {
|
38
38
|
(void)allocator;
|
39
39
|
/* larger allocations should be aligned so that AVX and friends can avoid
|
40
40
|
* the extra preamble during unaligned versions of memcpy/memset on big buffers
|
@@ -62,7 +62,7 @@ static void *s_default_malloc(struct aws_allocator *allocator, size_t size) {
|
|
62
62
|
#endif
|
63
63
|
}
|
64
64
|
|
65
|
-
static void
|
65
|
+
static void s_aligned_free(struct aws_allocator *allocator, void *ptr) {
|
66
66
|
(void)allocator;
|
67
67
|
#if !defined(_WIN32)
|
68
68
|
free(ptr);
|
@@ -71,7 +71,7 @@ static void s_default_free(struct aws_allocator *allocator, void *ptr) {
|
|
71
71
|
#endif
|
72
72
|
}
|
73
73
|
|
74
|
-
static void *
|
74
|
+
static void *s_aligned_realloc(struct aws_allocator *allocator, void *ptr, size_t oldsize, size_t newsize) {
|
75
75
|
(void)allocator;
|
76
76
|
(void)oldsize;
|
77
77
|
AWS_FATAL_PRECONDITION(newsize);
|
@@ -82,12 +82,12 @@ static void *s_default_realloc(struct aws_allocator *allocator, void *ptr, size_
|
|
82
82
|
}
|
83
83
|
|
84
84
|
/* newsize is > oldsize, need more memory */
|
85
|
-
void *new_mem =
|
86
|
-
AWS_PANIC_OOM(new_mem, "Unhandled OOM encountered in
|
85
|
+
void *new_mem = s_aligned_malloc(allocator, newsize);
|
86
|
+
AWS_PANIC_OOM(new_mem, "Unhandled OOM encountered in s_aligned_malloc");
|
87
87
|
|
88
88
|
if (ptr) {
|
89
89
|
memcpy(new_mem, ptr, oldsize);
|
90
|
-
|
90
|
+
s_aligned_free(allocator, ptr);
|
91
91
|
}
|
92
92
|
|
93
93
|
return new_mem;
|
@@ -99,24 +99,75 @@ static void *s_default_realloc(struct aws_allocator *allocator, void *ptr, size_
|
|
99
99
|
#endif
|
100
100
|
}
|
101
101
|
|
102
|
-
static void *
|
103
|
-
void *mem =
|
104
|
-
AWS_PANIC_OOM(mem, "Unhandled OOM encountered in
|
102
|
+
static void *s_aligned_calloc(struct aws_allocator *allocator, size_t num, size_t size) {
|
103
|
+
void *mem = s_aligned_malloc(allocator, num * size);
|
104
|
+
AWS_PANIC_OOM(mem, "Unhandled OOM encountered in s_aligned_calloc");
|
105
105
|
memset(mem, 0, num * size);
|
106
106
|
return mem;
|
107
107
|
}
|
108
108
|
|
109
|
+
static void *s_non_aligned_malloc(struct aws_allocator *allocator, size_t size) {
|
110
|
+
(void)allocator;
|
111
|
+
void *result = malloc(size);
|
112
|
+
AWS_PANIC_OOM(result, "malloc failed to allocate memory");
|
113
|
+
return result;
|
114
|
+
}
|
115
|
+
|
116
|
+
static void s_non_aligned_free(struct aws_allocator *allocator, void *ptr) {
|
117
|
+
(void)allocator;
|
118
|
+
free(ptr);
|
119
|
+
}
|
120
|
+
|
121
|
+
static void *s_non_aligned_realloc(struct aws_allocator *allocator, void *ptr, size_t oldsize, size_t newsize) {
|
122
|
+
(void)allocator;
|
123
|
+
(void)oldsize;
|
124
|
+
AWS_FATAL_PRECONDITION(newsize);
|
125
|
+
|
126
|
+
if (newsize <= oldsize) {
|
127
|
+
return ptr;
|
128
|
+
}
|
129
|
+
|
130
|
+
/* newsize is > oldsize, need more memory */
|
131
|
+
void *new_mem = s_non_aligned_malloc(allocator, newsize);
|
132
|
+
AWS_PANIC_OOM(new_mem, "Unhandled OOM encountered in s_non_aligned_realloc");
|
133
|
+
|
134
|
+
if (ptr) {
|
135
|
+
memcpy(new_mem, ptr, oldsize);
|
136
|
+
s_non_aligned_free(allocator, ptr);
|
137
|
+
}
|
138
|
+
|
139
|
+
return new_mem;
|
140
|
+
}
|
141
|
+
|
142
|
+
static void *s_non_aligned_calloc(struct aws_allocator *allocator, size_t num, size_t size) {
|
143
|
+
(void)allocator;
|
144
|
+
void *mem = calloc(num, size);
|
145
|
+
AWS_PANIC_OOM(mem, "Unhandled OOM encountered in s_non_aligned_calloc");
|
146
|
+
return mem;
|
147
|
+
}
|
148
|
+
|
109
149
|
static struct aws_allocator default_allocator = {
|
110
|
-
.mem_acquire =
|
111
|
-
.mem_release =
|
112
|
-
.mem_realloc =
|
113
|
-
.mem_calloc =
|
150
|
+
.mem_acquire = s_non_aligned_malloc,
|
151
|
+
.mem_release = s_non_aligned_free,
|
152
|
+
.mem_realloc = s_non_aligned_realloc,
|
153
|
+
.mem_calloc = s_non_aligned_calloc,
|
114
154
|
};
|
115
155
|
|
116
156
|
struct aws_allocator *aws_default_allocator(void) {
|
117
157
|
return &default_allocator;
|
118
158
|
}
|
119
159
|
|
160
|
+
static struct aws_allocator aligned_allocator = {
|
161
|
+
.mem_acquire = s_aligned_malloc,
|
162
|
+
.mem_release = s_aligned_free,
|
163
|
+
.mem_realloc = s_aligned_realloc,
|
164
|
+
.mem_calloc = s_aligned_calloc,
|
165
|
+
};
|
166
|
+
|
167
|
+
struct aws_allocator *aws_aligned_allocator(void) {
|
168
|
+
return &aligned_allocator;
|
169
|
+
}
|
170
|
+
|
120
171
|
void *aws_mem_acquire(struct aws_allocator *allocator, size_t size) {
|
121
172
|
AWS_FATAL_PRECONDITION(allocator != NULL);
|
122
173
|
AWS_FATAL_PRECONDITION(allocator->mem_acquire != NULL);
|
@@ -5,9 +5,11 @@
|
|
5
5
|
|
6
6
|
#include <android/log.h>
|
7
7
|
|
8
|
+
#include <aws/common/clock.h>
|
8
9
|
#include <aws/common/logging.h>
|
9
10
|
#include <aws/common/string.h>
|
10
11
|
|
12
|
+
#include <inttypes.h>
|
11
13
|
#include <stdarg.h>
|
12
14
|
|
13
15
|
#define LOGCAT_MAX_BUFFER_SIZE (4 * 1024)
|
@@ -58,6 +60,18 @@ static int s_logcat_format(struct logcat_format_data *formatting_data, va_list a
|
|
58
60
|
current_index = s_advance_and_clamp_index(current_index, thread_id_written, fake_total_length);
|
59
61
|
}
|
60
62
|
|
63
|
+
if (current_index < fake_total_length) {
|
64
|
+
uint64_t now = 0;
|
65
|
+
aws_high_res_clock_get_ticks(&now);
|
66
|
+
|
67
|
+
int current_time_written = snprintf(
|
68
|
+
formatting_data->buffer + current_index, fake_total_length - current_index, "(HRC:%" PRIu64 ") ", now);
|
69
|
+
if (current_time_written < 0) {
|
70
|
+
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
|
71
|
+
}
|
72
|
+
current_index = s_advance_and_clamp_index(current_index, current_time_written, fake_total_length);
|
73
|
+
}
|
74
|
+
|
61
75
|
if (current_index < fake_total_length) {
|
62
76
|
int separator_written =
|
63
77
|
snprintf(formatting_data->buffer + current_index, fake_total_length - current_index, " - ");
|
@@ -323,15 +323,15 @@ void aws_common_library_init(struct aws_allocator *allocator) {
|
|
323
323
|
assumptions due to the way loaders and dlload are often implemented and those symbols are defined by things
|
324
324
|
like libpthread.so on some unix distros. Sorry about the memory usage here, but it's our only safe choice.
|
325
325
|
Also, please don't do numa configurations if memory is your economic bottleneck. */
|
326
|
-
g_libnuma_handle = dlopen("libnuma.so", RTLD_LOCAL);
|
326
|
+
g_libnuma_handle = dlopen("libnuma.so", RTLD_LAZY | RTLD_LOCAL);
|
327
327
|
|
328
328
|
/* turns out so versioning is really inconsistent these days */
|
329
329
|
if (!g_libnuma_handle) {
|
330
|
-
g_libnuma_handle = dlopen("libnuma.so.1", RTLD_LOCAL);
|
330
|
+
g_libnuma_handle = dlopen("libnuma.so.1", RTLD_LAZY | RTLD_LOCAL);
|
331
331
|
}
|
332
332
|
|
333
333
|
if (!g_libnuma_handle) {
|
334
|
-
g_libnuma_handle = dlopen("libnuma.so.2", RTLD_LOCAL);
|
334
|
+
g_libnuma_handle = dlopen("libnuma.so.2", RTLD_LAZY | RTLD_LOCAL);
|
335
335
|
}
|
336
336
|
|
337
337
|
if (g_libnuma_handle) {
|
@@ -11,6 +11,16 @@
|
|
11
11
|
|
12
12
|
#include <errno.h>
|
13
13
|
|
14
|
+
/* For "special files", the OS often lies about size.
|
15
|
+
* For example, on Amazon Linux 2:
|
16
|
+
* /proc/cpuinfo: size is 0, but contents are several KB of data.
|
17
|
+
* /sys/devices/virtual/dmi/id/product_name: size is 4096, but contents are "c5.2xlarge"
|
18
|
+
*
|
19
|
+
* Therefore, we may need to grow the buffer as we read until EOF.
|
20
|
+
* This is the min/max step size for growth. */
|
21
|
+
#define MIN_BUFFER_GROWTH_READING_FILES 32
|
22
|
+
#define MAX_BUFFER_GROWTH_READING_FILES 4096
|
23
|
+
|
14
24
|
FILE *aws_fopen(const char *file_path, const char *mode) {
|
15
25
|
if (!file_path || strlen(file_path) == 0) {
|
16
26
|
AWS_LOGF_ERROR(AWS_LS_COMMON_IO, "static: Failed to open file. path is empty");
|
@@ -34,7 +44,13 @@ FILE *aws_fopen(const char *file_path, const char *mode) {
|
|
34
44
|
return file;
|
35
45
|
}
|
36
46
|
|
37
|
-
|
47
|
+
/* Helper function used by aws_byte_buf_init_from_file() and aws_byte_buf_init_from_file_with_size_hint() */
|
48
|
+
static int s_byte_buf_init_from_file_impl(
|
49
|
+
struct aws_byte_buf *out_buf,
|
50
|
+
struct aws_allocator *alloc,
|
51
|
+
const char *filename,
|
52
|
+
bool use_file_size_as_hint,
|
53
|
+
size_t size_hint) {
|
38
54
|
|
39
55
|
AWS_ZERO_STRUCT(*out_buf);
|
40
56
|
FILE *fp = aws_fopen(filename, "rb");
|
@@ -42,46 +58,78 @@ int aws_byte_buf_init_from_file(struct aws_byte_buf *out_buf, struct aws_allocat
|
|
42
58
|
goto error;
|
43
59
|
}
|
44
60
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
61
|
+
if (use_file_size_as_hint) {
|
62
|
+
int64_t len64 = 0;
|
63
|
+
if (aws_file_get_length(fp, &len64)) {
|
64
|
+
AWS_LOGF_ERROR(
|
65
|
+
AWS_LS_COMMON_IO,
|
66
|
+
"static: Failed to get file length. file:'%s' error:%s",
|
67
|
+
filename,
|
68
|
+
aws_error_name(aws_last_error()));
|
69
|
+
goto error;
|
70
|
+
}
|
54
71
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
72
|
+
if (len64 >= SIZE_MAX) {
|
73
|
+
aws_raise_error(AWS_ERROR_OVERFLOW_DETECTED);
|
74
|
+
AWS_LOGF_ERROR(
|
75
|
+
AWS_LS_COMMON_IO,
|
76
|
+
"static: File too large to read into memory. file:'%s' error:%s",
|
77
|
+
filename,
|
78
|
+
aws_error_name(aws_last_error()));
|
79
|
+
goto error;
|
80
|
+
}
|
81
|
+
|
82
|
+
/* Leave space for null terminator at end of buffer */
|
83
|
+
size_hint = (size_t)len64 + 1;
|
63
84
|
}
|
64
85
|
|
65
|
-
|
66
|
-
|
86
|
+
aws_byte_buf_init(out_buf, alloc, size_hint);
|
87
|
+
|
88
|
+
/* Read in a loop until we hit EOF */
|
89
|
+
while (true) {
|
90
|
+
/* Expand buffer if necessary (at a reasonable rate) */
|
91
|
+
if (out_buf->len == out_buf->capacity) {
|
92
|
+
size_t additional_capacity = out_buf->capacity;
|
93
|
+
additional_capacity = aws_max_size(MIN_BUFFER_GROWTH_READING_FILES, additional_capacity);
|
94
|
+
additional_capacity = aws_min_size(MAX_BUFFER_GROWTH_READING_FILES, additional_capacity);
|
95
|
+
if (aws_byte_buf_reserve_relative(out_buf, additional_capacity)) {
|
96
|
+
AWS_LOGF_ERROR(AWS_LS_COMMON_IO, "static: Failed to grow buffer for file:'%s'", filename);
|
97
|
+
goto error;
|
98
|
+
}
|
99
|
+
}
|
67
100
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
out_buf->buffer[out_buf->len] = 0;
|
101
|
+
size_t space_available = out_buf->capacity - out_buf->len;
|
102
|
+
size_t bytes_read = fread(out_buf->buffer + out_buf->len, 1, space_available, fp);
|
103
|
+
out_buf->len += bytes_read;
|
72
104
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
errno_value
|
82
|
-
|
83
|
-
|
105
|
+
/* If EOF, we're done! */
|
106
|
+
if (feof(fp)) {
|
107
|
+
break;
|
108
|
+
}
|
109
|
+
|
110
|
+
/* If no EOF but we read 0 bytes, there's been an error or at least we need
|
111
|
+
* to treat it like one because we can't just infinitely loop. */
|
112
|
+
if (bytes_read == 0) {
|
113
|
+
int errno_value = ferror(fp) ? errno : 0; /* Always cache errno before potential side-effect */
|
114
|
+
aws_translate_and_raise_io_error_or(errno_value, AWS_ERROR_FILE_READ_FAILURE);
|
115
|
+
AWS_LOGF_ERROR(
|
116
|
+
AWS_LS_COMMON_IO,
|
117
|
+
"static: Failed reading file:'%s' errno:%d aws-error:%s",
|
118
|
+
filename,
|
119
|
+
errno_value,
|
120
|
+
aws_error_name(aws_last_error()));
|
121
|
+
goto error;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
/* A null terminator is appended, but is not included as part of the length field. */
|
126
|
+
if (out_buf->len == out_buf->capacity) {
|
127
|
+
if (aws_byte_buf_reserve_relative(out_buf, 1)) {
|
128
|
+
AWS_LOGF_ERROR(AWS_LS_COMMON_IO, "static: Failed to grow buffer for file:'%s'", filename);
|
129
|
+
goto error;
|
130
|
+
}
|
84
131
|
}
|
132
|
+
out_buf->buffer[out_buf->len] = 0;
|
85
133
|
|
86
134
|
fclose(fp);
|
87
135
|
return AWS_OP_SUCCESS;
|
@@ -94,6 +142,19 @@ error:
|
|
94
142
|
return AWS_OP_ERR;
|
95
143
|
}
|
96
144
|
|
145
|
+
int aws_byte_buf_init_from_file(struct aws_byte_buf *out_buf, struct aws_allocator *alloc, const char *filename) {
|
146
|
+
return s_byte_buf_init_from_file_impl(out_buf, alloc, filename, true /*use_file_size_as_hint*/, 0 /*size_hint*/);
|
147
|
+
}
|
148
|
+
|
149
|
+
int aws_byte_buf_init_from_file_with_size_hint(
|
150
|
+
struct aws_byte_buf *out_buf,
|
151
|
+
struct aws_allocator *alloc,
|
152
|
+
const char *filename,
|
153
|
+
size_t size_hint) {
|
154
|
+
|
155
|
+
return s_byte_buf_init_from_file_impl(out_buf, alloc, filename, false /*use_file_size_as_hint*/, size_hint);
|
156
|
+
}
|
157
|
+
|
97
158
|
bool aws_is_any_directory_separator(char value) {
|
98
159
|
return value == '\\' || value == '/';
|
99
160
|
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
3
|
+
* SPDX-License-Identifier: Apache-2.0.
|
4
|
+
*/
|
5
|
+
#include <aws/common/file.h>
|
6
|
+
#include <aws/common/private/system_info_priv.h>
|
7
|
+
|
8
|
+
int aws_system_environment_load_platform_impl(struct aws_system_environment *env) {
|
9
|
+
/* provide size_hint when reading "special files", since some platforms mis-report these files' size as 4KB */
|
10
|
+
aws_byte_buf_init_from_file_with_size_hint(
|
11
|
+
&env->virtualization_vendor, env->allocator, "/sys/devices/virtual/dmi/id/sys_vendor", 32 /*size_hint*/);
|
12
|
+
|
13
|
+
/* whether this one works depends on if this is a sysfs filesystem. If it fails, it will just be empty
|
14
|
+
* and these APIs are a best effort at the moment. We can add fallbacks as the loaders get more complicated. */
|
15
|
+
aws_byte_buf_init_from_file_with_size_hint(
|
16
|
+
&env->product_name, env->allocator, "/sys/devices/virtual/dmi/id/product_name", 32 /*size_hint*/);
|
17
|
+
|
18
|
+
return AWS_OP_SUCCESS;
|
19
|
+
}
|
20
|
+
|
21
|
+
void aws_system_environment_destroy_platform_impl(struct aws_system_environment *env) {
|
22
|
+
aws_byte_buf_clean_up(&env->virtualization_vendor);
|
23
|
+
aws_byte_buf_clean_up(&env->product_name);
|
24
|
+
}
|
@@ -438,11 +438,18 @@ static void s_trace_mem_release(struct aws_allocator *allocator, void *ptr) {
|
|
438
438
|
static void *s_trace_mem_realloc(struct aws_allocator *allocator, void *old_ptr, size_t old_size, size_t new_size) {
|
439
439
|
struct alloc_tracer *tracer = allocator->impl;
|
440
440
|
void *new_ptr = old_ptr;
|
441
|
-
if (aws_mem_realloc(tracer->traced_allocator, &new_ptr, old_size, new_size)) {
|
442
|
-
return NULL;
|
443
|
-
}
|
444
441
|
|
442
|
+
/*
|
443
|
+
* Careful with the ordering of state clean up here.
|
444
|
+
* Tracer keeps a hash table (alloc ptr as key) of meta info about each allocation.
|
445
|
+
* To avoid race conditions during realloc state update needs to be done in
|
446
|
+
* following order to avoid race conditions:
|
447
|
+
* - remove meta info (other threads cant reuse that key, cause ptr is still valid )
|
448
|
+
* - realloc (cant fail, ptr might remain the same)
|
449
|
+
* - add meta info for reallocated mem
|
450
|
+
*/
|
445
451
|
s_alloc_tracer_untrack(tracer, old_ptr);
|
452
|
+
aws_mem_realloc(tracer->traced_allocator, &new_ptr, old_size, new_size);
|
446
453
|
s_alloc_tracer_track(tracer, new_ptr, new_size);
|
447
454
|
|
448
455
|
return new_ptr;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
3
|
+
* SPDX-License-Identifier: Apache-2.0.
|
4
|
+
*/
|
5
|
+
#include <aws/common/private/system_info_priv.h>
|
6
|
+
|
7
|
+
#include <aws/common/logging.h>
|
8
|
+
|
9
|
+
int aws_system_environment_load_platform_impl(struct aws_system_environment *env) {
|
10
|
+
(void)env;
|
11
|
+
AWS_LOGF_DEBUG(
|
12
|
+
AWS_LS_COMMON_GENERAL,
|
13
|
+
"id=%p: platform specific environment loading is not implemented for this platform.",
|
14
|
+
(void *)env);
|
15
|
+
|
16
|
+
return AWS_OP_SUCCESS;
|
17
|
+
}
|
18
|
+
|
19
|
+
void aws_system_environment_destroy_platform_impl(struct aws_system_environment *env) {
|
20
|
+
(void)env;
|
21
|
+
}
|
@@ -0,0 +1,141 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
3
|
+
* SPDX-License-Identifier: Apache-2.0.
|
4
|
+
*/
|
5
|
+
#include <aws/common/cross_process_lock.h>
|
6
|
+
|
7
|
+
#include <aws/common/byte_buf.h>
|
8
|
+
#include <errno.h>
|
9
|
+
#include <fcntl.h>
|
10
|
+
#include <sys/file.h>
|
11
|
+
#include <sys/stat.h>
|
12
|
+
#include <unistd.h>
|
13
|
+
|
14
|
+
#include <aws/common/error.h>
|
15
|
+
#include <aws/common/file.h>
|
16
|
+
#include <aws/common/logging.h>
|
17
|
+
|
18
|
+
struct aws_cross_process_lock {
|
19
|
+
struct aws_allocator *allocator;
|
20
|
+
int locked_fd;
|
21
|
+
};
|
22
|
+
|
23
|
+
struct aws_cross_process_lock *aws_cross_process_lock_try_acquire(
|
24
|
+
struct aws_allocator *allocator,
|
25
|
+
struct aws_byte_cursor instance_nonce) {
|
26
|
+
|
27
|
+
/* validate we don't have a directory slash. */
|
28
|
+
struct aws_byte_cursor to_find = aws_byte_cursor_from_c_str("/");
|
29
|
+
struct aws_byte_cursor found;
|
30
|
+
AWS_ZERO_STRUCT(found);
|
31
|
+
if (aws_byte_cursor_find_exact(&instance_nonce, &to_find, &found) != AWS_OP_ERR &&
|
32
|
+
aws_last_error() != AWS_ERROR_STRING_MATCH_NOT_FOUND) {
|
33
|
+
AWS_LOGF_ERROR(
|
34
|
+
AWS_LS_COMMON_GENERAL,
|
35
|
+
"static: Lock " PRInSTR "creation has illegal character /",
|
36
|
+
AWS_BYTE_CURSOR_PRI(instance_nonce));
|
37
|
+
aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
|
38
|
+
return NULL;
|
39
|
+
}
|
40
|
+
|
41
|
+
/*
|
42
|
+
* The unix standard says /tmp has to be there and be writable. However, while it may be tempting to just use the
|
43
|
+
* /tmp/ directory, it often has the sticky bit set which would prevent a subprocess from being able to call open
|
44
|
+
* with create on the file. The solution is simple, just write it to a subdirectory inside
|
45
|
+
* /tmp and override umask via. chmod of 0777.
|
46
|
+
*/
|
47
|
+
struct aws_byte_cursor path_prefix = aws_byte_cursor_from_c_str("/tmp/aws_crt_cross_process_lock/");
|
48
|
+
struct aws_string *path_to_create = aws_string_new_from_cursor(allocator, &path_prefix);
|
49
|
+
|
50
|
+
/* It's probably there already and we don't care if it is. */
|
51
|
+
if (!aws_directory_exists(path_to_create)) {
|
52
|
+
/* if this call fails just let it fail on open below. */
|
53
|
+
aws_directory_create(path_to_create);
|
54
|
+
/* bypass umask by setting the perms we actually requested */
|
55
|
+
chmod(aws_string_c_str(path_to_create), S_IRWXU | S_IRWXG | S_IRWXO);
|
56
|
+
}
|
57
|
+
aws_string_destroy(path_to_create);
|
58
|
+
|
59
|
+
struct aws_byte_cursor path_suffix = aws_byte_cursor_from_c_str(".lock");
|
60
|
+
|
61
|
+
struct aws_byte_buf nonce_buf;
|
62
|
+
aws_byte_buf_init_copy_from_cursor(&nonce_buf, allocator, path_prefix);
|
63
|
+
aws_byte_buf_append_dynamic(&nonce_buf, &instance_nonce);
|
64
|
+
aws_byte_buf_append_dynamic(&nonce_buf, &path_suffix);
|
65
|
+
aws_byte_buf_append_null_terminator(&nonce_buf);
|
66
|
+
|
67
|
+
struct aws_cross_process_lock *instance_lock = NULL;
|
68
|
+
|
69
|
+
errno = 0;
|
70
|
+
int fd = open((const char *)nonce_buf.buffer, O_CREAT | O_RDWR, 0666);
|
71
|
+
if (fd < 0) {
|
72
|
+
AWS_LOGF_DEBUG(
|
73
|
+
AWS_LS_COMMON_GENERAL,
|
74
|
+
"static: Lock file %s failed to open with errno %d",
|
75
|
+
(const char *)nonce_buf.buffer,
|
76
|
+
errno);
|
77
|
+
|
78
|
+
aws_translate_and_raise_io_error_or(errno, AWS_ERROR_MUTEX_FAILED);
|
79
|
+
|
80
|
+
if (aws_last_error() == AWS_ERROR_NO_PERMISSION) {
|
81
|
+
AWS_LOGF_DEBUG(
|
82
|
+
AWS_LS_COMMON_GENERAL,
|
83
|
+
"static: Lock file %s couldn't be opened due to file ownership permissions. Attempting to open as read "
|
84
|
+
"only",
|
85
|
+
(const char *)nonce_buf.buffer);
|
86
|
+
|
87
|
+
errno = 0;
|
88
|
+
fd = open((const char *)nonce_buf.buffer, O_RDONLY);
|
89
|
+
|
90
|
+
if (fd < 0) {
|
91
|
+
AWS_LOGF_ERROR(
|
92
|
+
AWS_LS_COMMON_GENERAL,
|
93
|
+
"static: Lock file %s failed to open with read-only permissions with errno %d",
|
94
|
+
(const char *)nonce_buf.buffer,
|
95
|
+
errno);
|
96
|
+
aws_translate_and_raise_io_error_or(errno, AWS_ERROR_MUTEX_FAILED);
|
97
|
+
goto cleanup;
|
98
|
+
}
|
99
|
+
} else {
|
100
|
+
AWS_LOGF_ERROR(
|
101
|
+
AWS_LS_COMMON_GENERAL,
|
102
|
+
"static: Lock file %s failed to open. The lock cannot be acquired.",
|
103
|
+
(const char *)nonce_buf.buffer);
|
104
|
+
goto cleanup;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
if (flock(fd, LOCK_EX | LOCK_NB) == -1) {
|
109
|
+
AWS_LOGF_TRACE(
|
110
|
+
AWS_LS_COMMON_GENERAL,
|
111
|
+
"static: Lock file %s already acquired by another instance",
|
112
|
+
(const char *)nonce_buf.buffer);
|
113
|
+
close(fd);
|
114
|
+
aws_raise_error(AWS_ERROR_MUTEX_CALLER_NOT_OWNER);
|
115
|
+
goto cleanup;
|
116
|
+
}
|
117
|
+
|
118
|
+
instance_lock = aws_mem_calloc(allocator, 1, sizeof(struct aws_cross_process_lock));
|
119
|
+
instance_lock->locked_fd = fd;
|
120
|
+
instance_lock->allocator = allocator;
|
121
|
+
|
122
|
+
AWS_LOGF_TRACE(
|
123
|
+
AWS_LS_COMMON_GENERAL,
|
124
|
+
"static: Lock file %s acquired by this instance with fd %d",
|
125
|
+
(const char *)nonce_buf.buffer,
|
126
|
+
fd);
|
127
|
+
|
128
|
+
cleanup:
|
129
|
+
aws_byte_buf_clean_up(&nonce_buf);
|
130
|
+
|
131
|
+
return instance_lock;
|
132
|
+
}
|
133
|
+
|
134
|
+
void aws_cross_process_lock_release(struct aws_cross_process_lock *instance_lock) {
|
135
|
+
if (instance_lock) {
|
136
|
+
flock(instance_lock->locked_fd, LOCK_UN);
|
137
|
+
close(instance_lock->locked_fd);
|
138
|
+
AWS_LOGF_TRACE(AWS_LS_COMMON_GENERAL, "static: Lock file released for fd %d", instance_lock->locked_fd);
|
139
|
+
aws_mem_release(instance_lock->allocator, instance_lock);
|
140
|
+
}
|
141
|
+
}
|
@@ -50,7 +50,7 @@ size_t aws_system_info_processor_count(void) {
|
|
50
50
|
|
51
51
|
uint16_t aws_get_cpu_group_count(void) {
|
52
52
|
if (g_numa_num_configured_nodes_ptr) {
|
53
|
-
return (uint16_t)g_numa_num_configured_nodes_ptr();
|
53
|
+
return aws_max_u16(1, (uint16_t)g_numa_num_configured_nodes_ptr());
|
54
54
|
}
|
55
55
|
|
56
56
|
return 1U;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
3
|
+
* SPDX-License-Identifier: Apache-2.0.
|
4
|
+
*/
|
5
|
+
|
6
|
+
#include <aws/common/system_resource_util.h>
|
7
|
+
|
8
|
+
#include <sys/resource.h>
|
9
|
+
|
10
|
+
int aws_init_memory_usage_for_current_process(struct aws_memory_usage_stats *memory_usage) {
|
11
|
+
AWS_PRECONDITION(memory_usage);
|
12
|
+
|
13
|
+
AWS_ZERO_STRUCT(*memory_usage);
|
14
|
+
struct rusage usage;
|
15
|
+
|
16
|
+
if (getrusage(RUSAGE_SELF, &usage)) {
|
17
|
+
return aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
|
18
|
+
}
|
19
|
+
|
20
|
+
#if defined(AWS_OS_APPLE)
|
21
|
+
/*
|
22
|
+
* For some reason Apple switched to reporting this in bytes instead of KB
|
23
|
+
* around MacOS 10.6.
|
24
|
+
* Make it back to KB. Result might be slightly off due to rounding.
|
25
|
+
*/
|
26
|
+
memory_usage->maxrss = usage.ru_maxrss / 1024;
|
27
|
+
#else
|
28
|
+
memory_usage->maxrss = usage.ru_maxrss;
|
29
|
+
#endif
|
30
|
+
memory_usage->page_faults = usage.ru_majflt;
|
31
|
+
return AWS_OP_SUCCESS;
|
32
|
+
}
|
@@ -400,3 +400,27 @@ size_t aws_priority_queue_size(const struct aws_priority_queue *queue) {
|
|
400
400
|
size_t aws_priority_queue_capacity(const struct aws_priority_queue *queue) {
|
401
401
|
return aws_array_list_capacity(&queue->container);
|
402
402
|
}
|
403
|
+
|
404
|
+
void aws_priority_queue_clear(struct aws_priority_queue *queue) {
|
405
|
+
AWS_PRECONDITION(aws_priority_queue_is_valid(queue));
|
406
|
+
size_t backpointer_count = aws_array_list_length(&queue->backpointers);
|
407
|
+
for (size_t i = 0; i < backpointer_count; ++i) {
|
408
|
+
struct aws_priority_queue_node *node = NULL;
|
409
|
+
aws_array_list_get_at(&queue->backpointers, &node, i);
|
410
|
+
if (node != NULL) {
|
411
|
+
node->current_index = SIZE_MAX;
|
412
|
+
}
|
413
|
+
}
|
414
|
+
|
415
|
+
aws_array_list_clear(&queue->backpointers);
|
416
|
+
aws_array_list_clear(&queue->container);
|
417
|
+
AWS_PRECONDITION(aws_priority_queue_is_valid(queue));
|
418
|
+
}
|
419
|
+
|
420
|
+
void aws_priority_queue_node_init(struct aws_priority_queue_node *node) {
|
421
|
+
node->current_index = SIZE_MAX;
|
422
|
+
}
|
423
|
+
|
424
|
+
bool aws_priority_queue_node_is_in_queue(const struct aws_priority_queue_node *node) {
|
425
|
+
return node->current_index != SIZE_MAX;
|
426
|
+
}
|