aws-crt 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/VERSION +1 -1
  4. data/aws-crt-ffi/CMakeLists.txt +49 -41
  5. data/aws-crt-ffi/crt/aws-c-auth/CMakeLists.txt +0 -10
  6. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/credentials.h +3 -2
  7. data/aws-crt-ffi/crt/aws-c-auth/include/aws/auth/private/credentials_utils.h +4 -4
  8. data/aws-crt-ffi/crt/aws-c-auth/source/auth.c +1 -14
  9. data/aws-crt-ffi/crt/aws-c-auth/source/aws_imds_client.c +206 -68
  10. data/aws-crt-ffi/crt/aws-c-auth/source/aws_signing.c +5 -0
  11. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_cached.c +6 -6
  12. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_default_chain.c +16 -1
  13. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_ecs.c +0 -1
  14. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_process.c +0 -1
  15. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_sts_web_identity.c +0 -1
  16. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_provider_x509.c +10 -7
  17. data/aws-crt-ffi/crt/aws-c-auth/source/credentials_utils.c +35 -26
  18. data/aws-crt-ffi/crt/aws-c-auth/source/signable_chunk.c +3 -2
  19. data/aws-crt-ffi/crt/aws-c-auth/tests/CMakeLists.txt +3 -2
  20. data/aws-crt-ffi/crt/aws-c-auth/tests/aws_imds_client_test.c +1 -0
  21. data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_ecs_tests.c +3 -0
  22. data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_provider_process_tests.c +65 -16
  23. data/aws-crt-ffi/crt/aws-c-auth/tests/credentials_tests.c +125 -0
  24. data/aws-crt-ffi/crt/aws-c-auth/tests/sigv4_signing_tests.c +68 -46
  25. data/aws-crt-ffi/crt/aws-c-cal/CMakeLists.txt +8 -3
  26. data/aws-crt-ffi/crt/aws-c-cal/bin/run_x_platform_fuzz_corpus/main.c +9 -0
  27. data/aws-crt-ffi/crt/aws-c-cal/builder.json +11 -3
  28. data/aws-crt-ffi/crt/aws-c-cal/cmake/aws-c-cal-config.cmake +14 -5
  29. data/aws-crt-ffi/crt/aws-c-cal/source/darwin/securityframework_ecc.c +6 -6
  30. data/aws-crt-ffi/crt/aws-c-cal/source/windows/bcrypt_ecc.c +12 -12
  31. data/aws-crt-ffi/crt/aws-c-cal/tests/test_case_helper.h +14 -14
  32. data/aws-crt-ffi/crt/aws-c-common/CMakeLists.txt +21 -1
  33. data/aws-crt-ffi/crt/aws-c-common/README.md +8 -0
  34. data/aws-crt-ffi/crt/aws-c-common/cmake/AwsCFlags.cmake +20 -5
  35. data/aws-crt-ffi/crt/aws-c-common/cmake/AwsFeatureTests.cmake +7 -1
  36. data/aws-crt-ffi/crt/aws-c-common/format-check.sh +1 -1
  37. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/byte_buf.h +14 -0
  38. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/config.h.in +1 -0
  39. data/aws-crt-ffi/crt/{aws-c-auth/include/aws/auth → aws-c-common/include/aws/common}/external/cJSON.h +82 -74
  40. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/json.h +335 -0
  41. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/logging.h +1 -0
  42. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/math.inl +2 -2
  43. data/aws-crt-ffi/crt/aws-c-common/include/aws/common/private/json_impl.h +22 -0
  44. data/aws-crt-ffi/crt/aws-c-common/include/aws/testing/aws_test_harness.h +2 -0
  45. data/aws-crt-ffi/crt/aws-c-common/source/byte_buf.c +36 -0
  46. data/aws-crt-ffi/crt/aws-c-common/source/common.c +5 -2
  47. data/aws-crt-ffi/crt/aws-c-common/source/external/cJSON.c +3113 -0
  48. data/aws-crt-ffi/crt/aws-c-common/source/file.c +9 -0
  49. data/aws-crt-ffi/crt/aws-c-common/source/json.c +348 -0
  50. data/aws-crt-ffi/crt/aws-c-common/source/logging.c +7 -2
  51. data/aws-crt-ffi/crt/aws-c-common/source/posix/system_info.c +8 -0
  52. data/aws-crt-ffi/crt/aws-c-common/source/ref_count.c +3 -1
  53. data/aws-crt-ffi/crt/aws-c-common/source/windows/file.c +47 -0
  54. data/aws-crt-ffi/crt/aws-c-common/source/windows/system_info.c +2 -1
  55. data/aws-crt-ffi/crt/aws-c-common/tests/CMakeLists.txt +5 -0
  56. data/aws-crt-ffi/crt/aws-c-common/tests/byte_buf_test.c +69 -0
  57. data/aws-crt-ffi/crt/aws-c-common/tests/json_test.c +134 -0
  58. data/aws-crt-ffi/crt/aws-c-common/tests/memtrace_test.c +6 -2
  59. data/aws-crt-ffi/crt/aws-c-event-stream/README.md +18 -35
  60. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream.h +21 -2
  61. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream_rpc_client.h +14 -2
  62. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/event_stream_rpc_server.h +13 -0
  63. data/aws-crt-ffi/crt/aws-c-event-stream/include/aws/event-stream/private/event_stream_rpc_priv.h +7 -7
  64. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream.c +257 -141
  65. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_channel_handler.c +1 -1
  66. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_rpc_client.c +31 -8
  67. data/aws-crt-ffi/crt/aws-c-event-stream/source/event_stream_rpc_server.c +63 -10
  68. data/aws-crt-ffi/crt/aws-c-event-stream/tests/CMakeLists.txt +2 -0
  69. data/aws-crt-ffi/crt/aws-c-event-stream/tests/event_stream_rpc_client_connection_test.c +157 -106
  70. data/aws-crt-ffi/crt/aws-c-event-stream/tests/event_stream_rpc_server_connection_test.c +168 -1
  71. data/aws-crt-ffi/crt/aws-c-event-stream/tests/message_deserializer_test.c +4 -2
  72. data/aws-crt-ffi/crt/aws-c-http/CMakeLists.txt +1 -0
  73. data/aws-crt-ffi/crt/aws-c-http/README.md +8 -0
  74. data/aws-crt-ffi/crt/aws-c-http/bin/elasticurl/main.c +1 -1
  75. data/aws-crt-ffi/crt/aws-c-http/builder.json +4 -3
  76. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection.h +8 -1
  77. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/connection_manager.h +45 -1
  78. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/http2_stream_manager.h +63 -12
  79. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/connection_impl.h +2 -1
  80. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_connection.h +20 -2
  81. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_frames.h +1 -0
  82. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/h2_stream.h +42 -13
  83. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/http2_stream_manager_impl.h +17 -0
  84. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/http_impl.h +3 -0
  85. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/random_access_set.h +10 -3
  86. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/private/request_response_impl.h +3 -17
  87. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/request_response.h +108 -4
  88. data/aws-crt-ffi/crt/aws-c-http/include/aws/http/statistics.h +22 -0
  89. data/aws-crt-ffi/crt/aws-c-http/source/connection.c +8 -3
  90. data/aws-crt-ffi/crt/aws-c-http/source/connection_manager.c +22 -3
  91. data/aws-crt-ffi/crt/aws-c-http/source/connection_monitor.c +32 -14
  92. data/aws-crt-ffi/crt/aws-c-http/source/h1_connection.c +14 -0
  93. data/aws-crt-ffi/crt/aws-c-http/source/h1_encoder.c +7 -4
  94. data/aws-crt-ffi/crt/aws-c-http/source/h2_connection.c +161 -45
  95. data/aws-crt-ffi/crt/aws-c-http/source/h2_decoder.c +37 -8
  96. data/aws-crt-ffi/crt/aws-c-http/source/h2_frames.c +13 -1
  97. data/aws-crt-ffi/crt/aws-c-http/source/h2_stream.c +345 -87
  98. data/aws-crt-ffi/crt/aws-c-http/source/hpack.c +3 -0
  99. data/aws-crt-ffi/crt/aws-c-http/source/http.c +3 -0
  100. data/aws-crt-ffi/crt/aws-c-http/source/http2_stream_manager.c +266 -39
  101. data/aws-crt-ffi/crt/aws-c-http/source/random_access_set.c +9 -3
  102. data/aws-crt-ffi/crt/aws-c-http/source/request_response.c +80 -20
  103. data/aws-crt-ffi/crt/aws-c-http/source/statistics.c +11 -0
  104. data/aws-crt-ffi/crt/aws-c-http/tests/CMakeLists.txt +28 -1
  105. data/aws-crt-ffi/crt/aws-c-http/tests/fuzz/fuzz_h2_decoder_correct.c +5 -3
  106. data/aws-crt-ffi/crt/aws-c-http/tests/h2_test_helper.c +133 -29
  107. data/aws-crt-ffi/crt/aws-c-http/tests/h2_test_helper.h +6 -0
  108. data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/README.md +40 -0
  109. data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/non_tls_server.py +56 -0
  110. data/aws-crt-ffi/crt/aws-c-http/tests/py_localhost/server.py +329 -0
  111. data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_manager.c +1 -1
  112. data/aws-crt-ffi/crt/aws-c-http/tests/test_connection_monitor.c +2 -2
  113. data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_client.c +47 -34
  114. data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_encoder.c +4 -4
  115. data/aws-crt-ffi/crt/aws-c-http/tests/test_h1_server.c +15 -12
  116. data/aws-crt-ffi/crt/aws-c-http/tests/test_h2_client.c +582 -25
  117. data/aws-crt-ffi/crt/aws-c-http/tests/test_h2_encoder.c +3 -3
  118. data/aws-crt-ffi/crt/aws-c-http/tests/test_localhost_integ.c +530 -0
  119. data/aws-crt-ffi/crt/aws-c-http/tests/test_stream_manager.c +459 -67
  120. data/aws-crt-ffi/crt/aws-c-io/CMakeLists.txt +4 -0
  121. data/aws-crt-ffi/crt/aws-c-io/builder.json +3 -2
  122. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/channel.h +21 -0
  123. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/io.h +3 -0
  124. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/socket.h +6 -0
  125. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/stream.h +35 -5
  126. data/aws-crt-ffi/crt/aws-c-io/include/aws/io/tls_channel_handler.h +211 -15
  127. data/aws-crt-ffi/crt/aws-c-io/source/channel.c +56 -30
  128. data/aws-crt-ffi/crt/aws-c-io/source/darwin/secure_transport_tls_channel_handler.c +0 -24
  129. data/aws-crt-ffi/crt/aws-c-io/source/io.c +9 -0
  130. data/aws-crt-ffi/crt/aws-c-io/source/{pkcs11.c → pkcs11_lib.c} +162 -22
  131. data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_private.h +18 -20
  132. data/aws-crt-ffi/crt/aws-c-io/source/pkcs11_tls_op_handler.c +221 -0
  133. data/aws-crt-ffi/crt/aws-c-io/source/posix/socket.c +135 -81
  134. data/aws-crt-ffi/crt/aws-c-io/source/retry_strategy.c +12 -8
  135. data/aws-crt-ffi/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c +252 -215
  136. data/aws-crt-ffi/crt/aws-c-io/source/stream.c +65 -82
  137. data/aws-crt-ffi/crt/aws-c-io/source/tls_channel_handler.c +188 -57
  138. data/aws-crt-ffi/crt/aws-c-io/source/windows/iocp/socket.c +271 -256
  139. data/aws-crt-ffi/crt/aws-c-io/tests/CMakeLists.txt +21 -12
  140. data/aws-crt-ffi/crt/aws-c-io/tests/channel_test.c +32 -4
  141. data/aws-crt-ffi/crt/aws-c-io/tests/io_lib_test.c +37 -0
  142. data/aws-crt-ffi/crt/aws-c-io/tests/pkcs11_test.c +412 -93
  143. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.crt +15 -0
  144. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.key +5 -0
  145. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.p12 +0 -0
  146. data/aws-crt-ffi/crt/aws-c-io/tests/resources/ec_unittests.p8 +5 -0
  147. data/aws-crt-ffi/crt/aws-c-io/tests/resources/generateCerts.sh +24 -15
  148. data/aws-crt-ffi/crt/aws-c-io/tests/socket_test.c +72 -1
  149. data/aws-crt-ffi/crt/s2n/CMakeLists.txt +6 -1
  150. data/aws-crt-ffi/crt/s2n/bindings/rust/Cargo.toml +1 -0
  151. data/aws-crt-ffi/crt/s2n/bindings/rust/generate/src/main.rs +105 -82
  152. data/aws-crt-ffi/crt/s2n/bindings/rust/generate.sh +1 -0
  153. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/Cargo.toml +2 -2
  154. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls/src/raw/config.rs +1 -1
  155. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/Cargo.toml +1 -1
  156. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/build.rs +84 -30
  157. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-sys/src/lib.rs +4 -0
  158. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/Cargo.toml +21 -0
  159. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/certs/cert.pem +14 -0
  160. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/certs/key.pem +8 -0
  161. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/client.rs +45 -0
  162. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/examples/server.rs +60 -0
  163. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/src/lib.rs +150 -0
  164. data/aws-crt-ffi/crt/s2n/bindings/rust/s2n-tls-tokio/tests/handshake.rs +51 -0
  165. data/aws-crt-ffi/crt/s2n/crypto/s2n_drbg.c +98 -77
  166. data/aws-crt-ffi/crt/s2n/crypto/s2n_drbg.h +10 -7
  167. data/aws-crt-ffi/crt/s2n/crypto/s2n_openssl.h +2 -0
  168. data/aws-crt-ffi/crt/s2n/error/s2n_errno.c +1 -1
  169. data/aws-crt-ffi/crt/s2n/error/s2n_errno.h +1 -0
  170. data/aws-crt-ffi/crt/s2n/s2n.mk +7 -0
  171. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/repository.py +233 -0
  172. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/setup-proof.py +8 -7
  173. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/setup.py +17 -18
  174. data/aws-crt-ffi/crt/s2n/tests/cbmc/templates/scripts/util.py +41 -23
  175. data/aws-crt-ffi/crt/s2n/tests/fuzz/LD_PRELOAD/global_overrides.c +3 -3
  176. data/aws-crt-ffi/crt/s2n/tests/integration/s2n_client_endpoint_handshake_test.py +2 -2
  177. data/aws-crt-ffi/crt/s2n/tests/integrationv2/Makefile +13 -42
  178. data/aws-crt-ffi/crt/s2n/tests/integrationv2/README.md +6 -1
  179. data/aws-crt-ffi/crt/s2n/tests/integrationv2/common.py +118 -53
  180. data/aws-crt-ffi/crt/s2n/tests/integrationv2/configuration.py +108 -88
  181. data/aws-crt-ffi/crt/s2n/tests/integrationv2/conftest.py +6 -3
  182. data/aws-crt-ffi/crt/s2n/tests/integrationv2/constants.py +6 -4
  183. data/aws-crt-ffi/crt/s2n/tests/integrationv2/fixtures.py +21 -12
  184. data/aws-crt-ffi/crt/s2n/tests/integrationv2/global_flags.py +1 -0
  185. data/aws-crt-ffi/crt/s2n/tests/integrationv2/processes.py +62 -19
  186. data/aws-crt-ffi/crt/s2n/tests/integrationv2/providers.py +304 -48
  187. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_client_authentication.py +20 -11
  188. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_cross_compatibility.py +41 -17
  189. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_dynamic_record_sizes.py +6 -3
  190. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_early_data.py +105 -48
  191. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_external_psk.py +160 -76
  192. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_fragmentation.py +59 -26
  193. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_happy_path.py +42 -28
  194. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_hello_retry_requests.py +33 -13
  195. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_key_update.py +29 -11
  196. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_ocsp.py +138 -0
  197. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_pq_handshake.py +103 -36
  198. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_session_resumption.py +52 -25
  199. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_signature_algorithms.py +47 -21
  200. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_sni_match.py +13 -9
  201. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_sslyze.py +88 -17
  202. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_version_negotiation.py +71 -22
  203. data/aws-crt-ffi/crt/s2n/tests/integrationv2/test_well_known_endpoints.py +4 -3
  204. data/aws-crt-ffi/crt/s2n/tests/integrationv2/tox.ini +1 -0
  205. data/aws-crt-ffi/crt/s2n/tests/integrationv2/utils.py +50 -15
  206. data/aws-crt-ffi/crt/s2n/tests/litani/CHANGELOG +131 -0
  207. data/aws-crt-ffi/crt/s2n/tests/litani/CONTRIBUTING.md +16 -0
  208. data/aws-crt-ffi/crt/s2n/tests/litani/README.md +36 -14
  209. data/aws-crt-ffi/crt/s2n/tests/litani/THIRD-PARTY +205 -41
  210. data/aws-crt-ffi/crt/s2n/tests/litani/doc/bin/build-html-doc +7 -7
  211. data/aws-crt-ffi/crt/s2n/tests/litani/doc/configure +27 -23
  212. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-add-job.scdoc +7 -0
  213. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-dump-run.scdoc +7 -5
  214. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani-transform-jobs.scdoc +248 -0
  215. data/aws-crt-ffi/crt/s2n/tests/litani/doc/src/man/litani.scdoc +2 -2
  216. data/aws-crt-ffi/crt/s2n/tests/litani/doc/templates/index.jinja.html +4 -0
  217. data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/README +12 -0
  218. data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/original-run.sh +52 -0
  219. data/aws-crt-ffi/crt/s2n/tests/litani/examples/add-root-node/run-all.py +71 -0
  220. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/README +13 -0
  221. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-1.sh +34 -0
  222. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-2.sh +35 -0
  223. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-3.sh +34 -0
  224. data/aws-crt-ffi/crt/s2n/tests/litani/examples/no-standalone-transform/run-all.py +60 -0
  225. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/README.md +10 -0
  226. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/assumptions.html +42 -0
  227. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/file.dat +7 -0
  228. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/histogram.dat +7 -0
  229. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-1.sh +41 -0
  230. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-2.sh +47 -0
  231. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-3.sh +41 -0
  232. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/run-all.py +34 -0
  233. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib-table.py +40 -0
  234. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib.plt +5 -0
  235. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/fib.py +32 -0
  236. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin-output.py +40 -0
  237. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin.plt +5 -0
  238. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/scripts/sin.py +30 -0
  239. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/templates/fib-table.jinja.html +45 -0
  240. data/aws-crt-ffi/crt/s2n/tests/litani/examples/rich-output/templates/sin-output.jinja.html +30 -0
  241. data/aws-crt-ffi/crt/s2n/tests/litani/lib/add_job.py +55 -0
  242. data/aws-crt-ffi/crt/s2n/tests/litani/lib/graph.py +2 -2
  243. data/aws-crt-ffi/crt/s2n/tests/litani/lib/litani.py +6 -1
  244. data/aws-crt-ffi/crt/s2n/tests/litani/lib/litani_report.py +18 -21
  245. data/aws-crt-ffi/crt/s2n/tests/litani/lib/ninja.py +2 -0
  246. data/aws-crt-ffi/crt/s2n/tests/litani/lib/run_printer.py +26 -7
  247. data/aws-crt-ffi/crt/s2n/tests/litani/lib/transform_jobs.py +84 -0
  248. data/aws-crt-ffi/crt/s2n/tests/litani/litani +28 -33
  249. data/aws-crt-ffi/crt/s2n/tests/litani/script/release +220 -0
  250. data/aws-crt-ffi/crt/s2n/tests/litani/templates/dashboard.jinja.html +78 -15
  251. data/aws-crt-ffi/crt/s2n/tests/litani/templates/pipeline.jinja.html +21 -5
  252. data/aws-crt-ffi/crt/s2n/tests/litani/test/README +15 -0
  253. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/run +56 -33
  254. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/custom_stages.py +1 -0
  255. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/cwd.py +1 -0
  256. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/dump_run.py +1 -0
  257. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/graph_line_break.py +1 -0
  258. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/html_node.py +1 -0
  259. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/job_id_env.py +1 -0
  260. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/multiproc_dump_run.py +1 -0
  261. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_pool_serialize.py +1 -0
  262. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_pool_serialize_graph.py +1 -0
  263. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out.py +1 -0
  264. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out_timeout_ignored.py +1 -0
  265. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/no_timed_out_timeout_ok.py +1 -0
  266. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pipeline_order.py +53 -0
  267. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pool_serialize.py +1 -0
  268. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/pool_serialize_graph.py +1 -0
  269. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/single_pool.py +1 -0
  270. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out.py +1 -0
  271. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess.py +1 -0
  272. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess_multi_shell.py +1 -0
  273. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_subprocess_shell.py +1 -0
  274. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_timeout_ignored.py +1 -0
  275. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/timed_out_timeout_ok.py +1 -0
  276. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_delete_job.py +54 -0
  277. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_modify_job.py +46 -0
  278. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/transform_no_change_job.py +44 -0
  279. data/aws-crt-ffi/crt/s2n/tests/litani/test/e2e/tests/zero_pool.py +1 -0
  280. data/aws-crt-ffi/crt/s2n/tests/litani/test/run +82 -12
  281. data/aws-crt-ffi/crt/s2n/tests/s2n_test.h +58 -33
  282. data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_key_schedule_testlib.c +18 -6
  283. data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_pq_kat_test_utils.c +4 -4
  284. data/aws-crt-ffi/crt/s2n/tests/testlib/s2n_testlib.h +2 -0
  285. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_client_hello_retry_test.c +66 -2
  286. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_connection_test.c +1 -1
  287. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_drbg_test.c +34 -14
  288. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_fork_generation_number_test.c +28 -5
  289. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_mem_usage_test.c +6 -0
  290. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_override_openssl_random_test.c +1 -1
  291. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_random_test.c +60 -41
  292. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_self_talk_broken_pipe_test.c +2 -2
  293. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_handshake_early_data_test.c +3 -1
  294. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_hybrid_shared_secret_test.c +9 -1
  295. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_key_schedule_rfc8448_test.c +31 -130
  296. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_key_schedule_test.c +2 -4
  297. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_pq_handshake_test.c +11 -6
  298. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_secrets_rfc8448_test.c +19 -21
  299. data/aws-crt-ffi/crt/s2n/tests/unit/s2n_tls13_secrets_test.c +109 -60
  300. data/aws-crt-ffi/crt/s2n/tls/s2n_config.c +1 -0
  301. data/aws-crt-ffi/crt/s2n/tls/s2n_config.h +1 -1
  302. data/aws-crt-ffi/crt/s2n/tls/s2n_connection.c +29 -24
  303. data/aws-crt-ffi/crt/s2n/tls/s2n_connection.h +5 -5
  304. data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_hashes.h +1 -7
  305. data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_io.c +2 -0
  306. data/aws-crt-ffi/crt/s2n/tls/s2n_handshake_transcript.c +0 -44
  307. data/aws-crt-ffi/crt/s2n/tls/s2n_internal.h +0 -1
  308. data/aws-crt-ffi/crt/s2n/tls/s2n_quic_support.h +1 -1
  309. data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_key_schedule.c +1 -2
  310. data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_secrets.c +84 -44
  311. data/aws-crt-ffi/crt/s2n/tls/s2n_tls13_secrets.h +3 -9
  312. data/aws-crt-ffi/crt/s2n/utils/s2n_blob.h +15 -8
  313. data/aws-crt-ffi/crt/s2n/utils/s2n_fork_detection.c +2 -6
  314. data/aws-crt-ffi/crt/s2n/utils/s2n_random.c +9 -9
  315. data/aws-crt-ffi/src/input_stream.c +32 -15
  316. data/ext/compile.rb +13 -5
  317. data/lib/aws-crt/platforms.rb +14 -5
  318. data/lib/aws-crt/string_blob.rb +3 -3
  319. metadata +61 -7
  320. data/aws-crt-ffi/crt/aws-c-auth/source/external/cJSON.c +0 -2987
  321. data/aws-crt-ffi/crt/aws-c-auth/tests/external/cJSON.c +0 -2986
  322. data/aws-crt-ffi/crt/aws-c-io/tests/error_test.c +0 -20
@@ -19,13 +19,17 @@ RESUMPTION_PROTOCOLS = [Protocols.TLS12, Protocols.TLS13]
19
19
  An old S2N server can resume a session with a new S2N server's session ticket.
20
20
  Tests that S2N tickets are backwards-compatible.
21
21
  """
22
+
23
+
22
24
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
23
25
  @pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
24
26
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
25
27
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
26
28
  @pytest.mark.parametrize("protocol", RESUMPTION_PROTOCOLS, ids=get_parameter_name)
27
- @pytest.mark.parametrize("provider", [ OpenSSL ], ids=get_parameter_name)
28
- def test_s2n_old_server_new_ticket(managed_process, tmp_path, cipher, curve, protocol, provider, certificate):
29
+ @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
30
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
31
+ def test_s2n_old_server_new_ticket(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
32
+ other_provider):
29
33
  ticket_file = str(tmp_path / TICKET_FILE)
30
34
  assert not os.path.exists(ticket_file)
31
35
 
@@ -48,8 +52,10 @@ def test_s2n_old_server_new_ticket(managed_process, tmp_path, cipher, curve, pro
48
52
  server_options.cert = certificate.cert
49
53
  server_options.data_to_send = CLOSE_MARKER_BYTES
50
54
 
51
- s2n_server = managed_process(S2N, server_options, send_marker=S2N.get_send_marker())
52
- client = managed_process(provider, client_options, close_marker=str(CLOSE_MARKER_BYTES))
55
+ s2n_server = managed_process(
56
+ S2N, server_options, send_marker=S2N.get_send_marker())
57
+ client = managed_process(provider, client_options,
58
+ close_marker=str(CLOSE_MARKER_BYTES))
53
59
 
54
60
  for results in client.get_results():
55
61
  results.assert_success()
@@ -61,8 +67,10 @@ def test_s2n_old_server_new_ticket(managed_process, tmp_path, cipher, curve, pro
61
67
  client_options.extra_flags = ['-sess_in', ticket_file]
62
68
  server_options.use_mainline_version = True
63
69
 
64
- s2n_server = managed_process(S2N, server_options, send_marker=S2N.get_send_marker())
65
- client = managed_process(provider, client_options, close_marker=str(CLOSE_MARKER_BYTES))
70
+ s2n_server = managed_process(
71
+ S2N, server_options, send_marker=S2N.get_send_marker())
72
+ client = managed_process(provider, client_options,
73
+ close_marker=str(CLOSE_MARKER_BYTES))
66
74
 
67
75
  for results in client.get_results():
68
76
  results.assert_success()
@@ -76,13 +84,17 @@ def test_s2n_old_server_new_ticket(managed_process, tmp_path, cipher, curve, pro
76
84
  A new S2N server can resume a session with an old S2N server's session ticket.
77
85
  Tests that S2N tickets are forwards-compatible.
78
86
  """
87
+
88
+
79
89
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
80
90
  @pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
81
91
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
82
92
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
83
93
  @pytest.mark.parametrize("protocol", RESUMPTION_PROTOCOLS, ids=get_parameter_name)
84
- @pytest.mark.parametrize("provider", [ OpenSSL ], ids=get_parameter_name)
85
- def test_s2n_new_server_old_ticket(managed_process, tmp_path, cipher, curve, protocol, provider, certificate):
94
+ @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
95
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
96
+ def test_s2n_new_server_old_ticket(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
97
+ other_provider):
86
98
  ticket_file = str(tmp_path / TICKET_FILE)
87
99
  assert not os.path.exists(ticket_file)
88
100
 
@@ -106,8 +118,10 @@ def test_s2n_new_server_old_ticket(managed_process, tmp_path, cipher, curve, pro
106
118
  server_options.cert = certificate.cert
107
119
  server_options.data_to_send = CLOSE_MARKER_BYTES
108
120
 
109
- s2n_server = managed_process(S2N, server_options, send_marker=S2N.get_send_marker())
110
- client = managed_process(provider, client_options, close_marker=str(CLOSE_MARKER_BYTES))
121
+ s2n_server = managed_process(
122
+ S2N, server_options, send_marker=S2N.get_send_marker())
123
+ client = managed_process(provider, client_options,
124
+ close_marker=str(CLOSE_MARKER_BYTES))
111
125
 
112
126
  for results in client.get_results():
113
127
  results.assert_success()
@@ -119,8 +133,10 @@ def test_s2n_new_server_old_ticket(managed_process, tmp_path, cipher, curve, pro
119
133
  client_options.extra_flags = ['-sess_in', ticket_file]
120
134
  server_options.use_mainline_version = False
121
135
 
122
- s2n_server = managed_process(S2N, server_options, send_marker=S2N.get_send_marker())
123
- client = managed_process(provider, client_options, close_marker=str(CLOSE_MARKER_BYTES))
136
+ s2n_server = managed_process(
137
+ S2N, server_options, send_marker=S2N.get_send_marker())
138
+ client = managed_process(provider, client_options,
139
+ close_marker=str(CLOSE_MARKER_BYTES))
124
140
 
125
141
  for results in client.get_results():
126
142
  results.assert_success()
@@ -135,13 +151,17 @@ An old S2N client can resume a session with an new S2N client's session ticket.
135
151
  Tests that S2N tickets are backwards-compatible. In our client tests we use an S2N
136
152
  server because the Openssl server uses a different ticket key for each session.
137
153
  """
154
+
155
+
138
156
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
139
157
  @pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
140
158
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
141
159
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
142
160
  @pytest.mark.parametrize("protocol", RESUMPTION_PROTOCOLS, ids=get_parameter_name)
143
- @pytest.mark.parametrize("provider", [ S2N ], ids=get_parameter_name)
144
- def test_s2n_old_client_new_ticket(managed_process, tmp_path, cipher, curve, protocol, provider, certificate):
161
+ @pytest.mark.parametrize("provider", [S2N], ids=get_parameter_name)
162
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
163
+ def test_s2n_old_client_new_ticket(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
164
+ other_provider):
145
165
  ticket_file = str(tmp_path / TICKET_FILE)
146
166
  assert not os.path.exists(ticket_file)
147
167
 
@@ -177,7 +197,7 @@ def test_s2n_old_client_new_ticket(managed_process, tmp_path, cipher, curve, pro
177
197
  client_options.use_mainline_version = True
178
198
 
179
199
  server = managed_process(provider, server_options)
180
- s2n_client = managed_process(S2N, client_options)
200
+ s2n_client = managed_process(other_provider, client_options)
181
201
 
182
202
  for results in s2n_client.get_results():
183
203
  results.assert_success()
@@ -192,13 +212,17 @@ def test_s2n_old_client_new_ticket(managed_process, tmp_path, cipher, curve, pro
192
212
  A new S2N client can resume a session with an old S2N client's session ticket.
193
213
  Tests that S2N tickets are forwards-compatible.
194
214
  """
215
+
216
+
195
217
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
196
218
  @pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
197
219
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
198
220
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
199
221
  @pytest.mark.parametrize("protocol", RESUMPTION_PROTOCOLS, ids=get_parameter_name)
200
- @pytest.mark.parametrize("provider", [ S2N ], ids=get_parameter_name)
201
- def test_s2n_new_client_old_ticket(managed_process, tmp_path, cipher, curve, protocol, provider, certificate):
222
+ @pytest.mark.parametrize("provider", [S2N], ids=get_parameter_name)
223
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
224
+ def test_s2n_new_client_old_ticket(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
225
+ other_provider):
202
226
  ticket_file = str(tmp_path / TICKET_FILE)
203
227
  assert not os.path.exists(ticket_file)
204
228
 
@@ -41,10 +41,12 @@ def find_fragmented_packet(results):
41
41
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
42
42
  @pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
43
43
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES)
44
- @pytest.mark.parametrize("provider", [OpenSSL])
44
+ @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
45
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
45
46
  @pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
46
47
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
47
- def test_s2n_client_dynamic_record(custom_mtu, managed_process, cipher, curve, provider, protocol, certificate):
48
+ def test_s2n_client_dynamic_record(custom_mtu, managed_process, cipher, curve, provider, other_provider, protocol,
49
+ certificate):
48
50
  port = next(available_ports)
49
51
 
50
52
  # 16384 bytes is enough to reliably get a packet that will exceed the MTU
@@ -73,7 +75,8 @@ def test_s2n_client_dynamic_record(custom_mtu, managed_process, cipher, curve, p
73
75
 
74
76
  for results in client.get_results():
75
77
  results.assert_success()
76
- assert to_bytes("Actual protocol version: {}".format(expected_version)) in results.stdout
78
+ assert to_bytes("Actual protocol version: {}".format(
79
+ expected_version)) in results.stdout
77
80
 
78
81
  for results in server.get_results():
79
82
  results.assert_success()
@@ -16,22 +16,27 @@ from test_hello_retry_requests import S2N_HRR_MARKER
16
16
  TICKET_FILE = 'ticket'
17
17
  EARLY_DATA_FILE = 'early_data'
18
18
 
19
- MAX_EARLY_DATA = 500 # Arbitrary largish number
20
- DATA_TO_SEND = data_bytes(500) # Arbitrary large number
19
+ MAX_EARLY_DATA = 500 # Arbitrary largish number
20
+ DATA_TO_SEND = data_bytes(500) # Arbitrary large number
21
21
 
22
- NUM_RESUMES = 5 # Hardcoded for s2nc --reconnect
23
- NUM_CONNECTIONS = NUM_RESUMES + 1 # resumes + initial
22
+ NUM_RESUMES = 5 # Hardcoded for s2nc --reconnect
23
+ NUM_CONNECTIONS = NUM_RESUMES + 1 # resumes + initial
24
24
 
25
25
  S2N_DEFAULT_CURVE = Curves.X25519
26
- S2N_UNSUPPORTED_CURVE = 'X448' # We have no plans to support this curve any time soon
27
- S2N_HRR_CURVES = list(curve for curve in ALL_TEST_CURVES if curve != S2N_DEFAULT_CURVE)
26
+ # We have no plans to support this curve any time soon
27
+ S2N_UNSUPPORTED_CURVE = 'X448'
28
+ S2N_HRR_CURVES = list(
29
+ curve for curve in ALL_TEST_CURVES if curve != S2N_DEFAULT_CURVE)
28
30
 
29
31
  S2N_EARLY_DATA_MARKER = to_bytes("WITH_EARLY_DATA")
30
32
  S2N_EARLY_DATA_RECV_MARKER = "Early Data received: "
31
33
  S2N_EARLY_DATA_STATUS_MARKER = "Early Data status: {status}"
32
- S2N_EARLY_DATA_ACCEPTED_MARKER = S2N_EARLY_DATA_STATUS_MARKER.format(status="ACCEPTED")
33
- S2N_EARLY_DATA_REJECTED_MARKER = S2N_EARLY_DATA_STATUS_MARKER.format(status="REJECTED")
34
- S2N_EARLY_DATA_NOT_REQUESTED_MARKER = S2N_EARLY_DATA_STATUS_MARKER.format(status="NOT REQUESTED")
34
+ S2N_EARLY_DATA_ACCEPTED_MARKER = S2N_EARLY_DATA_STATUS_MARKER.format(
35
+ status="ACCEPTED")
36
+ S2N_EARLY_DATA_REJECTED_MARKER = S2N_EARLY_DATA_STATUS_MARKER.format(
37
+ status="REJECTED")
38
+ S2N_EARLY_DATA_NOT_REQUESTED_MARKER = S2N_EARLY_DATA_STATUS_MARKER.format(
39
+ status="NOT REQUESTED")
35
40
 
36
41
 
37
42
  class S2N(S2NBase):
@@ -79,8 +84,8 @@ class OpenSSL(OpenSSLBase):
79
84
  # The `-sess_in`/`-sess_out` options can be used instead, but don't have an s2nc equivalent.
80
85
  # As we add more providers, we may need both a `-reconnect`-like and a `-sess_in/out`-like S2N server test,
81
86
  # but for now we can just use `-sess_in/out` and cover the S2N->S2N case in the S2N client tests.
82
- CLIENT_PROVIDERS = [ OpenSSL ]
83
- SERVER_PROVIDERS = [ OpenSSL, S2N ]
87
+ CLIENT_PROVIDERS = [OpenSSL]
88
+ SERVER_PROVIDERS = [OpenSSL, S2N]
84
89
 
85
90
 
86
91
  def get_early_data_bytes(file_path, early_data_size):
@@ -113,8 +118,18 @@ def get_ticket_from_s2n_server(options, managed_process, provider, certificate):
113
118
 
114
119
  assert not os.path.exists(options.ticket_file)
115
120
 
116
- s2n_server = managed_process(S2N, server_options, send_marker=S2N.get_send_marker())
117
- client = managed_process(provider, client_options, close_marker=str(close_marker_bytes))
121
+ s2n_server = managed_process(
122
+ S2N,
123
+ server_options,
124
+ send_marker=S2N.get_send_marker(),
125
+ timeout=10
126
+ )
127
+ client = managed_process(
128
+ provider,
129
+ client_options,
130
+ close_marker=str(close_marker_bytes),
131
+ timeout=10
132
+ )
118
133
 
119
134
  for results in s2n_server.get_results():
120
135
  results.assert_success()
@@ -125,20 +140,33 @@ def get_ticket_from_s2n_server(options, managed_process, provider, certificate):
125
140
  assert os.path.exists(options.ticket_file)
126
141
 
127
142
 
143
+ def test_nothing():
144
+ """
145
+ Sometimes the early data test parameters in combination with the s2n libcrypto
146
+ results in no test cases existing. In this case, pass a nothing test to avoid
147
+ marking the entire codebuild run as failed.
148
+ """
149
+ assert True
150
+
151
+
128
152
  """
129
153
  Basic S2N server happy case.
130
154
 
131
155
  We make one full connection to get a session ticket with early data enabled,
132
156
  then another resumption connection with early data.
133
157
  """
158
+
159
+
134
160
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
135
161
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
136
162
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
137
163
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
138
164
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
139
165
  @pytest.mark.parametrize("provider", CLIENT_PROVIDERS, ids=get_parameter_name)
166
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
140
167
  @pytest.mark.parametrize("early_data_size", [int(MAX_EARLY_DATA/2), int(MAX_EARLY_DATA-1), MAX_EARLY_DATA, 1])
141
- def test_s2n_server_with_early_data(managed_process, tmp_path, cipher, curve, protocol, provider, certificate, early_data_size):
168
+ def test_s2n_server_with_early_data(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
169
+ other_provider, early_data_size):
142
170
  ticket_file = str(tmp_path / TICKET_FILE)
143
171
  early_data_file = str(tmp_path / EARLY_DATA_FILE)
144
172
  early_data = get_early_data_bytes(early_data_file, early_data_size)
@@ -164,8 +192,8 @@ def test_s2n_server_with_early_data(managed_process, tmp_path, cipher, curve, pr
164
192
  server_options = copy.copy(options)
165
193
  server_options.mode = Provider.ServerMode
166
194
 
167
- s2n_server = managed_process(S2N, server_options)
168
- client = managed_process(provider, client_options)
195
+ s2n_server = managed_process(S2N, server_options, timeout=10)
196
+ client = managed_process(provider, client_options, timeout=10)
169
197
 
170
198
  for results in client.get_results():
171
199
  results.assert_success()
@@ -173,7 +201,8 @@ def test_s2n_server_with_early_data(managed_process, tmp_path, cipher, curve, pr
173
201
  for results in s2n_server.get_results():
174
202
  results.assert_success()
175
203
  assert S2N_EARLY_DATA_MARKER in results.stdout
176
- assert (to_bytes(S2N_EARLY_DATA_RECV_MARKER) + early_data) in results.stdout
204
+ assert (to_bytes(S2N_EARLY_DATA_RECV_MARKER) +
205
+ early_data) in results.stdout
177
206
  assert to_bytes(S2N_EARLY_DATA_ACCEPTED_MARKER) in results.stdout
178
207
  assert DATA_TO_SEND in results.stdout
179
208
 
@@ -184,13 +213,17 @@ Basic S2N client happy case.
184
213
  The S2N client tests session resumption by repeatedly reconnecting.
185
214
  That means we don't need to manually perform the initial full connection, and there is no external ticket file.
186
215
  """
216
+
217
+
187
218
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
188
219
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
189
220
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
190
221
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
191
222
  @pytest.mark.parametrize("provider", SERVER_PROVIDERS, ids=get_parameter_name)
223
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
192
224
  @pytest.mark.parametrize("early_data_size", [int(MAX_EARLY_DATA/2), int(MAX_EARLY_DATA-1), MAX_EARLY_DATA, 1])
193
- def test_s2n_client_with_early_data(managed_process, tmp_path, cipher, protocol, provider, certificate, early_data_size):
225
+ def test_s2n_client_with_early_data(managed_process, tmp_path, cipher, certificate, protocol, provider, other_provider,
226
+ early_data_size):
194
227
  early_data_file = str(tmp_path / EARLY_DATA_FILE)
195
228
  early_data = get_early_data_bytes(early_data_file, early_data_size)
196
229
 
@@ -211,17 +244,18 @@ def test_s2n_client_with_early_data(managed_process, tmp_path, cipher, protocol,
211
244
 
212
245
  server_options = copy.copy(options)
213
246
  server_options.mode = Provider.ServerMode
214
- server_options.key = certificate.key # Required for the initial connection
215
- server_options.cert = certificate.cert # Required for the initial connection
247
+ server_options.key = certificate.key # Required for the initial connection
248
+ server_options.cert = certificate.cert # Required for the initial connection
216
249
  server_options.reconnects_before_exit = NUM_CONNECTIONS
217
250
 
218
- server = managed_process(provider, server_options)
219
- s2n_client = managed_process(S2N, client_options)
251
+ server = managed_process(provider, server_options, timeout=10)
252
+ s2n_client = managed_process(S2N, client_options, timeout=10)
220
253
 
221
254
  for results in s2n_client.get_results():
222
255
  results.assert_success()
223
256
  assert S2N_EARLY_DATA_MARKER in results.stdout
224
- assert results.stdout.count(to_bytes(S2N_EARLY_DATA_ACCEPTED_MARKER)) == NUM_RESUMES
257
+ assert results.stdout.count(
258
+ to_bytes(S2N_EARLY_DATA_ACCEPTED_MARKER)) == NUM_RESUMES
225
259
 
226
260
  for results in server.get_results():
227
261
  results.assert_success()
@@ -234,12 +268,16 @@ Verify that the S2N client doesn't request early data when a server doesn't supp
234
268
  We repeatedly reconnect with max_early_data set to 0. This is basically a test from
235
269
  test_session_resumption but with validation that no early data is sent.
236
270
  """
271
+
272
+
237
273
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
238
274
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
239
275
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
240
276
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
241
277
  @pytest.mark.parametrize("provider", SERVER_PROVIDERS, ids=get_parameter_name)
242
- def test_s2n_client_without_early_data(managed_process, tmp_path, cipher, protocol, provider, certificate):
278
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
279
+ def test_s2n_client_without_early_data(managed_process, tmp_path, cipher, certificate, protocol, provider,
280
+ other_provider):
243
281
  early_data_file = str(tmp_path / EARLY_DATA_FILE)
244
282
  early_data = get_early_data_bytes(early_data_file, MAX_EARLY_DATA)
245
283
 
@@ -260,12 +298,12 @@ def test_s2n_client_without_early_data(managed_process, tmp_path, cipher, protoc
260
298
 
261
299
  server_options = copy.copy(options)
262
300
  server_options.mode = Provider.ServerMode
263
- server_options.key = certificate.key # Required for the initial connection
264
- server_options.cert = certificate.cert # Required for the initial connection
301
+ server_options.key = certificate.key # Required for the initial connection
302
+ server_options.cert = certificate.cert # Required for the initial connection
265
303
  server_options.reconnects_before_exit = NUM_CONNECTIONS
266
304
 
267
- server = managed_process(provider, server_options)
268
- s2n_client = managed_process(S2N, client_options)
305
+ server = managed_process(provider, server_options, timeout=10)
306
+ s2n_client = managed_process(S2N, client_options, timeout=10)
269
307
 
270
308
  for results in server.get_results():
271
309
  results.assert_success()
@@ -274,7 +312,8 @@ def test_s2n_client_without_early_data(managed_process, tmp_path, cipher, protoc
274
312
  for results in s2n_client.get_results():
275
313
  results.assert_success()
276
314
  assert S2N_EARLY_DATA_MARKER not in results.stdout
277
- assert results.stdout.count(to_bytes(S2N_EARLY_DATA_NOT_REQUESTED_MARKER)) == NUM_CONNECTIONS
315
+ assert results.stdout.count(
316
+ to_bytes(S2N_EARLY_DATA_NOT_REQUESTED_MARKER)) == NUM_CONNECTIONS
278
317
 
279
318
 
280
319
  """
@@ -286,14 +325,17 @@ When the client attempts to use the ticket to send early data, the server reject
286
325
  We can't perform an S2N client version of this test because the S2N client performs its hardcoded
287
326
  reconnects automatically, without any mechanism to modify the connection in between.
288
327
  """
328
+ @pytest.mark.flaky(reruns=5)
289
329
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
290
330
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
291
331
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
292
332
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
293
333
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
294
334
  @pytest.mark.parametrize("provider", CLIENT_PROVIDERS, ids=get_parameter_name)
335
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
295
336
  @pytest.mark.parametrize("early_data_size", [int(MAX_EARLY_DATA/2), int(MAX_EARLY_DATA-1), MAX_EARLY_DATA, 1])
296
- def test_s2n_server_with_early_data_rejected(managed_process, tmp_path, cipher, curve, protocol, provider, certificate, early_data_size):
337
+ def test_s2n_server_with_early_data_rejected(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
338
+ other_provider, early_data_size):
297
339
  ticket_file = str(tmp_path / TICKET_FILE)
298
340
  early_data_file = str(tmp_path / EARLY_DATA_FILE)
299
341
  early_data = get_early_data_bytes(early_data_file, early_data_size)
@@ -320,8 +362,8 @@ def test_s2n_server_with_early_data_rejected(managed_process, tmp_path, cipher,
320
362
  server_options = copy.copy(options)
321
363
  server_options.mode = Provider.ServerMode
322
364
 
323
- s2n_server = managed_process(S2N, server_options)
324
- client = managed_process(provider, client_options)
365
+ s2n_server = managed_process(S2N, server_options, timeout=10)
366
+ client = managed_process(provider, client_options, timeout=10)
325
367
 
326
368
  for results in client.get_results():
327
369
  results.assert_success()
@@ -341,16 +383,21 @@ Test the S2N client attempting to send early data, but the server triggering a h
341
383
  We trigger the HRR by configuring the server to only accept curves that the S2N client
342
384
  does not send key shares for.
343
385
  """
386
+
387
+
344
388
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
345
389
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
346
390
  @pytest.mark.parametrize("curve", S2N_HRR_CURVES, ids=get_parameter_name)
347
391
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
348
392
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
349
393
  @pytest.mark.parametrize("provider", SERVER_PROVIDERS, ids=get_parameter_name)
394
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
350
395
  @pytest.mark.parametrize("early_data_size", [int(MAX_EARLY_DATA/2), int(MAX_EARLY_DATA-1), MAX_EARLY_DATA, 1])
351
- def test_s2n_client_with_early_data_rejected_via_hrr(managed_process, tmp_path, cipher, curve, protocol, provider, certificate, early_data_size):
396
+ def test_s2n_client_with_early_data_rejected_via_hrr(managed_process, tmp_path, cipher, curve, certificate, protocol,
397
+ provider, other_provider, early_data_size):
352
398
  if provider == S2N:
353
- pytest.skip("S2N does not respect ProviderOptions.curve, so does not trigger a retry")
399
+ pytest.skip(
400
+ "S2N does not respect ProviderOptions.curve, so does not trigger a retry")
354
401
 
355
402
  early_data_file = str(tmp_path / EARLY_DATA_FILE)
356
403
  early_data = get_early_data_bytes(early_data_file, early_data_size)
@@ -373,18 +420,19 @@ def test_s2n_client_with_early_data_rejected_via_hrr(managed_process, tmp_path,
373
420
 
374
421
  server_options = copy.copy(options)
375
422
  server_options.mode = Provider.ServerMode
376
- server_options.key = certificate.key # Required for the initial connection
377
- server_options.cert = certificate.cert # Required for the initial connection
423
+ server_options.key = certificate.key # Required for the initial connection
424
+ server_options.cert = certificate.cert # Required for the initial connection
378
425
  server_options.reconnects_before_exit = NUM_CONNECTIONS
379
426
 
380
- server = managed_process(provider, server_options)
381
- s2n_client = managed_process(S2N, client_options)
427
+ server = managed_process(provider, server_options, timeout=10)
428
+ s2n_client = managed_process(S2N, client_options, timeout=10)
382
429
 
383
430
  for results in s2n_client.get_results():
384
431
  results.assert_success()
385
432
  assert S2N_EARLY_DATA_MARKER not in results.stdout
386
433
  assert S2N_HRR_MARKER in results.stdout
387
- assert results.stdout.count(to_bytes(S2N_EARLY_DATA_REJECTED_MARKER)) == NUM_RESUMES
434
+ assert results.stdout.count(
435
+ to_bytes(S2N_EARLY_DATA_REJECTED_MARKER)) == NUM_RESUMES
388
436
 
389
437
  for results in server.get_results():
390
438
  results.assert_success()
@@ -397,14 +445,18 @@ Test the S2N server rejecting early data because of a hello retry request.
397
445
  In order to trigger a successful retry, we need to force the peer to offer us a key share that
398
446
  S2N doesn't support while still supporting at least one curve S2N does support.
399
447
  """
448
+
449
+
400
450
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
401
451
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
402
452
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
403
453
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
404
454
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
405
455
  @pytest.mark.parametrize("provider", CLIENT_PROVIDERS, ids=get_parameter_name)
456
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
406
457
  @pytest.mark.parametrize("early_data_size", [int(MAX_EARLY_DATA/2), int(MAX_EARLY_DATA-1), MAX_EARLY_DATA, 1])
407
- def test_s2n_server_with_early_data_rejected_via_hrr(managed_process, tmp_path, cipher, curve, protocol, provider, certificate, early_data_size):
458
+ def test_s2n_server_with_early_data_rejected_via_hrr(managed_process, tmp_path, cipher, curve, certificate, protocol,
459
+ provider, other_provider, early_data_size):
408
460
  ticket_file = str(tmp_path / TICKET_FILE)
409
461
  early_data_file = str(tmp_path / EARLY_DATA_FILE)
410
462
  early_data = get_early_data_bytes(early_data_file, early_data_size)
@@ -430,8 +482,8 @@ def test_s2n_server_with_early_data_rejected_via_hrr(managed_process, tmp_path,
430
482
  server_options = copy.copy(options)
431
483
  server_options.mode = Provider.ServerMode
432
484
 
433
- s2n_server = managed_process(S2N, server_options)
434
- client = managed_process(provider, client_options)
485
+ s2n_server = managed_process(S2N, server_options, timeout=10)
486
+ client = managed_process(provider, client_options, timeout=10)
435
487
 
436
488
  for results in client.get_results():
437
489
  results.assert_success()
@@ -449,17 +501,22 @@ def test_s2n_server_with_early_data_rejected_via_hrr(managed_process, tmp_path,
449
501
  """
450
502
  Test the S2N server fails if it receives too much early data.
451
503
  """
504
+
505
+
452
506
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
453
507
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
454
508
  @pytest.mark.parametrize("curve", ALL_TEST_CURVES, ids=get_parameter_name)
455
509
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
456
510
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
457
511
  @pytest.mark.parametrize("provider", CLIENT_PROVIDERS, ids=get_parameter_name)
512
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
458
513
  @pytest.mark.parametrize("excess_early_data", [1, 10, MAX_EARLY_DATA])
459
- def test_s2n_server_with_early_data_max_exceeded(managed_process, tmp_path, cipher, curve, protocol, provider, certificate, excess_early_data):
514
+ def test_s2n_server_with_early_data_max_exceeded(managed_process, tmp_path, cipher, curve, certificate, protocol,
515
+ provider, other_provider, excess_early_data):
460
516
  ticket_file = str(tmp_path / TICKET_FILE)
461
517
  early_data_file = str(tmp_path / EARLY_DATA_FILE)
462
- early_data = get_early_data_bytes(early_data_file, MAX_EARLY_DATA + excess_early_data)
518
+ early_data = get_early_data_bytes(
519
+ early_data_file, MAX_EARLY_DATA + excess_early_data)
463
520
 
464
521
  options = ProviderOptions(
465
522
  port=next(available_ports),
@@ -483,8 +540,8 @@ def test_s2n_server_with_early_data_max_exceeded(managed_process, tmp_path, ciph
483
540
  server_options = copy.copy(options)
484
541
  server_options.mode = Provider.ServerMode
485
542
 
486
- s2n_server = managed_process(S2N, server_options)
487
- client = managed_process(provider, client_options)
543
+ s2n_server = managed_process(S2N, server_options, timeout=10)
544
+ client = managed_process(provider, client_options, timeout=10)
488
545
 
489
546
  for results in client.get_results():
490
547
  """
@@ -502,6 +559,6 @@ def test_s2n_server_with_early_data_max_exceeded(managed_process, tmp_path, ciph
502
559
  # Full early data should not be reported
503
560
  assert early_data not in results.stdout
504
561
  # Partial early data should be reported
505
- assert (to_bytes(S2N_EARLY_DATA_RECV_MARKER) + early_data[:MAX_EARLY_DATA]) in results.stdout
562
+ assert (to_bytes(S2N_EARLY_DATA_RECV_MARKER) +
563
+ early_data[:MAX_EARLY_DATA]) in results.stdout
506
564
  assert to_bytes("Bad message encountered") in results.stderr
507
-