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
@@ -6,6 +6,7 @@ from common import Ciphers, ProviderOptions, Protocols, data_bytes, KemGroups, C
6
6
  from fixtures import managed_process
7
7
  from providers import Provider, S2N, OpenSSL
8
8
  from utils import invalid_test_parameters, get_parameter_name, to_bytes
9
+ from global_flags import get_flag, S2N_PROVIDER_VERSION, S2N_FIPS_MODE
9
10
 
10
11
  CIPHERS = [
11
12
  None, # `None` will default to the appropriate `test_all` cipher preference in the S2N client provider
@@ -27,76 +28,106 @@ KEM_GROUPS = [
27
28
  EXPECTED_RESULTS = {
28
29
  # The tuple keys have the form (client_{cipher, kem_group}, server_{cipher, kem_group})
29
30
  (Ciphers.KMS_PQ_TLS_1_0_2019_06, Ciphers.KMS_PQ_TLS_1_0_2019_06):
30
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
31
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
32
+ "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
31
33
  (Ciphers.KMS_PQ_TLS_1_0_2019_06, Ciphers.KMS_PQ_TLS_1_0_2020_02):
32
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
34
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
35
+ "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
33
36
  (Ciphers.KMS_PQ_TLS_1_0_2019_06, Ciphers.KMS_PQ_TLS_1_0_2020_07):
34
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
37
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
38
+ "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
35
39
 
36
40
  (Ciphers.KMS_PQ_TLS_1_0_2020_02, Ciphers.KMS_PQ_TLS_1_0_2019_06):
37
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
41
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
42
+ "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
38
43
  (Ciphers.KMS_PQ_TLS_1_0_2020_02, Ciphers.KMS_PQ_TLS_1_0_2020_02):
39
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r2-Level1", "kem_group": "NONE"},
44
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
45
+ "kem": "BIKE1r2-Level1", "kem_group": "NONE"},
40
46
  (Ciphers.KMS_PQ_TLS_1_0_2020_02, Ciphers.KMS_PQ_TLS_1_0_2020_07):
41
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r2-Level1", "kem_group": "NONE"},
47
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
48
+ "kem": "BIKE1r2-Level1", "kem_group": "NONE"},
42
49
 
43
50
  (Ciphers.KMS_PQ_TLS_1_0_2020_07, Ciphers.KMS_PQ_TLS_1_0_2019_06):
44
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
51
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
52
+ "kem": "BIKE1r1-Level1", "kem_group": "NONE"},
45
53
  (Ciphers.KMS_PQ_TLS_1_0_2020_07, Ciphers.KMS_PQ_TLS_1_0_2020_02):
46
- {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384", "kem": "BIKE1r2-Level1", "kem_group": "NONE"},
54
+ {"cipher": "ECDHE-BIKE-RSA-AES256-GCM-SHA384",
55
+ "kem": "BIKE1r2-Level1", "kem_group": "NONE"},
47
56
  (Ciphers.KMS_PQ_TLS_1_0_2020_07, Ciphers.KMS_PQ_TLS_1_0_2020_07):
48
- {"cipher": "ECDHE-KYBER-RSA-AES256-GCM-SHA384", "kem": "kyber512r2", "kem_group": "NONE"},
57
+ {"cipher": "ECDHE-KYBER-RSA-AES256-GCM-SHA384",
58
+ "kem": "kyber512r2", "kem_group": "NONE"},
49
59
 
50
60
  (Ciphers.PQ_SIKE_TEST_TLS_1_0_2019_11, Ciphers.KMS_PQ_TLS_1_0_2019_06):
51
- {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384", "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
61
+ {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384",
62
+ "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
52
63
  (Ciphers.PQ_SIKE_TEST_TLS_1_0_2019_11, Ciphers.KMS_PQ_TLS_1_0_2020_02):
53
- {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384", "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
64
+ {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384",
65
+ "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
54
66
  (Ciphers.PQ_SIKE_TEST_TLS_1_0_2019_11, Ciphers.KMS_PQ_TLS_1_0_2020_07):
55
- {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384", "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
67
+ {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384",
68
+ "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
56
69
 
57
70
  (Ciphers.PQ_SIKE_TEST_TLS_1_0_2020_02, Ciphers.KMS_PQ_TLS_1_0_2019_06):
58
- {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384", "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
71
+ {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384",
72
+ "kem": "SIKEp503r1-KEM", "kem_group": "NONE"},
59
73
  (Ciphers.PQ_SIKE_TEST_TLS_1_0_2020_02, Ciphers.KMS_PQ_TLS_1_0_2020_02):
60
- {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384", "kem": "SIKEp434r3-KEM", "kem_group": "NONE"},
74
+ {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384",
75
+ "kem": "SIKEp434r3-KEM", "kem_group": "NONE"},
61
76
  (Ciphers.PQ_SIKE_TEST_TLS_1_0_2020_02, Ciphers.KMS_PQ_TLS_1_0_2020_07):
62
- {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384", "kem": "SIKEp434r3-KEM", "kem_group": "NONE"},
77
+ {"cipher": "ECDHE-SIKE-RSA-AES256-GCM-SHA384",
78
+ "kem": "SIKEp434r3-KEM", "kem_group": "NONE"},
63
79
 
64
80
  (Ciphers.KMS_PQ_TLS_1_0_2019_06, Ciphers.KMS_TLS_1_0_2018_10):
65
- {"cipher": "ECDHE-RSA-AES256-GCM-SHA384", "kem": "NONE", "kem_group": "NONE"},
81
+ {"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
82
+ "kem": "NONE", "kem_group": "NONE"},
66
83
  (Ciphers.KMS_PQ_TLS_1_0_2020_02, Ciphers.KMS_TLS_1_0_2018_10):
67
- {"cipher": "ECDHE-RSA-AES256-GCM-SHA384", "kem": "NONE", "kem_group": "NONE"},
84
+ {"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
85
+ "kem": "NONE", "kem_group": "NONE"},
68
86
  (Ciphers.KMS_PQ_TLS_1_0_2020_07, Ciphers.KMS_TLS_1_0_2018_10):
69
- {"cipher": "ECDHE-RSA-AES256-GCM-SHA384", "kem": "NONE", "kem_group": "NONE"},
87
+ {"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
88
+ "kem": "NONE", "kem_group": "NONE"},
70
89
 
71
90
  (Ciphers.KMS_TLS_1_0_2018_10, Ciphers.KMS_PQ_TLS_1_0_2019_06):
72
- {"cipher": "ECDHE-RSA-AES256-GCM-SHA384", "kem": "NONE", "kem_group": "NONE"},
91
+ {"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
92
+ "kem": "NONE", "kem_group": "NONE"},
73
93
  (Ciphers.KMS_TLS_1_0_2018_10, Ciphers.KMS_PQ_TLS_1_0_2020_02):
74
- {"cipher": "ECDHE-RSA-AES256-GCM-SHA384", "kem": "NONE", "kem_group": "NONE"},
94
+ {"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
95
+ "kem": "NONE", "kem_group": "NONE"},
75
96
  (Ciphers.KMS_TLS_1_0_2018_10, Ciphers.KMS_PQ_TLS_1_0_2020_07):
76
- {"cipher": "ECDHE-RSA-AES256-GCM-SHA384", "kem": "NONE", "kem_group": "NONE"},
97
+ {"cipher": "ECDHE-RSA-AES256-GCM-SHA384",
98
+ "kem": "NONE", "kem_group": "NONE"},
77
99
 
78
100
  # The expected kem_group string for this case purposefully excludes a curve;
79
101
  # depending on how s2n was compiled, the curve may be either x25519 or p256.
80
102
  (Ciphers.PQ_TLS_1_0_2020_12, Ciphers.PQ_TLS_1_0_2020_12):
81
- {"cipher": "TLS_AES_256_GCM_SHA384", "kem": "NONE", "kem_group": "_kyber-512-r2"},
103
+ {"cipher": "TLS_AES_256_GCM_SHA384",
104
+ "kem": "NONE", "kem_group": "_kyber-512-r2"},
82
105
  (Ciphers.PQ_TLS_1_0_2020_12, Ciphers.KMS_PQ_TLS_1_0_2020_07):
83
- {"cipher": "ECDHE-KYBER-RSA-AES256-GCM-SHA384", "kem": "kyber512r2", "kem_group": "NONE"},
106
+ {"cipher": "ECDHE-KYBER-RSA-AES256-GCM-SHA384",
107
+ "kem": "kyber512r2", "kem_group": "NONE"},
84
108
  (Ciphers.KMS_PQ_TLS_1_0_2020_07, Ciphers.PQ_TLS_1_0_2020_12):
85
- {"cipher": "ECDHE-KYBER-RSA-AES256-GCM-SHA384", "kem": "kyber512r2", "kem_group": "NONE"},
109
+ {"cipher": "ECDHE-KYBER-RSA-AES256-GCM-SHA384",
110
+ "kem": "kyber512r2", "kem_group": "NONE"},
86
111
 
87
112
  (Ciphers.PQ_TLS_1_0_2020_12, KemGroups.P256_KYBER512R2):
88
- {"cipher": "AES256_GCM_SHA384", "kem": "NONE", "kem_group": "secp256r1_kyber-512-r2"},
113
+ {"cipher": "AES256_GCM_SHA384", "kem": "NONE",
114
+ "kem_group": "secp256r1_kyber-512-r2"},
89
115
  (Ciphers.PQ_TLS_1_0_2020_12, KemGroups.P256_BIKE1L1FOR2):
90
- {"cipher": "AES256_GCM_SHA384", "kem": "NONE", "kem_group": "secp256r1_bike-1l1fo-r2"},
116
+ {"cipher": "AES256_GCM_SHA384", "kem": "NONE",
117
+ "kem_group": "secp256r1_bike-1l1fo-r2"},
91
118
  (Ciphers.PQ_TLS_1_0_2020_12, KemGroups.P256_SIKEP434R3):
92
- {"cipher": "AES256_GCM_SHA384", "kem": "NONE", "kem_group": "secp256r1_sike-p434-r3"},
119
+ {"cipher": "AES256_GCM_SHA384", "kem": "NONE",
120
+ "kem_group": "secp256r1_sike-p434-r3"},
93
121
 
94
122
  (KemGroups.P256_KYBER512R2, Ciphers.PQ_TLS_1_0_2020_12):
95
- {"cipher": "AES256_GCM_SHA384", "kem": "NONE", "kem_group": "secp256r1_kyber-512-r2"},
123
+ {"cipher": "AES256_GCM_SHA384", "kem": "NONE",
124
+ "kem_group": "secp256r1_kyber-512-r2"},
96
125
  (KemGroups.P256_BIKE1L1FOR2, Ciphers.PQ_TLS_1_0_2020_12):
97
- {"cipher": "AES256_GCM_SHA384", "kem": "NONE", "kem_group": "secp256r1_bike-1l1fo-r2"},
126
+ {"cipher": "AES256_GCM_SHA384", "kem": "NONE",
127
+ "kem_group": "secp256r1_bike-1l1fo-r2"},
98
128
  (KemGroups.P256_SIKEP434R3, Ciphers.PQ_TLS_1_0_2020_12):
99
- {"cipher": "AES256_GCM_SHA384", "kem": "NONE", "kem_group": "secp256r1_sike-p434-r3"},
129
+ {"cipher": "AES256_GCM_SHA384", "kem": "NONE",
130
+ "kem_group": "secp256r1_sike-p434-r3"},
100
131
  }
101
132
 
102
133
  """
@@ -104,6 +135,8 @@ Similar to invalid_test_parameters(), this validates the test parameters for
104
135
  both client and server. Returns True if the test case using these parameters
105
136
  should be skipped.
106
137
  """
138
+
139
+
107
140
  def invalid_pq_handshake_test_parameters(*args, **kwargs):
108
141
  client_cipher_kwargs = kwargs.copy()
109
142
  client_cipher_kwargs["cipher"] = kwargs["client_cipher"]
@@ -128,18 +161,49 @@ def get_oqs_openssl_override_env_vars():
128
161
 
129
162
  def assert_s2n_negotiation_parameters(s2n_results, expected_result):
130
163
  if expected_result is not None:
131
- assert to_bytes(("Cipher negotiated: " + expected_result['cipher'])) in s2n_results.stdout
132
- assert to_bytes(("KEM: " + expected_result['kem'])) in s2n_results.stdout
164
+ assert to_bytes(
165
+ ("Cipher negotiated: " + expected_result['cipher'])) in s2n_results.stdout
166
+ assert to_bytes(
167
+ ("KEM: " + expected_result['kem'])) in s2n_results.stdout
133
168
  # Purposefully leave off the "KEM Group: " prefix in order to perform partial matches
134
169
  # without specifying the curve.
135
170
  assert to_bytes(expected_result['kem_group']) in s2n_results.stdout
136
171
 
137
172
 
173
+ def test_nothing():
174
+ """
175
+ Sometimes the pq handshake test parameters in combination with the s2n libcrypto
176
+ results in no test cases existing. In this case, pass a nothing test to avoid
177
+ marking the entire codebuild run as failed.
178
+ """
179
+ assert True
180
+
181
+
138
182
  @pytest.mark.uncollect_if(func=invalid_pq_handshake_test_parameters)
139
183
  @pytest.mark.parametrize("protocol", [Protocols.TLS12, Protocols.TLS13], ids=get_parameter_name)
184
+ @pytest.mark.parametrize("certificate", [Certificates.RSA_4096_SHA512], ids=get_parameter_name)
140
185
  @pytest.mark.parametrize("client_cipher", CIPHERS, ids=get_parameter_name)
141
186
  @pytest.mark.parametrize("server_cipher", CIPHERS, ids=get_parameter_name)
142
- def test_s2nc_to_s2nd_pq_handshake(managed_process, protocol, client_cipher, server_cipher):
187
+ @pytest.mark.parametrize("provider", [S2N], ids=get_parameter_name)
188
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
189
+ def test_s2nc_to_s2nd_pq_handshake(managed_process, protocol, certificate, client_cipher, server_cipher, provider,
190
+ other_provider):
191
+ # Incorrect cipher is negotiated when both ciphers are PQ_TLS_1_0_2020_12 with
192
+ # openssl 1.0.2, boringssl, and libressl libcryptos
193
+ if all([
194
+ client_cipher == Ciphers.PQ_TLS_1_0_2020_12,
195
+ server_cipher == Ciphers.PQ_TLS_1_0_2020_12,
196
+ any([
197
+ libcrypto in get_flag(S2N_PROVIDER_VERSION)
198
+ for libcrypto in [
199
+ "boringssl",
200
+ "libressl",
201
+ "openssl-1.0.2"
202
+ ]
203
+ ])
204
+ ]):
205
+ pytest.skip()
206
+
143
207
  port = next(available_ports)
144
208
 
145
209
  client_options = ProviderOptions(
@@ -154,14 +218,15 @@ def test_s2nc_to_s2nd_pq_handshake(managed_process, protocol, client_cipher, ser
154
218
  port=port,
155
219
  protocol=protocol,
156
220
  cipher=server_cipher,
157
- cert=Certificates.RSA_4096_SHA512.cert,
158
- key=Certificates.RSA_4096_SHA512.key)
221
+ cert=certificate.cert,
222
+ key=certificate.key)
159
223
 
160
224
  server = managed_process(S2N, server_options, timeout=5)
161
225
  client = managed_process(S2N, client_options, timeout=5)
162
226
 
163
227
  if pq_enabled():
164
- expected_result = EXPECTED_RESULTS.get((client_cipher, server_cipher), None)
228
+ expected_result = EXPECTED_RESULTS.get(
229
+ (client_cipher, server_cipher), None)
165
230
  else:
166
231
  # If PQ is not enabled in s2n, we expect classic handshakes to be negotiated.
167
232
  # Leave the expected cipher blank, as there are multiple possibilities - the
@@ -177,6 +242,7 @@ def test_s2nc_to_s2nd_pq_handshake(managed_process, protocol, client_cipher, ser
177
242
  results.assert_success()
178
243
  assert_s2n_negotiation_parameters(results, expected_result)
179
244
 
245
+
180
246
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
181
247
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
182
248
  @pytest.mark.parametrize("cipher", [Ciphers.PQ_TLS_1_0_2020_12], ids=get_parameter_name)
@@ -218,6 +284,7 @@ def test_s2nc_to_oqs_openssl_pq_handshake(managed_process, protocol, cipher, kem
218
284
  # Server is OQS OpenSSL; just ensure the process exited successfully
219
285
  results.assert_success()
220
286
 
287
+
221
288
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
222
289
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
223
290
  @pytest.mark.parametrize("cipher", [Ciphers.PQ_TLS_1_0_2020_12], ids=get_parameter_name)
@@ -16,8 +16,10 @@ from utils import invalid_test_parameters, get_parameter_name, get_expected_s2n_
16
16
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
17
17
  @pytest.mark.parametrize("protocol", [p for p in PROTOCOLS if p != Protocols.TLS13], ids=get_parameter_name)
18
18
  @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
19
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
19
20
  @pytest.mark.parametrize("use_ticket", [True, False])
20
- def test_session_resumption_s2n_server(managed_process, cipher, curve, protocol, provider, certificate, use_ticket):
21
+ def test_session_resumption_s2n_server(managed_process, cipher, curve, certificate, protocol, provider, other_provider,
22
+ use_ticket):
21
23
  port = next(available_ports)
22
24
 
23
25
  client_options = ProviderOptions(
@@ -32,7 +34,7 @@ def test_session_resumption_s2n_server(managed_process, cipher, curve, protocol,
32
34
  server_options = copy.copy(client_options)
33
35
  server_options.reconnects_before_exit = 6
34
36
  server_options.mode = Provider.ServerMode
35
- server_options.use_session_ticket=use_ticket,
37
+ server_options.use_session_ticket = use_ticket,
36
38
  server_options.key = certificate.key
37
39
  server_options.cert = certificate.cert
38
40
 
@@ -51,7 +53,8 @@ def test_session_resumption_s2n_server(managed_process, cipher, curve, protocol,
51
53
  # S2N should indicate the procotol version in a successful connection.
52
54
  for results in server.get_results():
53
55
  results.assert_success()
54
- assert results.stdout.count(to_bytes("Actual protocol version: {}".format(expected_version))) == 6
56
+ assert results.stdout.count(
57
+ to_bytes("Actual protocol version: {}".format(expected_version))) == 6
55
58
 
56
59
 
57
60
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
@@ -60,8 +63,10 @@ def test_session_resumption_s2n_server(managed_process, cipher, curve, protocol,
60
63
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
61
64
  @pytest.mark.parametrize("protocol", [p for p in PROTOCOLS if p != Protocols.TLS13], ids=get_parameter_name)
62
65
  @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
66
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
63
67
  @pytest.mark.parametrize("use_ticket", [True, False])
64
- def test_session_resumption_s2n_client(managed_process, cipher, curve, protocol, provider, certificate, use_ticket):
68
+ def test_session_resumption_s2n_client(managed_process, cipher, curve, protocol, provider, other_provider, certificate,
69
+ use_ticket):
65
70
  port = next(available_ports)
66
71
 
67
72
  client_options = ProviderOptions(
@@ -89,7 +94,8 @@ def test_session_resumption_s2n_client(managed_process, cipher, curve, protocol,
89
94
  expected_version = get_expected_s2n_version(protocol, OpenSSL)
90
95
  for results in client.get_results():
91
96
  results.assert_success()
92
- assert results.stdout.count(to_bytes("Actual protocol version: {}".format(expected_version))) == 6
97
+ assert results.stdout.count(
98
+ to_bytes("Actual protocol version: {}".format(expected_version))) == 6
93
99
 
94
100
  for results in server.get_results():
95
101
  results.assert_success()
@@ -102,7 +108,9 @@ def test_session_resumption_s2n_client(managed_process, cipher, curve, protocol,
102
108
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
103
109
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
104
110
  @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
105
- def test_tls13_session_resumption_s2n_server(managed_process, tmp_path, cipher, curve, protocol, provider, certificate):
111
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
112
+ def test_tls13_session_resumption_s2n_server(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
113
+ other_provider):
106
114
  port = str(next(available_ports))
107
115
 
108
116
  # Use temp directory to store session tickets
@@ -118,7 +126,7 @@ def test_tls13_session_resumption_s2n_server(managed_process, tmp_path, cipher,
118
126
  curve=curve,
119
127
  insecure=True,
120
128
  reconnect=False,
121
- extra_flags = ['-sess_out', path_to_ticket],
129
+ extra_flags=['-sess_out', path_to_ticket],
122
130
  protocol=protocol)
123
131
 
124
132
  server_options = copy.copy(client_options)
@@ -129,8 +137,10 @@ def test_tls13_session_resumption_s2n_server(managed_process, tmp_path, cipher,
129
137
  server_options.extra_flags = None
130
138
  server_options.data_to_send = close_marker_bytes
131
139
 
132
- server = managed_process(S2N, server_options, timeout=5, send_marker=S2N.get_send_marker())
133
- client = managed_process(provider, client_options, timeout=5, close_marker=str(close_marker_bytes))
140
+ server = managed_process(
141
+ S2N, server_options, timeout=5, send_marker=S2N.get_send_marker())
142
+ client = managed_process(provider, client_options,
143
+ timeout=5, close_marker=str(close_marker_bytes))
134
144
 
135
145
  # The client should have received a session ticket
136
146
  for results in client.get_results():
@@ -150,21 +160,25 @@ def test_tls13_session_resumption_s2n_server(managed_process, tmp_path, cipher,
150
160
  client_options.port = port
151
161
  server_options.port = port
152
162
 
153
- server = managed_process(S2N, server_options, timeout=5, send_marker=S2N.get_send_marker())
154
- client = managed_process(provider, client_options, timeout=5, close_marker=str(close_marker_bytes))
163
+ server = managed_process(
164
+ S2N, server_options, timeout=5, send_marker=S2N.get_send_marker())
165
+ client = managed_process(provider, client_options,
166
+ timeout=5, close_marker=str(close_marker_bytes))
155
167
 
156
168
  s2n_version = get_expected_s2n_version(protocol, provider)
157
169
 
158
170
  # Client has not read server certificate message as this is a resumed session
159
171
  for results in client.get_results():
160
172
  results.assert_success()
161
- assert to_bytes("SSL_connect:SSLv3/TLS read server certificate") not in results.stderr
173
+ assert to_bytes(
174
+ "SSL_connect:SSLv3/TLS read server certificate") not in results.stderr
162
175
 
163
176
  # The server should indicate a session has been resumed
164
177
  for results in server.get_results():
165
178
  results.assert_success()
166
179
  assert b'Resumed session' in results.stdout
167
- assert to_bytes("Actual protocol version: {}".format(s2n_version)) in results.stdout
180
+ assert to_bytes("Actual protocol version: {}".format(
181
+ s2n_version)) in results.stdout
168
182
 
169
183
 
170
184
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
@@ -173,7 +187,9 @@ def test_tls13_session_resumption_s2n_server(managed_process, tmp_path, cipher,
173
187
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
174
188
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
175
189
  @pytest.mark.parametrize("provider", [OpenSSL, S2N], ids=get_parameter_name)
176
- def test_tls13_session_resumption_s2n_client(managed_process, cipher, curve, protocol, provider, certificate):
190
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
191
+ def test_tls13_session_resumption_s2n_client(managed_process, cipher, curve, certificate, protocol, provider,
192
+ other_provider):
177
193
  port = str(next(available_ports))
178
194
 
179
195
  # The reconnect option for s2nc allows the client to reconnect automatically
@@ -206,20 +222,27 @@ def test_tls13_session_resumption_s2n_client(managed_process, cipher, curve, pro
206
222
  # s2nc indicates the number of resumed connections in its output
207
223
  for results in client.get_results():
208
224
  results.assert_success()
209
- assert results.stdout.count(b'Resumed session') == num_resumed_connections
210
- assert to_bytes("Actual protocol version: {}".format(s2n_version)) in results.stdout
225
+ assert results.stdout.count(
226
+ b'Resumed session') == num_resumed_connections
227
+ assert to_bytes("Actual protocol version: {}".format(
228
+ s2n_version)) in results.stdout
211
229
 
212
- server_accepts_str = str(num_resumed_connections + num_full_connections) + " server accepts that finished"
230
+ server_accepts_str = str(
231
+ num_resumed_connections + num_full_connections) + " server accepts that finished"
213
232
 
214
233
  for results in server.get_results():
215
234
  results.assert_success()
216
235
  if provider is S2N:
217
- assert results.stdout.count(b'Resumed session') == num_resumed_connections
218
- assert to_bytes("Actual protocol version: {}".format(s2n_version)) in results.stdout
236
+ assert results.stdout.count(
237
+ b'Resumed session') == num_resumed_connections
238
+ assert to_bytes("Actual protocol version: {}".format(
239
+ s2n_version)) in results.stdout
219
240
  else:
220
241
  assert to_bytes(server_accepts_str) in results.stdout
221
242
  # s_server only writes one certificate message in all of the connections
222
- assert results.stderr.count(b'SSL_accept:SSLv3/TLS write certificate') == num_full_connections
243
+ assert results.stderr.count(
244
+ b'SSL_accept:SSLv3/TLS write certificate') == num_full_connections
245
+
223
246
 
224
247
  @pytest.mark.uncollect_if(func=invalid_test_parameters)
225
248
  @pytest.mark.parametrize("cipher", TLS13_CIPHERS, ids=get_parameter_name)
@@ -227,7 +250,9 @@ def test_tls13_session_resumption_s2n_client(managed_process, cipher, curve, pro
227
250
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
228
251
  @pytest.mark.parametrize("protocol", [Protocols.TLS13], ids=get_parameter_name)
229
252
  @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
230
- def test_s2nd_falls_back_to_full_connection(managed_process, tmp_path, cipher, curve, protocol, provider, certificate):
253
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
254
+ def test_s2nd_falls_back_to_full_connection(managed_process, tmp_path, cipher, curve, certificate, protocol, provider,
255
+ other_provider):
231
256
  port = str(next(available_ports))
232
257
 
233
258
  # Use temp directory to store session tickets
@@ -247,8 +272,8 @@ def test_s2nd_falls_back_to_full_connection(managed_process, tmp_path, cipher, c
247
272
  curve=curve,
248
273
  insecure=True,
249
274
  reconnect=False,
250
- extra_flags = ['-sess_out', path_to_ticket],
251
- data_to_send = data_bytes(4069),
275
+ extra_flags=['-sess_out', path_to_ticket],
276
+ data_to_send=data_bytes(4069),
252
277
  protocol=protocol)
253
278
 
254
279
  server_options = copy.copy(client_options)
@@ -287,10 +312,12 @@ def test_s2nd_falls_back_to_full_connection(managed_process, tmp_path, cipher, c
287
312
  # Client has read server certificate because this is a full connection
288
313
  for results in client.get_results():
289
314
  results.assert_success()
290
- assert to_bytes("SSL_connect:SSLv3/TLS read server certificate") in results.stderr
315
+ assert to_bytes(
316
+ "SSL_connect:SSLv3/TLS read server certificate") in results.stderr
291
317
 
292
318
  # The server should indicate a session has not been resumed
293
319
  for results in server.get_results():
294
320
  results.assert_success()
295
321
  assert b'Resumed session' not in results.stdout
296
- assert to_bytes("Actual protocol version: {}".format(s2n_version)) in results.stdout
322
+ assert to_bytes("Actual protocol version: {}".format(
323
+ s2n_version)) in results.stdout
@@ -4,7 +4,7 @@ import pytest
4
4
  from configuration import available_ports, ALL_TEST_CIPHERS, ALL_TEST_CURVES, ALL_TEST_CERTS
5
5
  from common import ProviderOptions, Protocols, Ciphers, Certificates, Signatures, data_bytes
6
6
  from fixtures import managed_process
7
- from providers import Provider, S2N, OpenSSL
7
+ from providers import Provider, S2N, OpenSSL, GnuTLS
8
8
  from utils import invalid_test_parameters, get_parameter_name, get_expected_s2n_version, to_bytes
9
9
 
10
10
 
@@ -29,16 +29,20 @@ all_sigs = [
29
29
 
30
30
 
31
31
  def signature_marker(mode, signature):
32
- return to_bytes("{mode} signature negotiated: {type}+{digest}" \
33
- .format(mode=mode.title(), type=signature.sig_type, digest=signature.sig_digest))
32
+ return to_bytes("{mode} signature negotiated: {type}+{digest}"
33
+ .format(mode=mode.title(), type=signature.sig_type, digest=signature.sig_digest))
34
34
 
35
35
 
36
36
  def skip_ciphers(*args, **kwargs):
37
+ provider = kwargs.get('provider')
37
38
  cert = kwargs.get('certificate')
38
39
  cipher = kwargs.get('cipher')
39
40
  protocol = kwargs.get('protocol')
40
41
  sigalg = kwargs.get('signature')
41
42
 
43
+ if not provider.supports_signature(sigalg):
44
+ return True
45
+
42
46
  if not cert.compatible_with_cipher(cipher):
43
47
  return True
44
48
 
@@ -56,12 +60,14 @@ def skip_ciphers(*args, **kwargs):
56
60
 
57
61
  @pytest.mark.uncollect_if(func=skip_ciphers)
58
62
  @pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
59
- @pytest.mark.parametrize("provider", [OpenSSL])
63
+ @pytest.mark.parametrize("provider", [OpenSSL, GnuTLS])
64
+ @pytest.mark.parametrize("other_provider", [S2N])
60
65
  @pytest.mark.parametrize("protocol", [Protocols.TLS13, Protocols.TLS12], ids=get_parameter_name)
61
66
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
62
67
  @pytest.mark.parametrize("signature", all_sigs, ids=get_parameter_name)
63
- @pytest.mark.parametrize("client_auth", [True, False], ids=get_parameter_name)
64
- def test_s2n_server_signature_algorithms(managed_process, cipher, provider, protocol, certificate, signature, client_auth):
68
+ @pytest.mark.parametrize("client_auth", [True, False], ids=lambda val: "client-auth" if val else "no-client-auth")
69
+ def test_s2n_server_signature_algorithms(managed_process, cipher, provider, other_provider, protocol, certificate,
70
+ signature, client_auth):
65
71
  port = next(available_ports)
66
72
 
67
73
  random_bytes = data_bytes(64)
@@ -74,8 +80,13 @@ def test_s2n_server_signature_algorithms(managed_process, cipher, provider, prot
74
80
  use_client_auth=client_auth,
75
81
  key=certificate.key,
76
82
  cert=certificate.cert,
77
- extra_flags=['-sigalgs', signature.name],
78
- protocol=protocol)
83
+ signature_algorithm=signature,
84
+ protocol=protocol
85
+ )
86
+
87
+ if provider == GnuTLS:
88
+ # GnuTLS fails the CA verification. It must be run with this check disabled.
89
+ client_options.extra_flags = ["--no-ca-verification"]
79
90
 
80
91
  server_options = copy.copy(client_options)
81
92
  server_options.extra_flags = None
@@ -94,20 +105,25 @@ def test_s2n_server_signature_algorithms(managed_process, cipher, provider, prot
94
105
 
95
106
  for results in server.get_results():
96
107
  results.assert_success()
97
- assert to_bytes("Actual protocol version: {}".format(expected_version)) in results.stdout
98
- assert signature_marker(Provider.ServerMode, signature) in results.stdout
99
- assert (signature_marker(Provider.ClientMode, signature) in results.stdout) == client_auth
108
+ assert to_bytes("Actual protocol version: {}".format(
109
+ expected_version)) in results.stdout
110
+ assert signature_marker(Provider.ServerMode,
111
+ signature) in results.stdout
112
+ assert (signature_marker(Provider.ClientMode, signature)
113
+ in results.stdout) == client_auth
100
114
  assert random_bytes in results.stdout
101
115
 
102
116
 
103
117
  @pytest.mark.uncollect_if(func=skip_ciphers)
104
118
  @pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
105
- @pytest.mark.parametrize("provider", [OpenSSL])
119
+ @pytest.mark.parametrize("provider", [OpenSSL, GnuTLS])
120
+ @pytest.mark.parametrize("other_provider", [S2N])
106
121
  @pytest.mark.parametrize("protocol", [Protocols.TLS13, Protocols.TLS12], ids=get_parameter_name)
107
122
  @pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
108
123
  @pytest.mark.parametrize("signature", all_sigs, ids=get_parameter_name)
109
- @pytest.mark.parametrize("client_auth", [True, False], ids=get_parameter_name)
110
- def test_s2n_client_signature_algorithms(managed_process, cipher, provider, protocol, certificate, signature, client_auth):
124
+ @pytest.mark.parametrize("client_auth", [True, False], ids=lambda val: "client-auth" if val else "no-client-auth")
125
+ def test_s2n_client_signature_algorithms(managed_process, cipher, provider, other_provider, protocol, certificate,
126
+ signature, client_auth):
111
127
  port = next(available_ports)
112
128
 
113
129
  random_bytes = data_bytes(64)
@@ -128,14 +144,20 @@ def test_s2n_client_signature_algorithms(managed_process, cipher, provider, prot
128
144
  server_options.key = certificate.key
129
145
  server_options.cert = certificate.cert
130
146
  server_options.trust_store = certificate.cert
131
- server_options.extra_flags=['-sigalgs', signature.name]
147
+ server_options.signature_algorithm = signature
148
+
149
+ kill_marker = None
150
+ if provider == GnuTLS:
151
+ kill_marker = random_bytes
132
152
 
133
- server = managed_process(provider, server_options, timeout=5)
153
+ server = managed_process(provider, server_options,
154
+ timeout=5, kill_marker=kill_marker)
134
155
  client = managed_process(S2N, client_options, timeout=5)
135
156
 
136
157
  for results in server.get_results():
137
158
  results.assert_success()
138
- assert random_bytes in results.stdout
159
+ assert any(
160
+ [random_bytes in stream for stream in results.output_streams()])
139
161
 
140
162
  expected_version = get_expected_s2n_version(protocol, provider)
141
163
 
@@ -147,10 +169,14 @@ def test_s2n_client_signature_algorithms(managed_process, cipher, provider, prot
147
169
  #
148
170
  # This mostly has to be inferred from the RFCs, but this blog post is a pretty good summary
149
171
  # of the situation: https://timtaubert.de/blog/2016/07/the-evolution-of-signatures-in-tls/
150
- server_sigalg_used = not cipher.iana_standard_name.startswith("TLS_RSA_WITH_")
172
+ server_sigalg_used = not cipher.iana_standard_name.startswith(
173
+ "TLS_RSA_WITH_")
151
174
 
152
175
  for results in client.get_results():
153
176
  results.assert_success()
154
- assert to_bytes("Actual protocol version: {}".format(expected_version)) in results.stdout
155
- assert signature_marker(Provider.ServerMode, signature) in results.stdout or not server_sigalg_used
156
- assert (signature_marker(Provider.ClientMode, signature) in results.stdout) == client_auth
177
+ assert to_bytes("Actual protocol version: {}".format(
178
+ expected_version)) in results.stdout
179
+ assert signature_marker(
180
+ Provider.ServerMode, signature) in results.stdout or not server_sigalg_used
181
+ assert (signature_marker(Provider.ClientMode, signature)
182
+ in results.stdout) == client_auth
@@ -19,7 +19,8 @@ def filter_cipher_list(*args, **kwargs):
19
19
  protocol = kwargs.get('protocol')
20
20
  cert_test_case = kwargs.get('cert_test_case')
21
21
 
22
- lowest_protocol_cipher = min(cert_test_case.client_ciphers, key=lambda x: x.min_version)
22
+ lowest_protocol_cipher = min(
23
+ cert_test_case.client_ciphers, key=lambda x: x.min_version)
23
24
  if protocol < lowest_protocol_cipher.min_version:
24
25
  return True
25
26
 
@@ -27,10 +28,11 @@ def filter_cipher_list(*args, **kwargs):
27
28
 
28
29
 
29
30
  @pytest.mark.uncollect_if(func=filter_cipher_list)
30
- @pytest.mark.parametrize("provider", [OpenSSL])
31
+ @pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
32
+ @pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
31
33
  @pytest.mark.parametrize("protocol", [Protocols.TLS13, Protocols.TLS12], ids=get_parameter_name)
32
34
  @pytest.mark.parametrize("cert_test_case", MULTI_CERT_TEST_CASES)
33
- def test_sni_match(managed_process, provider, protocol, cert_test_case):
35
+ def test_sni_match(managed_process, provider, other_provider, protocol, cert_test_case):
34
36
  port = next(available_ports)
35
37
 
36
38
  client_options = ProviderOptions(
@@ -39,17 +41,18 @@ def test_sni_match(managed_process, provider, protocol, cert_test_case):
39
41
  insecure=False,
40
42
  verify_hostname=True,
41
43
  server_name=cert_test_case.client_sni,
42
- cipher = cert_test_case.client_ciphers,
44
+ cipher=cert_test_case.client_ciphers,
43
45
  protocol=protocol)
44
46
 
45
47
  server_options = ProviderOptions(
46
- mode = Provider.ServerMode,
48
+ mode=Provider.ServerMode,
47
49
  port=port,
48
50
  extra_flags=[],
49
51
  protocol=protocol)
50
52
 
51
53
  # Setup the certificate chain for S2ND based on the multicert test case
52
- cert_key_list = [(cert[0],cert[1]) for cert in cert_test_case.server_certs]
54
+ cert_key_list = [(cert[0], cert[1])
55
+ for cert in cert_test_case.server_certs]
53
56
  for cert_key_path in cert_key_list:
54
57
  server_options.extra_flags.extend(['--cert', cert_key_path[0]])
55
58
  server_options.extra_flags.extend(['--key', cert_key_path[1]])
@@ -64,7 +67,8 @@ def test_sni_match(managed_process, provider, protocol, cert_test_case):
64
67
 
65
68
  for results in server.get_results():
66
69
  results.assert_success()
67
- assert to_bytes("Actual protocol version: {}".format(expected_version)) in results.stdout
70
+ assert to_bytes("Actual protocol version: {}".format(
71
+ expected_version)) in results.stdout
68
72
  if cert_test_case.client_sni is not None:
69
- assert to_bytes("Server name: {}".format(cert_test_case.client_sni)) in results.stdout
70
-
73
+ assert to_bytes("Server name: {}".format(
74
+ cert_test_case.client_sni)) in results.stdout