ct_test.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /*
  2. * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <ctype.h>
  10. #include <math.h>
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <string.h>
  14. #include <openssl/ct.h>
  15. #include <openssl/err.h>
  16. #include <openssl/pem.h>
  17. #include <openssl/x509.h>
  18. #include <openssl/x509v3.h>
  19. #include "testutil.h"
  20. #ifndef OPENSSL_NO_CT
  21. /* Used when declaring buffers to read text files into */
  22. #define CT_TEST_MAX_FILE_SIZE 8096
  23. static char *certs_dir = NULL;
  24. static char *ct_dir = NULL;
  25. typedef struct ct_test_fixture {
  26. const char *test_case_name;
  27. /* The current time in milliseconds */
  28. uint64_t epoch_time_in_ms;
  29. /* The CT log store to use during tests */
  30. CTLOG_STORE* ctlog_store;
  31. /* Set the following to test handling of SCTs in X509 certificates */
  32. const char *certs_dir;
  33. char *certificate_file;
  34. char *issuer_file;
  35. /* Expected number of SCTs */
  36. int expected_sct_count;
  37. /* Expected number of valid SCTS */
  38. int expected_valid_sct_count;
  39. /* Set the following to test handling of SCTs in TLS format */
  40. const unsigned char *tls_sct_list;
  41. size_t tls_sct_list_len;
  42. STACK_OF(SCT) *sct_list;
  43. /*
  44. * A file to load the expected SCT text from.
  45. * This text will be compared to the actual text output during the test.
  46. * A maximum of |CT_TEST_MAX_FILE_SIZE| bytes will be read of this file.
  47. */
  48. const char *sct_dir;
  49. const char *sct_text_file;
  50. /* Whether to test the validity of the SCT(s) */
  51. int test_validity;
  52. } CT_TEST_FIXTURE;
  53. static CT_TEST_FIXTURE set_up(const char *const test_case_name)
  54. {
  55. CT_TEST_FIXTURE fixture;
  56. int setup_ok = 1;
  57. memset(&fixture, 0, sizeof(fixture));
  58. fixture.test_case_name = test_case_name;
  59. fixture.epoch_time_in_ms = 1473269626000; /* Sep 7 17:33:46 2016 GMT */
  60. fixture.ctlog_store = CTLOG_STORE_new();
  61. if (fixture.ctlog_store == NULL) {
  62. setup_ok = 0;
  63. fprintf(stderr, "Failed to create a new CT log store\n");
  64. goto end;
  65. }
  66. if (CTLOG_STORE_load_default_file(fixture.ctlog_store) != 1) {
  67. setup_ok = 0;
  68. fprintf(stderr, "Failed to load CT log list\n");
  69. goto end;
  70. }
  71. end:
  72. if (!setup_ok) {
  73. CTLOG_STORE_free(fixture.ctlog_store);
  74. exit(EXIT_FAILURE);
  75. }
  76. return fixture;
  77. }
  78. static void tear_down(CT_TEST_FIXTURE fixture)
  79. {
  80. CTLOG_STORE_free(fixture.ctlog_store);
  81. SCT_LIST_free(fixture.sct_list);
  82. ERR_print_errors_fp(stderr);
  83. }
  84. static char *mk_file_path(const char *dir, const char *file)
  85. {
  86. char *full_file = NULL;
  87. size_t full_file_l = 0;
  88. const char *sep = "";
  89. #ifndef OPENSSL_SYS_VMS
  90. sep = "/";
  91. #endif
  92. full_file_l = strlen(dir) + strlen(sep) + strlen(file) + 1;
  93. full_file = OPENSSL_zalloc(full_file_l);
  94. if (full_file != NULL) {
  95. OPENSSL_strlcpy(full_file, dir, full_file_l);
  96. OPENSSL_strlcat(full_file, sep, full_file_l);
  97. OPENSSL_strlcat(full_file, file, full_file_l);
  98. }
  99. return full_file;
  100. }
  101. static X509 *load_pem_cert(const char *dir, const char *file)
  102. {
  103. X509 *cert = NULL;
  104. char *file_path = mk_file_path(dir, file);
  105. if (file_path != NULL) {
  106. BIO *cert_io = BIO_new_file(file_path, "r");
  107. OPENSSL_free(file_path);
  108. if (cert_io != NULL)
  109. cert = PEM_read_bio_X509(cert_io, NULL, NULL, NULL);
  110. BIO_free(cert_io);
  111. }
  112. return cert;
  113. }
  114. static int read_text_file(const char *dir, const char *file,
  115. char *buffer, int buffer_length)
  116. {
  117. int result = -1;
  118. char *file_path = mk_file_path(dir, file);
  119. if (file_path != NULL) {
  120. BIO *file_io = BIO_new_file(file_path, "r");
  121. OPENSSL_free(file_path);
  122. if (file_io != NULL) {
  123. result = BIO_read(file_io, buffer, buffer_length);
  124. BIO_free(file_io);
  125. }
  126. }
  127. return result;
  128. }
  129. static int compare_sct_list_printout(STACK_OF(SCT) *sct,
  130. const char *expected_output)
  131. {
  132. BIO *text_buffer = NULL;
  133. char *actual_output = NULL;
  134. int result = 1;
  135. text_buffer = BIO_new(BIO_s_mem());
  136. if (text_buffer == NULL) {
  137. fprintf(stderr, "Unable to allocate buffer\n");
  138. goto end;
  139. }
  140. SCT_LIST_print(sct, text_buffer, 0, "\n", NULL);
  141. /* Append null terminator because we're about to use the buffer contents
  142. * as a string. */
  143. if (BIO_write(text_buffer, "\0", 1) != 1) {
  144. fprintf(stderr, "Failed to append null terminator to SCT text\n");
  145. goto end;
  146. }
  147. BIO_get_mem_data(text_buffer, &actual_output);
  148. result = strcmp(actual_output, expected_output);
  149. if (result != 0) {
  150. fprintf(stderr,
  151. "Expected SCT printout:\n%s\nActual SCT printout:\n%s\n",
  152. expected_output, actual_output);
  153. }
  154. end:
  155. BIO_free(text_buffer);
  156. return result;
  157. }
  158. static int compare_extension_printout(X509_EXTENSION *extension,
  159. const char *expected_output)
  160. {
  161. BIO *text_buffer = NULL;
  162. char *actual_output = NULL;
  163. int result = 1;
  164. text_buffer = BIO_new(BIO_s_mem());
  165. if (text_buffer == NULL) {
  166. fprintf(stderr, "Unable to allocate buffer\n");
  167. goto end;
  168. }
  169. if (!X509V3_EXT_print(text_buffer, extension, X509V3_EXT_DEFAULT, 0)) {
  170. fprintf(stderr, "Failed to print extension\n");
  171. goto end;
  172. }
  173. /* Append null terminator because we're about to use the buffer contents
  174. * as a string. */
  175. if (BIO_write(text_buffer, "\0", 1) != 1) {
  176. fprintf(stderr,
  177. "Failed to append null terminator to extension text\n");
  178. goto end;
  179. }
  180. BIO_get_mem_data(text_buffer, &actual_output);
  181. result = strcmp(actual_output, expected_output);
  182. if (result != 0) {
  183. fprintf(stderr,
  184. "Expected SCT printout:\n%s\nActual SCT printout:\n%s\n",
  185. expected_output, actual_output);
  186. }
  187. end:
  188. BIO_free(text_buffer);
  189. return result;
  190. }
  191. static int assert_validity(CT_TEST_FIXTURE fixture,
  192. STACK_OF(SCT) *scts,
  193. CT_POLICY_EVAL_CTX *policy_ctx) {
  194. int invalid_sct_count = 0;
  195. int valid_sct_count = 0;
  196. int i;
  197. if (SCT_LIST_validate(scts, policy_ctx) < 0) {
  198. fprintf(stderr, "Error verifying SCTs\n");
  199. return 0;
  200. }
  201. for (i = 0; i < sk_SCT_num(scts); ++i) {
  202. SCT *sct_i = sk_SCT_value(scts, i);
  203. switch (SCT_get_validation_status(sct_i)) {
  204. case SCT_VALIDATION_STATUS_VALID:
  205. ++valid_sct_count;
  206. break;
  207. case SCT_VALIDATION_STATUS_INVALID:
  208. ++invalid_sct_count;
  209. break;
  210. default:
  211. /* Ignore other validation statuses. */
  212. break;
  213. }
  214. }
  215. if (valid_sct_count != fixture.expected_valid_sct_count) {
  216. int unverified_sct_count = sk_SCT_num(scts) -
  217. invalid_sct_count - valid_sct_count;
  218. fprintf(stderr,
  219. "%d SCTs failed verification\n"
  220. "%d SCTs passed verification (%d expected)\n"
  221. "%d SCTs were unverified\n",
  222. invalid_sct_count,
  223. valid_sct_count,
  224. fixture.expected_valid_sct_count,
  225. unverified_sct_count);
  226. return 0;
  227. }
  228. return 1;
  229. }
  230. static int execute_cert_test(CT_TEST_FIXTURE fixture)
  231. {
  232. int success = 0;
  233. X509 *cert = NULL, *issuer = NULL;
  234. STACK_OF(SCT) *scts = NULL;
  235. SCT *sct = NULL;
  236. char expected_sct_text[CT_TEST_MAX_FILE_SIZE];
  237. int sct_text_len = 0;
  238. unsigned char *tls_sct_list = NULL;
  239. size_t tls_sct_list_len = 0;
  240. CT_POLICY_EVAL_CTX *ct_policy_ctx = CT_POLICY_EVAL_CTX_new();
  241. if (fixture.sct_text_file != NULL) {
  242. sct_text_len = read_text_file(fixture.sct_dir, fixture.sct_text_file,
  243. expected_sct_text,
  244. CT_TEST_MAX_FILE_SIZE - 1);
  245. if (sct_text_len < 0) {
  246. fprintf(stderr, "Test data file not found: %s\n",
  247. fixture.sct_text_file);
  248. goto end;
  249. }
  250. expected_sct_text[sct_text_len] = '\0';
  251. }
  252. CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(
  253. ct_policy_ctx, fixture.ctlog_store);
  254. CT_POLICY_EVAL_CTX_set_time(ct_policy_ctx, fixture.epoch_time_in_ms);
  255. if (fixture.certificate_file != NULL) {
  256. int sct_extension_index;
  257. X509_EXTENSION *sct_extension = NULL;
  258. cert = load_pem_cert(fixture.certs_dir, fixture.certificate_file);
  259. if (cert == NULL) {
  260. fprintf(stderr, "Unable to load certificate: %s\n",
  261. fixture.certificate_file);
  262. goto end;
  263. }
  264. CT_POLICY_EVAL_CTX_set1_cert(ct_policy_ctx, cert);
  265. if (fixture.issuer_file != NULL) {
  266. issuer = load_pem_cert(fixture.certs_dir, fixture.issuer_file);
  267. if (issuer == NULL) {
  268. fprintf(stderr, "Unable to load issuer certificate: %s\n",
  269. fixture.issuer_file);
  270. goto end;
  271. }
  272. CT_POLICY_EVAL_CTX_set1_issuer(ct_policy_ctx, issuer);
  273. }
  274. sct_extension_index =
  275. X509_get_ext_by_NID(cert, NID_ct_precert_scts, -1);
  276. sct_extension = X509_get_ext(cert, sct_extension_index);
  277. if (fixture.expected_sct_count > 0) {
  278. if (sct_extension == NULL) {
  279. fprintf(stderr, "SCT extension not found in: %s\n",
  280. fixture.certificate_file);
  281. goto end;
  282. }
  283. if (fixture.sct_text_file
  284. && compare_extension_printout(sct_extension,
  285. expected_sct_text)) {
  286. goto end;
  287. }
  288. if (fixture.test_validity) {
  289. int i;
  290. scts = X509V3_EXT_d2i(sct_extension);
  291. for (i = 0; i < sk_SCT_num(scts); ++i) {
  292. SCT *sct_i = sk_SCT_value(scts, i);
  293. if (!SCT_set_source(sct_i, SCT_SOURCE_X509V3_EXTENSION)) {
  294. fprintf(stderr,
  295. "Error setting SCT source to X509v3 extension\n");
  296. goto end;
  297. }
  298. }
  299. if (!assert_validity(fixture, scts, ct_policy_ctx))
  300. goto end;
  301. }
  302. } else if (sct_extension != NULL) {
  303. fprintf(stderr,
  304. "Expected no SCTs, but found SCT extension in: %s\n",
  305. fixture.certificate_file);
  306. goto end;
  307. }
  308. }
  309. if (fixture.tls_sct_list != NULL) {
  310. const unsigned char *p = fixture.tls_sct_list;
  311. if (o2i_SCT_LIST(&scts, &p, fixture.tls_sct_list_len) == NULL) {
  312. fprintf(stderr, "Failed to decode SCTs from TLS format\n");
  313. goto end;
  314. }
  315. if (fixture.test_validity && cert != NULL) {
  316. if (!assert_validity(fixture, scts, ct_policy_ctx))
  317. goto end;
  318. }
  319. if (fixture.sct_text_file
  320. && compare_sct_list_printout(scts, expected_sct_text)) {
  321. goto end;
  322. }
  323. tls_sct_list_len = i2o_SCT_LIST(scts, &tls_sct_list);
  324. if (tls_sct_list_len != fixture.tls_sct_list_len ||
  325. memcmp(fixture.tls_sct_list, tls_sct_list, tls_sct_list_len) != 0) {
  326. fprintf(stderr,
  327. "Failed to encode SCTs into TLS format correctly\n");
  328. goto end;
  329. }
  330. }
  331. success = 1;
  332. end:
  333. X509_free(cert);
  334. X509_free(issuer);
  335. SCT_LIST_free(scts);
  336. SCT_free(sct);
  337. CT_POLICY_EVAL_CTX_free(ct_policy_ctx);
  338. OPENSSL_free(tls_sct_list);
  339. return success;
  340. }
  341. #define SETUP_CT_TEST_FIXTURE() SETUP_TEST_FIXTURE(CT_TEST_FIXTURE, set_up)
  342. #define EXECUTE_CT_TEST() EXECUTE_TEST(execute_cert_test, tear_down)
  343. static int test_no_scts_in_certificate()
  344. {
  345. SETUP_CT_TEST_FIXTURE();
  346. fixture.certs_dir = certs_dir;
  347. fixture.certificate_file = "leaf.pem";
  348. fixture.issuer_file = "subinterCA.pem";
  349. fixture.expected_sct_count = 0;
  350. EXECUTE_CT_TEST();
  351. }
  352. static int test_one_sct_in_certificate()
  353. {
  354. SETUP_CT_TEST_FIXTURE();
  355. fixture.certs_dir = certs_dir;
  356. fixture.certificate_file = "embeddedSCTs1.pem";
  357. fixture.issuer_file = "embeddedSCTs1_issuer.pem";
  358. fixture.expected_sct_count = 1;
  359. fixture.sct_dir = certs_dir;
  360. fixture.sct_text_file = "embeddedSCTs1.sct";
  361. EXECUTE_CT_TEST();
  362. }
  363. static int test_multiple_scts_in_certificate()
  364. {
  365. SETUP_CT_TEST_FIXTURE();
  366. fixture.certs_dir = certs_dir;
  367. fixture.certificate_file = "embeddedSCTs3.pem";
  368. fixture.issuer_file = "embeddedSCTs3_issuer.pem";
  369. fixture.expected_sct_count = 3;
  370. fixture.sct_dir = certs_dir;
  371. fixture.sct_text_file = "embeddedSCTs3.sct";
  372. EXECUTE_CT_TEST();
  373. }
  374. static int test_verify_one_sct()
  375. {
  376. SETUP_CT_TEST_FIXTURE();
  377. fixture.certs_dir = certs_dir;
  378. fixture.certificate_file = "embeddedSCTs1.pem";
  379. fixture.issuer_file = "embeddedSCTs1_issuer.pem";
  380. fixture.expected_sct_count = fixture.expected_valid_sct_count = 1;
  381. fixture.test_validity = 1;
  382. EXECUTE_CT_TEST();
  383. }
  384. static int test_verify_multiple_scts()
  385. {
  386. SETUP_CT_TEST_FIXTURE();
  387. fixture.certs_dir = certs_dir;
  388. fixture.certificate_file = "embeddedSCTs3.pem";
  389. fixture.issuer_file = "embeddedSCTs3_issuer.pem";
  390. fixture.expected_sct_count = fixture.expected_valid_sct_count = 3;
  391. fixture.test_validity = 1;
  392. EXECUTE_CT_TEST();
  393. }
  394. static int test_verify_fails_for_future_sct()
  395. {
  396. SETUP_CT_TEST_FIXTURE();
  397. fixture.epoch_time_in_ms = 1365094800000; /* Apr 4 17:00:00 2013 GMT */
  398. fixture.certs_dir = certs_dir;
  399. fixture.certificate_file = "embeddedSCTs1.pem";
  400. fixture.issuer_file = "embeddedSCTs1_issuer.pem";
  401. fixture.expected_sct_count = 1;
  402. fixture.expected_valid_sct_count = 0;
  403. fixture.test_validity = 1;
  404. EXECUTE_CT_TEST();
  405. }
  406. static int test_decode_tls_sct()
  407. {
  408. const unsigned char tls_sct_list[] = "\x00\x78" /* length of list */
  409. "\x00\x76"
  410. "\x00" /* version */
  411. /* log ID */
  412. "\xDF\x1C\x2E\xC1\x15\x00\x94\x52\x47\xA9\x61\x68\x32\x5D\xDC\x5C\x79"
  413. "\x59\xE8\xF7\xC6\xD3\x88\xFC\x00\x2E\x0B\xBD\x3F\x74\xD7\x64"
  414. "\x00\x00\x01\x3D\xDB\x27\xDF\x93" /* timestamp */
  415. "\x00\x00" /* extensions length */
  416. "" /* extensions */
  417. "\x04\x03" /* hash and signature algorithms */
  418. "\x00\x47" /* signature length */
  419. /* signature */
  420. "\x30\x45\x02\x20\x48\x2F\x67\x51\xAF\x35\xDB\xA6\x54\x36\xBE\x1F\xD6"
  421. "\x64\x0F\x3D\xBF\x9A\x41\x42\x94\x95\x92\x45\x30\x28\x8F\xA3\xE5\xE2"
  422. "\x3E\x06\x02\x21\x00\xE4\xED\xC0\xDB\x3A\xC5\x72\xB1\xE2\xF5\xE8\xAB"
  423. "\x6A\x68\x06\x53\x98\x7D\xCF\x41\x02\x7D\xFE\xFF\xA1\x05\x51\x9D\x89"
  424. "\xED\xBF\x08";
  425. SETUP_CT_TEST_FIXTURE();
  426. fixture.tls_sct_list = tls_sct_list;
  427. fixture.tls_sct_list_len = 0x7a;
  428. fixture.sct_dir = ct_dir;
  429. fixture.sct_text_file = "tls1.sct";
  430. EXECUTE_CT_TEST();
  431. }
  432. static int test_encode_tls_sct()
  433. {
  434. const char log_id[] = "3xwuwRUAlFJHqWFoMl3cXHlZ6PfG04j8AC4LvT9012Q=";
  435. const uint64_t timestamp = 1;
  436. const char extensions[] = "";
  437. const char signature[] = "BAMARzBAMiBIL2dRrzXbplQ2vh/WZA89v5pBQpSVkkUwKI+j5"
  438. "eI+BgIhAOTtwNs6xXKx4vXoq2poBlOYfc9BAn3+/6EFUZ2J7b8I";
  439. SCT *sct = NULL;
  440. SETUP_CT_TEST_FIXTURE();
  441. fixture.sct_list = sk_SCT_new_null();
  442. sct = SCT_new_from_base64(SCT_VERSION_V1, log_id,
  443. CT_LOG_ENTRY_TYPE_X509, timestamp,
  444. extensions, signature);
  445. if (sct == NULL) {
  446. tear_down(fixture);
  447. fprintf(stderr, "Failed to create SCT from base64-encoded test data\n");
  448. return 0;
  449. }
  450. sk_SCT_push(fixture.sct_list, sct);
  451. fixture.sct_dir = ct_dir;
  452. fixture.sct_text_file = "tls1.sct";
  453. EXECUTE_CT_TEST();
  454. }
  455. /*
  456. * Tests that the CT_POLICY_EVAL_CTX default time is approximately now.
  457. * Allow +-10 minutes, as it may compensate for clock skew.
  458. */
  459. static int test_default_ct_policy_eval_ctx_time_is_now()
  460. {
  461. int success = 0;
  462. CT_POLICY_EVAL_CTX *ct_policy_ctx = CT_POLICY_EVAL_CTX_new();
  463. const time_t default_time =
  464. (time_t)(CT_POLICY_EVAL_CTX_get_time(ct_policy_ctx) / 1000);
  465. const time_t time_tolerance = 600; /* 10 minutes */
  466. if (fabs(difftime(time(NULL), default_time)) > time_tolerance) {
  467. fprintf(stderr,
  468. "Default CT_POLICY_EVAL_CTX time is not approximately now.\n");
  469. goto end;
  470. }
  471. success = 1;
  472. end:
  473. CT_POLICY_EVAL_CTX_free(ct_policy_ctx);
  474. return success;
  475. }
  476. int main(int argc, char *argv[])
  477. {
  478. int result = 0;
  479. char *tmp_env = NULL;
  480. tmp_env = getenv("OPENSSL_DEBUG_MEMORY");
  481. if (tmp_env != NULL && strcmp(tmp_env, "on") == 0)
  482. CRYPTO_set_mem_debug(1);
  483. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
  484. tmp_env = getenv("CT_DIR");
  485. ct_dir = OPENSSL_strdup(tmp_env != NULL ? tmp_env : "ct");
  486. tmp_env = getenv("CERTS_DIR");
  487. certs_dir = OPENSSL_strdup(tmp_env != NULL ? tmp_env : "certs");
  488. ADD_TEST(test_no_scts_in_certificate);
  489. ADD_TEST(test_one_sct_in_certificate);
  490. ADD_TEST(test_multiple_scts_in_certificate);
  491. ADD_TEST(test_verify_one_sct);
  492. ADD_TEST(test_verify_multiple_scts);
  493. ADD_TEST(test_verify_fails_for_future_sct);
  494. ADD_TEST(test_decode_tls_sct);
  495. ADD_TEST(test_encode_tls_sct);
  496. ADD_TEST(test_default_ct_policy_eval_ctx_time_is_now);
  497. result = run_tests(argv[0]);
  498. ERR_print_errors_fp(stderr);
  499. OPENSSL_free(ct_dir);
  500. OPENSSL_free(certs_dir);
  501. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  502. if (CRYPTO_mem_leaks_fp(stderr) <= 0)
  503. result = 1;
  504. #endif
  505. return result;
  506. }
  507. #else /* OPENSSL_NO_CT */
  508. int main(int argc, char* argv[])
  509. {
  510. return EXIT_SUCCESS;
  511. }
  512. #endif /* OPENSSL_NO_CT */