#include <openssl/tls1.h>
#include "e_os.h"
+#include "test_main.h"
#include "testutil.h"
typedef struct cipherlist_test_fixture {
TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
#endif
#ifndef OPENSSL_NO_TLS1_3
+ TLS1_3_CK_AES_256_GCM_SHA384,
+ TLS1_3_CK_CHACHA20_POLY1305_SHA256,
TLS1_3_CK_AES_128_GCM_SHA256,
#endif
#ifndef OPENSSL_NO_TLS1_2
OPENSSL_assert(ciphers != NULL);
num_expected_ciphers = OSSL_NELEM(default_ciphers_in_order);
num_ciphers = sk_SSL_CIPHER_num(ciphers);
- if (num_ciphers != num_expected_ciphers) {
- fprintf(stderr, "Expected %d supported ciphers, got %d.\n",
- num_expected_ciphers, num_ciphers);
+ if (!TEST_int_eq(num_ciphers, num_expected_ciphers))
goto err;
- }
for (i = 0; i < num_ciphers; i++) {
expected_cipher_id = default_ciphers_in_order[i];
cipher_id = SSL_CIPHER_get_id(sk_SSL_CIPHER_value(ciphers, i));
- if (cipher_id != expected_cipher_id) {
- fprintf(stderr, "Wrong cipher at position %d: expected %x, "
- "got %x\n", i, expected_cipher_id, cipher_id);
+ if (!TEST_int_eq(cipher_id, expected_cipher_id)) {
+ TEST_info("Wrong cipher at position %d", i);
goto err;
}
}
EXECUTE_CIPHERLIST_TEST();
}
-int main(int argc, char **argv)
+void register_tests()
{
- int result = 0;
-
ADD_TEST(test_default_cipherlist_implicit);
ADD_TEST(test_default_cipherlist_explicit);
-
- result = run_tests(argv[0]);
-
- return result;
}