- p = getenv("OPENSSL_DEBUG_MEMORY");
- if (p != NULL && strcmp(p, "on") == 0)
- CRYPTO_set_mem_debug(1);
- CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
-
- f = BIO_new_file(tlsafile, "r");
- if (f == NULL) {
- fprintf(stderr, "%s: Error opening tlsa record file: '%s': %s\n",
- progname, tlsafile, strerror(errno));
- EXIT(ret);
- }
-
- ctx = SSL_CTX_new(TLS_client_method());
- if (SSL_CTX_dane_enable(ctx) <= 0) {
- print_errors();
- goto end;
- }
- if (!SSL_CTX_load_verify_locations(ctx, CAfile, NULL)) {
- print_errors();
- goto end;
- }
- if ((SSL_CTX_dane_mtype_set(ctx, EVP_sha512(), 2, 1)) <= 0) {
- print_errors();
- goto end;
- }
- if ((SSL_CTX_dane_mtype_set(ctx, EVP_sha256(), 1, 2)) <= 0) {
- print_errors();
- goto end;
- }
-
- if (test_tlsafile(ctx, basedomain, f, tlsafile) <= 0) {
- print_errors();
- goto end;
- }
-
- ret = 0;
-
-end:
-
- BIO_free(f);
- SSL_CTX_free(ctx);
-
-#ifndef OPENSSL_NO_CRYPTO_MDEBUG
- if (CRYPTO_mem_leaks(bio_err) <= 0)
- ret = 1;
-#endif
- BIO_free(bio_err);
- EXIT(ret);