OpenCoverage

ssl_init.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/ssl/ssl_init.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/* $OpenBSD: ssl_init.c,v 1.2 2018/03/30 14:59:46 jsing Exp $ */-
2/*-
3 * Copyright (c) 2018 Bob Beck <beck@openbsd.org>-
4 *-
5 * Permission to use, copy, modify, and distribute this software for any-
6 * purpose with or without fee is hereby granted, provided that the above-
7 * copyright notice and this permission notice appear in all copies.-
8 *-
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES-
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF-
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR-
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES-
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN-
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF-
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.-
16 */-
17-
18/* OpenSSL style init */-
19-
20#include <pthread.h>-
21#include <stdio.h>-
22-
23#include <openssl/objects.h>-
24-
25#include "ssl_locl.h"-
26-
27static pthread_t ssl_init_thread;-
28-
29static void-
30OPENSSL_init_ssl_internal(void)-
31{-
32 ssl_init_thread = pthread_self();-
33 SSL_load_error_strings();-
34 SSL_library_init();-
35}
executed 63 times by 13 tests: end of block
Executed by:
  • cipher_list
  • cipherstest
  • clienttest
  • configtest
  • libssl.so.46.0.1
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
  • verifytest
63
36-
37int-
38OPENSSL_init_ssl(uint64_t opts, const void *settings)-
39{-
40 static pthread_once_t once = PTHREAD_ONCE_INIT;-
41-
42 if (pthread_equal(pthread_self(), ssl_init_thread))
pthread_equal(...l_init_thread)Description
TRUEevaluated 311 times by 10 tests
Evaluated by:
  • cipherstest
  • clienttest
  • configtest
  • servertest
  • ssl_versions
  • ssltest
  • tls_prf
  • tlsexttest
  • tlstest
  • verifytest
FALSEevaluated 63 times by 13 tests
Evaluated by:
  • cipher_list
  • cipherstest
  • clienttest
  • configtest
  • libssl.so.46.0.1
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
  • verifytest
63-311
43 return 1; /* don't recurse */
executed 311 times by 10 tests: return 1;
Executed by:
  • cipherstest
  • clienttest
  • configtest
  • servertest
  • ssl_versions
  • ssltest
  • tls_prf
  • tlsexttest
  • tlstest
  • verifytest
311
44-
45 OPENSSL_init_crypto(opts, settings);-
46-
47 if (pthread_once(&once, OPENSSL_init_ssl_internal) != 0)
pthread_once(&...internal) != 0Description
TRUEnever evaluated
FALSEevaluated 63 times by 13 tests
Evaluated by:
  • cipher_list
  • cipherstest
  • clienttest
  • configtest
  • libssl.so.46.0.1
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
  • verifytest
0-63
48 return 0;
never executed: return 0;
0
49-
50 return 1;
executed 63 times by 13 tests: return 1;
Executed by:
  • cipher_list
  • cipherstest
  • clienttest
  • configtest
  • libssl.so.46.0.1
  • servertest
  • ssl_versions
  • ssltest
  • tls_ext_alpn
  • tls_prf
  • tlsexttest
  • tlstest
  • verifytest
63
51}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2