Skip to content

Commit

Permalink
Revert "test check: comment out feature probe"
Browse files Browse the repository at this point in the history
This reverts commit 28bffee.
  • Loading branch information
toidiu committed Nov 12, 2024
1 parent 28bffee commit b329d11
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions tests/features/S2N_LIBCRYPTO_SUPPORTS_ENGINE.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,43 @@
* [3] https://github.com/aws/s2n-tls/pull/4873
*/

/* #include <openssl/engine.h> */
#include <openssl/engine.h>

int main()
{
/* /1* S2N_LIBCRYPTO_SUPPORTS_ENGINE is disabled when compiling with AWS-LC. */
/* * */
/* * Custom random is only used when linked with OpenSSL. However, it should be */
/* * possible to compile the ENGINE related code with other libcrypto (eg. */
/* * BoringSSL, LibreSSL). This is not the case with AWS-LC which has a different */
/* * `RAND_METHOD` signature and results in a compilation error. */
/* * */
/* * [1] AWS-LC: https://github.com/aws/aws-lc/blob/main/include/openssl/rand.h#L124 */
/* * [2] OpenSSL: https://github.com/openssl/openssl/blob/master/include/openssl/rand.h#L42 */
/* *1/ */
/* #if defined(OPENSSL_NO_ENGINE) || defined(OPENSSL_IS_AWSLC) */
/* #error "engine is not supported" */
/* #endif */
/* S2N_LIBCRYPTO_SUPPORTS_ENGINE is disabled when compiling with AWS-LC.
*
* Custom random is only used when linked with OpenSSL. However, it should be
* possible to compile the ENGINE related code with other libcrypto (eg.
* BoringSSL, LibreSSL). This is not the case with AWS-LC which has a different
* `RAND_METHOD` signature and results in a compilation error.
*
* [1] AWS-LC: https://github.com/aws/aws-lc/blob/main/include/openssl/rand.h#L124
* [2] OpenSSL: https://github.com/openssl/openssl/blob/master/include/openssl/rand.h#L42
*/
#if defined(OPENSSL_NO_ENGINE) || defined(OPENSSL_IS_AWSLC)
#error "engine is not supported"
#endif

/* /1* Init usage in utils/s2n_random.c *1/ */
/* ENGINE *e = ENGINE_new(); */
/* ENGINE_set_id(e, "id"); */
/* ENGINE_set_name(e, "name"); */
/* ENGINE_set_flags(e, ENGINE_FLAGS_NO_REGISTER_ALL); */
/* ENGINE_set_init_function(e, NULL); */
/* ENGINE_set_RAND(e, NULL); */
/* ENGINE_add(e); */
/* ENGINE_init(e); */
/* ENGINE_set_default(e, ENGINE_METHOD_RAND); */
/* Init usage in utils/s2n_random.c */
ENGINE *e = ENGINE_new();
ENGINE_set_id(e, "id");
ENGINE_set_name(e, "name");
ENGINE_set_flags(e, ENGINE_FLAGS_NO_REGISTER_ALL);
ENGINE_set_init_function(e, NULL);
ENGINE_set_RAND(e, NULL);
ENGINE_add(e);
ENGINE_init(e);
ENGINE_set_default(e, ENGINE_METHOD_RAND);

/* /1* Cleanup usage in utils/s2n_random.c *1/ */
/* ENGINE_remove(e); */
/* ENGINE_finish(e); */
/* ENGINE_unregister_RAND(e); */
/* ENGINE_free(e); */
/* ENGINE_cleanup(); */
/* RAND_set_rand_engine(NULL); */
/* RAND_set_rand_method(NULL); */
/* Cleanup usage in utils/s2n_random.c */
ENGINE_remove(e);
ENGINE_finish(e);
ENGINE_unregister_RAND(e);
ENGINE_free(e);
ENGINE_cleanup();
RAND_set_rand_engine(NULL);
RAND_set_rand_method(NULL);

return 0;
}

0 comments on commit b329d11

Please sign in to comment.