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
@@ -20,6 +20,7 @@ import (
|
|
20
20
|
"time"
|
21
21
|
|
22
22
|
"boringssl.googlesource.com/boringssl/ssl/test/runner/hpke"
|
23
|
+
"golang.org/x/crypto/cryptobyte"
|
23
24
|
)
|
24
25
|
|
25
26
|
// serverHandshakeState contains details of a server handshake in progress.
|
@@ -2435,18 +2436,18 @@ func checkClientHellosEqual(a, b []byte, isDTLS bool, ignoreExtensions []uint16)
|
|
2435
2436
|
}
|
2436
2437
|
|
2437
2438
|
// Skip the handshake message header.
|
2438
|
-
aReader :=
|
2439
|
-
bReader :=
|
2439
|
+
aReader := cryptobyte.String(a[4:])
|
2440
|
+
bReader := cryptobyte.String(b[4:])
|
2440
2441
|
|
2441
2442
|
var aVers, bVers uint16
|
2442
2443
|
var aRandom, bRandom []byte
|
2443
2444
|
var aSessionID, bSessionID []byte
|
2444
|
-
if !aReader.
|
2445
|
-
!bReader.
|
2446
|
-
!aReader.
|
2447
|
-
!bReader.
|
2448
|
-
!
|
2449
|
-
!
|
2445
|
+
if !aReader.ReadUint16(&aVers) ||
|
2446
|
+
!bReader.ReadUint16(&bVers) ||
|
2447
|
+
!aReader.ReadBytes(&aRandom, 32) ||
|
2448
|
+
!bReader.ReadBytes(&bRandom, 32) ||
|
2449
|
+
!readUint8LengthPrefixedBytes(&aReader, &aSessionID) ||
|
2450
|
+
!readUint8LengthPrefixedBytes(&bReader, &bSessionID) {
|
2450
2451
|
return errors.New("tls: could not parse ClientHello")
|
2451
2452
|
}
|
2452
2453
|
|
@@ -2466,17 +2467,17 @@ func checkClientHellosEqual(a, b []byte, isDTLS bool, ignoreExtensions []uint16)
|
|
2466
2467
|
// cookie altogether. If we implement DTLS 1.3, we'll need to ensure
|
2467
2468
|
// that parsing logic above this function rejects this cookie.
|
2468
2469
|
var aCookie, bCookie []byte
|
2469
|
-
if !
|
2470
|
-
!
|
2470
|
+
if !readUint8LengthPrefixedBytes(&aReader, &aCookie) ||
|
2471
|
+
!readUint8LengthPrefixedBytes(&bReader, &bCookie) {
|
2471
2472
|
return errors.New("tls: could not parse ClientHello")
|
2472
2473
|
}
|
2473
2474
|
}
|
2474
2475
|
|
2475
2476
|
var aCipherSuites, bCipherSuites, aCompressionMethods, bCompressionMethods []byte
|
2476
|
-
if !
|
2477
|
-
!
|
2478
|
-
!
|
2479
|
-
!
|
2477
|
+
if !readUint16LengthPrefixedBytes(&aReader, &aCipherSuites) ||
|
2478
|
+
!readUint16LengthPrefixedBytes(&bReader, &bCipherSuites) ||
|
2479
|
+
!readUint8LengthPrefixedBytes(&aReader, &aCompressionMethods) ||
|
2480
|
+
!readUint8LengthPrefixedBytes(&bReader, &bCompressionMethods) {
|
2480
2481
|
return errors.New("tls: could not parse ClientHello")
|
2481
2482
|
}
|
2482
2483
|
if !bytes.Equal(aCipherSuites, bCipherSuites) {
|
@@ -2491,9 +2492,9 @@ func checkClientHellosEqual(a, b []byte, isDTLS bool, ignoreExtensions []uint16)
|
|
2491
2492
|
return nil
|
2492
2493
|
}
|
2493
2494
|
|
2494
|
-
var aExtensions, bExtensions
|
2495
|
-
if !aReader.
|
2496
|
-
!bReader.
|
2495
|
+
var aExtensions, bExtensions cryptobyte.String
|
2496
|
+
if !aReader.ReadUint16LengthPrefixed(&aExtensions) ||
|
2497
|
+
!bReader.ReadUint16LengthPrefixed(&bExtensions) ||
|
2497
2498
|
len(aReader) != 0 ||
|
2498
2499
|
len(bReader) != 0 {
|
2499
2500
|
return errors.New("tls: could not parse ClientHello")
|
@@ -2502,8 +2503,8 @@ func checkClientHellosEqual(a, b []byte, isDTLS bool, ignoreExtensions []uint16)
|
|
2502
2503
|
for len(aExtensions) != 0 {
|
2503
2504
|
var aID uint16
|
2504
2505
|
var aBody []byte
|
2505
|
-
if !aExtensions.
|
2506
|
-
!
|
2506
|
+
if !aExtensions.ReadUint16(&aID) ||
|
2507
|
+
!readUint16LengthPrefixedBytes(&aExtensions, &aBody) {
|
2507
2508
|
return errors.New("tls: could not parse ClientHello")
|
2508
2509
|
}
|
2509
2510
|
if _, ok := ignoreExtensionsSet[aID]; ok {
|
@@ -2516,8 +2517,8 @@ func checkClientHellosEqual(a, b []byte, isDTLS bool, ignoreExtensions []uint16)
|
|
2516
2517
|
}
|
2517
2518
|
var bID uint16
|
2518
2519
|
var bBody []byte
|
2519
|
-
if !bExtensions.
|
2520
|
-
!
|
2520
|
+
if !bExtensions.ReadUint16(&bID) ||
|
2521
|
+
!readUint16LengthPrefixedBytes(&bExtensions, &bBody) {
|
2521
2522
|
return errors.New("tls: could not parse ClientHello")
|
2522
2523
|
}
|
2523
2524
|
if _, ok := ignoreExtensionsSet[bID]; ok {
|
@@ -2538,8 +2539,8 @@ func checkClientHellosEqual(a, b []byte, isDTLS bool, ignoreExtensions []uint16)
|
|
2538
2539
|
for len(bExtensions) != 0 {
|
2539
2540
|
var id uint16
|
2540
2541
|
var body []byte
|
2541
|
-
if !bExtensions.
|
2542
|
-
!
|
2542
|
+
if !bExtensions.ReadUint16(&id) ||
|
2543
|
+
!readUint16LengthPrefixedBytes(&bExtensions, &body) {
|
2543
2544
|
return errors.New("tls: could not parse ClientHello")
|
2544
2545
|
}
|
2545
2546
|
if _, ok := ignoreExtensionsSet[id]; !ok {
|
@@ -13,6 +13,7 @@ import (
|
|
13
13
|
"encoding"
|
14
14
|
"hash"
|
15
15
|
|
16
|
+
"golang.org/x/crypto/cryptobyte"
|
16
17
|
"golang.org/x/crypto/hkdf"
|
17
18
|
)
|
18
19
|
|
@@ -228,15 +229,15 @@ type finishedHash struct {
|
|
228
229
|
}
|
229
230
|
|
230
231
|
func (h *finishedHash) UpdateForHelloRetryRequest() {
|
231
|
-
data :=
|
232
|
-
data.
|
233
|
-
data.
|
234
|
-
data.
|
232
|
+
data := cryptobyte.NewBuilder(nil)
|
233
|
+
data.AddUint8(typeMessageHash)
|
234
|
+
data.AddUint24(uint32(h.hash.Size()))
|
235
|
+
data.AddBytes(h.Sum())
|
235
236
|
h.hash = h.suite.hash().New()
|
236
237
|
if h.buffer != nil {
|
237
238
|
h.buffer = []byte{}
|
238
239
|
}
|
239
|
-
h.Write(data.
|
240
|
+
h.Write(data.BytesOrPanic())
|
240
241
|
}
|
241
242
|
|
242
243
|
func (h *finishedHash) Write(msg []byte) (n int, err error) {
|
@@ -48,6 +48,7 @@ import (
|
|
48
48
|
"boringssl.googlesource.com/boringssl/ssl/test/runner/hpke"
|
49
49
|
"boringssl.googlesource.com/boringssl/ssl/test/runner/ssl_transfer"
|
50
50
|
"boringssl.googlesource.com/boringssl/util/testresult"
|
51
|
+
"golang.org/x/crypto/cryptobyte"
|
51
52
|
)
|
52
53
|
|
53
54
|
var (
|
@@ -860,10 +861,10 @@ func doExchange(test *testCase, config *Config, conn net.Conn, isResume bool, tr
|
|
860
861
|
if err := os.MkdirAll(dir, 0755); err != nil {
|
861
862
|
return err
|
862
863
|
}
|
863
|
-
bb :=
|
864
|
-
bb
|
865
|
-
bb.
|
866
|
-
return os.WriteFile(filepath.Join(dir, name), bb.
|
864
|
+
bb := cryptobyte.NewBuilder(nil)
|
865
|
+
addUint24LengthPrefixedBytes(bb, encodedInner)
|
866
|
+
bb.AddBytes(outer)
|
867
|
+
return os.WriteFile(filepath.Join(dir, name), bb.BytesOrPanic(), 0644)
|
867
868
|
}
|
868
869
|
}
|
869
870
|
|
@@ -1289,9 +1290,12 @@ var (
|
|
1289
1290
|
)
|
1290
1291
|
|
1291
1292
|
type shimProcess struct {
|
1292
|
-
cmd
|
1293
|
-
|
1294
|
-
|
1293
|
+
cmd *exec.Cmd
|
1294
|
+
// done is closed when the process has exited. At that point, childErr may be
|
1295
|
+
// read for the result.
|
1296
|
+
done chan struct{}
|
1297
|
+
childErr error
|
1298
|
+
listener *shimListener
|
1295
1299
|
stdout, stderr bytes.Buffer
|
1296
1300
|
// default value is false.
|
1297
1301
|
// This is marked as true in |(s *shimProcess) wait()|.
|
@@ -1301,28 +1305,32 @@ type shimProcess struct {
|
|
1301
1305
|
// newShimProcess starts a new shim with the specified executable, flags, and
|
1302
1306
|
// environment. It internally creates a TCP listener and adds the the -port
|
1303
1307
|
// flag.
|
1304
|
-
func newShimProcess(shimPath string, flags []string, env []string) (*shimProcess, error) {
|
1305
|
-
|
1306
|
-
var err error
|
1307
|
-
shim.listener, err = net.ListenTCP("tcp", &net.TCPAddr{IP: net.IPv6loopback})
|
1308
|
-
if err != nil {
|
1309
|
-
shim.listener, err = net.ListenTCP("tcp4", &net.TCPAddr{IP: net.IP{127, 0, 0, 1}})
|
1310
|
-
}
|
1308
|
+
func newShimProcess(dispatcher *shimDispatcher, shimPath string, flags []string, env []string) (*shimProcess, error) {
|
1309
|
+
listener, err := dispatcher.NewShim()
|
1311
1310
|
if err != nil {
|
1312
1311
|
return nil, err
|
1313
1312
|
}
|
1314
1313
|
|
1315
|
-
|
1314
|
+
shim := &shimProcess{listener: listener}
|
1315
|
+
cmdFlags := []string{
|
1316
|
+
"-port", strconv.Itoa(listener.Port()),
|
1317
|
+
"-shim-id", strconv.FormatUint(listener.ShimID(), 10),
|
1318
|
+
}
|
1319
|
+
if listener.IsIPv6() {
|
1320
|
+
cmdFlags = append(cmdFlags, "-ipv6")
|
1321
|
+
}
|
1322
|
+
cmdFlags = append(cmdFlags, flags...)
|
1323
|
+
|
1316
1324
|
if *useValgrind {
|
1317
|
-
shim.cmd = valgrindOf(false, shimPath,
|
1325
|
+
shim.cmd = valgrindOf(false, shimPath, cmdFlags...)
|
1318
1326
|
} else if *useGDB {
|
1319
|
-
shim.cmd = gdbOf(shimPath,
|
1327
|
+
shim.cmd = gdbOf(shimPath, cmdFlags...)
|
1320
1328
|
} else if *useLLDB {
|
1321
|
-
shim.cmd = lldbOf(shimPath,
|
1329
|
+
shim.cmd = lldbOf(shimPath, cmdFlags...)
|
1322
1330
|
} else if *useRR {
|
1323
|
-
shim.cmd = rrOf(shimPath,
|
1331
|
+
shim.cmd = rrOf(shimPath, cmdFlags...)
|
1324
1332
|
} else {
|
1325
|
-
shim.cmd = exec.Command(shimPath,
|
1333
|
+
shim.cmd = exec.Command(shimPath, cmdFlags...)
|
1326
1334
|
}
|
1327
1335
|
shim.cmd.Stdin = os.Stdin
|
1328
1336
|
shim.cmd.Stdout = &shim.stdout
|
@@ -1334,37 +1342,24 @@ func newShimProcess(shimPath string, flags []string, env []string) (*shimProcess
|
|
1334
1342
|
return nil, err
|
1335
1343
|
}
|
1336
1344
|
shim.idled = false
|
1337
|
-
|
1338
|
-
|
1345
|
+
|
1346
|
+
shim.done = make(chan struct{})
|
1347
|
+
go func() {
|
1348
|
+
shim.childErr = shim.cmd.Wait()
|
1349
|
+
shim.listener.Close()
|
1350
|
+
close(shim.done)
|
1351
|
+
}()
|
1339
1352
|
return shim, nil
|
1340
1353
|
}
|
1341
1354
|
|
1342
1355
|
// accept returns a new TCP connection with the shim process, or returns an
|
1343
1356
|
// error on timeout or shim exit.
|
1344
1357
|
func (s *shimProcess) accept() (net.Conn, error) {
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
}
|
1349
|
-
connChan := make(chan connOrError, 1)
|
1350
|
-
go func() {
|
1351
|
-
if !useDebugger() {
|
1352
|
-
s.listener.SetDeadline(time.Now().Add(*idleTimeout))
|
1353
|
-
}
|
1354
|
-
conn, err := s.listener.Accept()
|
1355
|
-
connChan <- connOrError{conn, err}
|
1356
|
-
close(connChan)
|
1357
|
-
}()
|
1358
|
-
select {
|
1359
|
-
case result := <-connChan:
|
1360
|
-
return result.conn, result.err
|
1361
|
-
case childErr := <-s.waitChan:
|
1362
|
-
s.waitChan <- childErr
|
1363
|
-
if childErr == nil {
|
1364
|
-
return nil, fmt.Errorf("child exited early with no error")
|
1365
|
-
}
|
1366
|
-
return nil, fmt.Errorf("child exited early: %s", childErr)
|
1358
|
+
var deadline time.Time
|
1359
|
+
if !useDebugger() {
|
1360
|
+
deadline = time.Now().Add(*idleTimeout)
|
1367
1361
|
}
|
1362
|
+
return s.listener.Accept(deadline)
|
1368
1363
|
}
|
1369
1364
|
|
1370
1365
|
// wait finishes the test and waits for the shim process to exit.
|
@@ -1387,9 +1382,8 @@ func (s *shimProcess) wait() error {
|
|
1387
1382
|
defer waitTimeout.Stop()
|
1388
1383
|
}
|
1389
1384
|
|
1390
|
-
|
1391
|
-
s.
|
1392
|
-
return err
|
1385
|
+
<-s.done
|
1386
|
+
return s.childErr
|
1393
1387
|
}
|
1394
1388
|
|
1395
1389
|
// close releases resources associated with the shimProcess. This is safe to
|
@@ -1479,7 +1473,7 @@ const shimInitialWrite = "hello"
|
|
1479
1473
|
// the test name is renamed with (|test.name| + |SSL_TRANSFER_SUFFIX|).
|
1480
1474
|
const SSL_TRANSFER_SUFFIX = "-SSL_Transfer"
|
1481
1475
|
|
1482
|
-
func runTest(statusChan chan statusMsg, test *testCase, shimPath string, mallocNumToFail int64) error {
|
1476
|
+
func runTest(dispatcher *shimDispatcher, statusChan chan statusMsg, test *testCase, shimPath string, mallocNumToFail int64) error {
|
1483
1477
|
// Help debugging panics on the Go side.
|
1484
1478
|
defer func() {
|
1485
1479
|
if r := recover(); r != nil {
|
@@ -1690,7 +1684,7 @@ func runTest(statusChan chan statusMsg, test *testCase, shimPath string, mallocN
|
|
1690
1684
|
env = append(env, "_MALLOC_CHECK=1")
|
1691
1685
|
}
|
1692
1686
|
|
1693
|
-
shim, err := newShimProcess(shimPath, flags, env)
|
1687
|
+
shim, err := newShimProcess(dispatcher, shimPath, flags, env)
|
1694
1688
|
if err != nil {
|
1695
1689
|
return err
|
1696
1690
|
}
|
@@ -1703,7 +1697,7 @@ func runTest(statusChan chan statusMsg, test *testCase, shimPath string, mallocN
|
|
1703
1697
|
// shim is marked as idled only when |idleTimeout| is reached.
|
1704
1698
|
// This retry fix is scoped with "InvalidChannelIDSignature-TLS13-TLS-Sync-SplitHandshakeRecords".
|
1705
1699
|
if shim.idled && test.name == "InvalidChannelIDSignature-TLS13-TLS-Sync-SplitHandshakeRecords" {
|
1706
|
-
shim, err
|
1700
|
+
shim, err := newShimProcess(dispatcher, shimPath, flags, env)
|
1707
1701
|
if err != nil {
|
1708
1702
|
return err
|
1709
1703
|
}
|
@@ -19840,7 +19834,7 @@ func addMultipleCertSlotTests() {
|
|
19840
19834
|
}
|
19841
19835
|
}
|
19842
19836
|
|
19843
|
-
func worker(statusChan chan statusMsg, c chan *testCase, shimPath string, wg *sync.WaitGroup) {
|
19837
|
+
func worker(dispatcher *shimDispatcher, statusChan chan statusMsg, c chan *testCase, shimPath string, wg *sync.WaitGroup) {
|
19844
19838
|
defer wg.Done()
|
19845
19839
|
|
19846
19840
|
for test := range c {
|
@@ -19849,7 +19843,7 @@ func worker(statusChan chan statusMsg, c chan *testCase, shimPath string, wg *sy
|
|
19849
19843
|
if *mallocTest >= 0 {
|
19850
19844
|
for mallocNumToFail := int64(*mallocTest); ; mallocNumToFail++ {
|
19851
19845
|
statusChan <- statusMsg{test: test, statusType: statusStarted}
|
19852
|
-
if err = runTest(statusChan, test, shimPath, mallocNumToFail); err != errMoreMallocs {
|
19846
|
+
if err = runTest(dispatcher, statusChan, test, shimPath, mallocNumToFail); err != errMoreMallocs {
|
19853
19847
|
if err != nil {
|
19854
19848
|
fmt.Printf("\n\nmalloc test failed at %d: %s\n", mallocNumToFail, err)
|
19855
19849
|
}
|
@@ -19859,11 +19853,11 @@ func worker(statusChan chan statusMsg, c chan *testCase, shimPath string, wg *sy
|
|
19859
19853
|
} else if *repeatUntilFailure {
|
19860
19854
|
for err == nil {
|
19861
19855
|
statusChan <- statusMsg{test: test, statusType: statusStarted}
|
19862
|
-
err = runTest(statusChan, test, shimPath, -1)
|
19856
|
+
err = runTest(dispatcher, statusChan, test, shimPath, -1)
|
19863
19857
|
}
|
19864
19858
|
} else {
|
19865
19859
|
statusChan <- statusMsg{test: test, statusType: statusStarted}
|
19866
|
-
err = runTest(statusChan, test, shimPath, -1)
|
19860
|
+
err = runTest(dispatcher, statusChan, test, shimPath, -1)
|
19867
19861
|
}
|
19868
19862
|
statusChan <- statusMsg{test: test, statusType: statusDone, err: err}
|
19869
19863
|
}
|
@@ -20197,6 +20191,13 @@ func main() {
|
|
20197
20191
|
|
20198
20192
|
checkTests()
|
20199
20193
|
|
20194
|
+
dispatcher, err := newShimDispatcher()
|
20195
|
+
if err != nil {
|
20196
|
+
fmt.Fprintf(os.Stderr, "Error opening socket: %s", err)
|
20197
|
+
os.Exit(1)
|
20198
|
+
}
|
20199
|
+
defer dispatcher.Close()
|
20200
|
+
|
20200
20201
|
numWorkers := *numWorkersFlag
|
20201
20202
|
if useDebugger() {
|
20202
20203
|
numWorkers = 1
|
@@ -20211,7 +20212,7 @@ func main() {
|
|
20211
20212
|
var wg sync.WaitGroup
|
20212
20213
|
for i := 0; i < numWorkers; i++ {
|
20213
20214
|
wg.Add(1)
|
20214
|
-
go worker(statusChan, testChan, *shimPath, &wg)
|
20215
|
+
go worker(dispatcher, statusChan, testChan, *shimPath, &wg)
|
20215
20216
|
}
|
20216
20217
|
|
20217
20218
|
var oneOfPatternIfAny, noneOfPattern []string
|
@@ -0,0 +1,188 @@
|
|
1
|
+
// Copyright (c) 2023, Google Inc.
|
2
|
+
//
|
3
|
+
// Permission to use, copy, modify, and/or distribute this software for any
|
4
|
+
// purpose with or without fee is hereby granted, provided that the above
|
5
|
+
// copyright notice and this permission notice appear in all copies.
|
6
|
+
//
|
7
|
+
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
8
|
+
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
+
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
10
|
+
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
+
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
12
|
+
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
13
|
+
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
+
|
15
|
+
package runner
|
16
|
+
|
17
|
+
import (
|
18
|
+
"context"
|
19
|
+
"encoding/binary"
|
20
|
+
"fmt"
|
21
|
+
"io"
|
22
|
+
"net"
|
23
|
+
"os"
|
24
|
+
"sync"
|
25
|
+
"time"
|
26
|
+
)
|
27
|
+
|
28
|
+
type shimDispatcher struct {
|
29
|
+
lock sync.Mutex
|
30
|
+
nextShimID uint64
|
31
|
+
listener *net.TCPListener
|
32
|
+
shims map[uint64]*shimListener
|
33
|
+
err error
|
34
|
+
}
|
35
|
+
|
36
|
+
func newShimDispatcher() (*shimDispatcher, error) {
|
37
|
+
listener, err := net.ListenTCP("tcp", &net.TCPAddr{IP: net.IPv6loopback})
|
38
|
+
if err != nil {
|
39
|
+
listener, err = net.ListenTCP("tcp4", &net.TCPAddr{IP: net.IP{127, 0, 0, 1}})
|
40
|
+
}
|
41
|
+
|
42
|
+
if err != nil {
|
43
|
+
return nil, err
|
44
|
+
}
|
45
|
+
d := &shimDispatcher{listener: listener, shims: make(map[uint64]*shimListener)}
|
46
|
+
go d.acceptLoop()
|
47
|
+
return d, nil
|
48
|
+
}
|
49
|
+
|
50
|
+
func (d *shimDispatcher) NewShim() (*shimListener, error) {
|
51
|
+
d.lock.Lock()
|
52
|
+
defer d.lock.Unlock()
|
53
|
+
if d.err != nil {
|
54
|
+
return nil, d.err
|
55
|
+
}
|
56
|
+
|
57
|
+
l := &shimListener{dispatcher: d, shimID: d.nextShimID, connChan: make(chan net.Conn, 1)}
|
58
|
+
d.shims[l.shimID] = l
|
59
|
+
d.nextShimID++
|
60
|
+
return l, nil
|
61
|
+
}
|
62
|
+
|
63
|
+
func (d *shimDispatcher) unregisterShim(l *shimListener) {
|
64
|
+
d.lock.Lock()
|
65
|
+
delete(d.shims, l.shimID)
|
66
|
+
d.lock.Unlock()
|
67
|
+
}
|
68
|
+
|
69
|
+
func (d *shimDispatcher) acceptLoop() {
|
70
|
+
for {
|
71
|
+
conn, err := d.listener.Accept()
|
72
|
+
if err != nil {
|
73
|
+
// Something went wrong. Shut down the listener.
|
74
|
+
d.closeWithError(err)
|
75
|
+
return
|
76
|
+
}
|
77
|
+
|
78
|
+
go func() {
|
79
|
+
if err := d.dispatch(conn); err != nil {
|
80
|
+
// To be robust against port scanners, etc., we log a warning
|
81
|
+
// but otherwise treat undispatchable connections as non-fatal.
|
82
|
+
fmt.Fprintf(os.Stderr, "Error dispatching connection: %s\n", err)
|
83
|
+
conn.Close()
|
84
|
+
}
|
85
|
+
}()
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
func (d *shimDispatcher) dispatch(conn net.Conn) error {
|
90
|
+
conn.SetReadDeadline(time.Now().Add(*idleTimeout))
|
91
|
+
var buf [8]byte
|
92
|
+
if _, err := io.ReadFull(conn, buf[:]); err != nil {
|
93
|
+
return err
|
94
|
+
}
|
95
|
+
conn.SetReadDeadline(time.Time{})
|
96
|
+
|
97
|
+
shimID := binary.LittleEndian.Uint64(buf[:])
|
98
|
+
d.lock.Lock()
|
99
|
+
shim, ok := d.shims[shimID]
|
100
|
+
d.lock.Unlock()
|
101
|
+
if !ok {
|
102
|
+
return fmt.Errorf("shim ID %d not found", shimID)
|
103
|
+
}
|
104
|
+
|
105
|
+
shim.connChan <- conn
|
106
|
+
return nil
|
107
|
+
}
|
108
|
+
|
109
|
+
func (d *shimDispatcher) Close() error {
|
110
|
+
return d.closeWithError(net.ErrClosed)
|
111
|
+
}
|
112
|
+
|
113
|
+
func (d *shimDispatcher) closeWithError(err error) error {
|
114
|
+
closeErr := d.listener.Close()
|
115
|
+
|
116
|
+
d.lock.Lock()
|
117
|
+
shims := d.shims
|
118
|
+
d.shims = make(map[uint64]*shimListener)
|
119
|
+
d.err = err
|
120
|
+
d.lock.Unlock()
|
121
|
+
|
122
|
+
for _, shim := range shims {
|
123
|
+
shim.closeWithError(err)
|
124
|
+
}
|
125
|
+
return closeErr
|
126
|
+
}
|
127
|
+
|
128
|
+
type shimListener struct {
|
129
|
+
dispatcher *shimDispatcher
|
130
|
+
shimID uint64
|
131
|
+
// connChan contains connections from the dispatcher. On fatal error, it is
|
132
|
+
// closed, with the error available in err.
|
133
|
+
connChan chan net.Conn
|
134
|
+
err error
|
135
|
+
lock sync.Mutex
|
136
|
+
}
|
137
|
+
|
138
|
+
func (l *shimListener) Port() int {
|
139
|
+
return l.dispatcher.listener.Addr().(*net.TCPAddr).Port
|
140
|
+
}
|
141
|
+
|
142
|
+
func (l *shimListener) IsIPv6() bool {
|
143
|
+
return len(l.dispatcher.listener.Addr().(*net.TCPAddr).IP) == net.IPv6len
|
144
|
+
}
|
145
|
+
|
146
|
+
func (l *shimListener) ShimID() uint64 {
|
147
|
+
return l.shimID
|
148
|
+
}
|
149
|
+
|
150
|
+
func (l *shimListener) Close() error {
|
151
|
+
l.dispatcher.unregisterShim(l)
|
152
|
+
l.closeWithError(net.ErrClosed)
|
153
|
+
return nil
|
154
|
+
}
|
155
|
+
|
156
|
+
func (l *shimListener) closeWithError(err error) {
|
157
|
+
// Multiple threads may close the listener at once, so protect closing with
|
158
|
+
// a lock.
|
159
|
+
l.lock.Lock()
|
160
|
+
if l.err == nil {
|
161
|
+
l.err = err
|
162
|
+
close(l.connChan)
|
163
|
+
}
|
164
|
+
l.lock.Unlock()
|
165
|
+
}
|
166
|
+
|
167
|
+
func (l *shimListener) Accept(deadline time.Time) (net.Conn, error) {
|
168
|
+
var timerChan <-chan time.Time
|
169
|
+
if !deadline.IsZero() {
|
170
|
+
remaining := time.Until(deadline)
|
171
|
+
if remaining < 0 {
|
172
|
+
return nil, context.DeadlineExceeded
|
173
|
+
}
|
174
|
+
timer := time.NewTimer(remaining)
|
175
|
+
defer timer.Stop()
|
176
|
+
timerChan = timer.C
|
177
|
+
}
|
178
|
+
|
179
|
+
select {
|
180
|
+
case <-timerChan:
|
181
|
+
return nil, context.DeadlineExceeded
|
182
|
+
case conn, ok := <-l.connChan:
|
183
|
+
if !ok {
|
184
|
+
return nil, l.err
|
185
|
+
}
|
186
|
+
return conn, nil
|
187
|
+
}
|
188
|
+
}
|
@@ -13,6 +13,8 @@ import (
|
|
13
13
|
"errors"
|
14
14
|
"io"
|
15
15
|
"time"
|
16
|
+
|
17
|
+
"golang.org/x/crypto/cryptobyte"
|
16
18
|
)
|
17
19
|
|
18
20
|
// sessionState contains the information that is serialized into a session
|
@@ -35,49 +37,45 @@ type sessionState struct {
|
|
35
37
|
}
|
36
38
|
|
37
39
|
func (s *sessionState) marshal() []byte {
|
38
|
-
msg :=
|
39
|
-
msg.
|
40
|
-
msg.
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
handshakeHash.addBytes(s.handshakeHash)
|
45
|
-
msg.addU16(uint16(len(s.certificates)))
|
40
|
+
msg := cryptobyte.NewBuilder(nil)
|
41
|
+
msg.AddUint16(s.vers)
|
42
|
+
msg.AddUint16(s.cipherSuite)
|
43
|
+
addUint16LengthPrefixedBytes(msg, s.secret)
|
44
|
+
addUint16LengthPrefixedBytes(msg, s.handshakeHash)
|
45
|
+
msg.AddUint16(uint16(len(s.certificates)))
|
46
46
|
for _, cert := range s.certificates {
|
47
|
-
|
48
|
-
certMsg.addBytes(cert)
|
47
|
+
addUint24LengthPrefixedBytes(msg, cert)
|
49
48
|
}
|
50
49
|
|
51
50
|
if s.extendedMasterSecret {
|
52
|
-
msg.
|
51
|
+
msg.AddUint8(1)
|
53
52
|
} else {
|
54
|
-
msg.
|
53
|
+
msg.AddUint8(0)
|
55
54
|
}
|
56
55
|
|
57
56
|
if s.vers >= VersionTLS13 {
|
58
|
-
msg.
|
59
|
-
msg.
|
60
|
-
msg.
|
61
|
-
msg.
|
57
|
+
msg.AddUint64(uint64(s.ticketCreationTime.UnixNano()))
|
58
|
+
msg.AddUint64(uint64(s.ticketExpiration.UnixNano()))
|
59
|
+
msg.AddUint32(s.ticketFlags)
|
60
|
+
msg.AddUint32(s.ticketAgeAdd)
|
62
61
|
}
|
63
62
|
|
64
|
-
|
65
|
-
earlyALPN.addBytes(s.earlyALPN)
|
63
|
+
addUint16LengthPrefixedBytes(msg, s.earlyALPN)
|
66
64
|
|
67
65
|
if s.hasApplicationSettings {
|
68
|
-
msg.
|
69
|
-
msg
|
70
|
-
msg
|
66
|
+
msg.AddUint8(1)
|
67
|
+
addUint16LengthPrefixedBytes(msg, s.localApplicationSettings)
|
68
|
+
addUint16LengthPrefixedBytes(msg, s.peerApplicationSettings)
|
71
69
|
} else {
|
72
|
-
msg.
|
70
|
+
msg.AddUint8(0)
|
73
71
|
}
|
74
72
|
|
75
|
-
return msg.
|
73
|
+
return msg.BytesOrPanic()
|
76
74
|
}
|
77
75
|
|
78
|
-
func readBool(reader *
|
76
|
+
func readBool(reader *cryptobyte.String, out *bool) bool {
|
79
77
|
var value uint8
|
80
|
-
if !reader.
|
78
|
+
if !reader.ReadUint8(&value) {
|
81
79
|
return false
|
82
80
|
}
|
83
81
|
if value == 0 {
|
@@ -92,19 +90,19 @@ func readBool(reader *byteReader, out *bool) bool {
|
|
92
90
|
}
|
93
91
|
|
94
92
|
func (s *sessionState) unmarshal(data []byte) bool {
|
95
|
-
reader :=
|
93
|
+
reader := cryptobyte.String(data)
|
96
94
|
var numCerts uint16
|
97
|
-
if !reader.
|
98
|
-
!reader.
|
99
|
-
!
|
100
|
-
!
|
101
|
-
!reader.
|
95
|
+
if !reader.ReadUint16(&s.vers) ||
|
96
|
+
!reader.ReadUint16(&s.cipherSuite) ||
|
97
|
+
!readUint16LengthPrefixedBytes(&reader, &s.secret) ||
|
98
|
+
!readUint16LengthPrefixedBytes(&reader, &s.handshakeHash) ||
|
99
|
+
!reader.ReadUint16(&numCerts) {
|
102
100
|
return false
|
103
101
|
}
|
104
102
|
|
105
103
|
s.certificates = make([][]byte, int(numCerts))
|
106
104
|
for i := range s.certificates {
|
107
|
-
if !
|
105
|
+
if !readUint24LengthPrefixedBytes(&reader, &s.certificates[i]) {
|
108
106
|
return false
|
109
107
|
}
|
110
108
|
}
|
@@ -115,24 +113,24 @@ func (s *sessionState) unmarshal(data []byte) bool {
|
|
115
113
|
|
116
114
|
if s.vers >= VersionTLS13 {
|
117
115
|
var ticketCreationTime, ticketExpiration uint64
|
118
|
-
if !reader.
|
119
|
-
!reader.
|
120
|
-
!reader.
|
121
|
-
!reader.
|
116
|
+
if !reader.ReadUint64(&ticketCreationTime) ||
|
117
|
+
!reader.ReadUint64(&ticketExpiration) ||
|
118
|
+
!reader.ReadUint32(&s.ticketFlags) ||
|
119
|
+
!reader.ReadUint32(&s.ticketAgeAdd) {
|
122
120
|
return false
|
123
121
|
}
|
124
122
|
s.ticketCreationTime = time.Unix(0, int64(ticketCreationTime))
|
125
123
|
s.ticketExpiration = time.Unix(0, int64(ticketExpiration))
|
126
124
|
}
|
127
125
|
|
128
|
-
if !
|
126
|
+
if !readUint16LengthPrefixedBytes(&reader, &s.earlyALPN) ||
|
129
127
|
!readBool(&reader, &s.hasApplicationSettings) {
|
130
128
|
return false
|
131
129
|
}
|
132
130
|
|
133
131
|
if s.hasApplicationSettings {
|
134
|
-
if !
|
135
|
-
!
|
132
|
+
if !readUint16LengthPrefixedBytes(&reader, &s.localApplicationSettings) ||
|
133
|
+
!readUint16LengthPrefixedBytes(&reader, &s.peerApplicationSettings) {
|
136
134
|
return false
|
137
135
|
}
|
138
136
|
}
|