OpenCoverage

ct_prn.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ct/ct_prn.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4static void SCT_signature_algorithms_print(const SCT *sct, BIO *out)-
5{-
6 int nid = SCT_get_signature_nid(sct);-
7-
8 if (nid == 0
nid == 0Description
TRUEnever evaluated
FALSEevaluated 2338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2338
9 BIO_printf(out, "%02X%02X", sct->hash_alg, sct->sig_alg);
never executed: BIO_printf(out, "%02X%02X", sct->hash_alg, sct->sig_alg);
0
10 else-
11 BIO_printf(out, "%s", OBJ_nid2ln(nid));
executed 2338 times by 1 test: BIO_printf(out, "%s", OBJ_nid2ln(nid));
Executed by:
  • libcrypto.so.1.1
2338
12}-
13-
14static void timestamp_print(uint64_t timestamp, BIO *out)-
15{-
16 ASN1_GENERALIZEDTIME *gen = ASN1_GENERALIZEDTIME_new();-
17 char genstr[20];-
18-
19 if (gen ==
gen == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2338
20 ((void *)0)
gen == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2338
21 )-
22 return;
never executed: return;
0
23 ASN1_GENERALIZEDTIME_adj(gen, (time_t)0,-
24 (int)(timestamp / 86400000),-
25 (timestamp % 86400000) / 1000);-
26-
27-
28-
29-
30 BIO_snprintf(genstr, sizeof(genstr), "%.14s.%03dZ",-
31 ASN1_STRING_get0_data(gen), (unsigned int)(timestamp % 1000));-
32 if (ASN1_GENERALIZEDTIME_set_string(gen, genstr)
ASN1_GENERALIZ...g(gen, genstr)Description
TRUEevaluated 1804 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 534 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
534-1804
33 ASN1_GENERALIZEDTIME_print(out, gen);
executed 1804 times by 1 test: ASN1_GENERALIZEDTIME_print(out, gen);
Executed by:
  • libcrypto.so.1.1
1804
34 ASN1_GENERALIZEDTIME_free(gen);-
35}
executed 2338 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2338
36-
37const char *SCT_validation_status_string(const SCT *sct)-
38{-
39-
40 switch (SCT_get_validation_status(sct)) {-
41 case
executed 2 times by 1 test: case SCT_VALIDATION_STATUS_NOT_SET:
Executed by:
  • libcrypto.so.1.1
SCT_VALIDATION_STATUS_NOT_SET:
executed 2 times by 1 test: case SCT_VALIDATION_STATUS_NOT_SET:
Executed by:
  • libcrypto.so.1.1
2
42 return
executed 2 times by 1 test: return "not set";
Executed by:
  • libcrypto.so.1.1
"not set";
executed 2 times by 1 test: return "not set";
Executed by:
  • libcrypto.so.1.1
2
43 case
never executed: case SCT_VALIDATION_STATUS_UNKNOWN_VERSION:
SCT_VALIDATION_STATUS_UNKNOWN_VERSION:
never executed: case SCT_VALIDATION_STATUS_UNKNOWN_VERSION:
0
44 return
never executed: return "unknown version";
"unknown version";
never executed: return "unknown version";
0
45 case
never executed: case SCT_VALIDATION_STATUS_UNKNOWN_LOG:
SCT_VALIDATION_STATUS_UNKNOWN_LOG:
never executed: case SCT_VALIDATION_STATUS_UNKNOWN_LOG:
0
46 return
never executed: return "unknown log";
"unknown log";
never executed: return "unknown log";
0
47 case
never executed: case SCT_VALIDATION_STATUS_UNVERIFIED:
SCT_VALIDATION_STATUS_UNVERIFIED:
never executed: case SCT_VALIDATION_STATUS_UNVERIFIED:
0
48 return
never executed: return "unverified";
"unverified";
never executed: return "unverified";
0
49 case
never executed: case SCT_VALIDATION_STATUS_INVALID:
SCT_VALIDATION_STATUS_INVALID:
never executed: case SCT_VALIDATION_STATUS_INVALID:
0
50 return
never executed: return "invalid";
"invalid";
never executed: return "invalid";
0
51 case
never executed: case SCT_VALIDATION_STATUS_VALID:
SCT_VALIDATION_STATUS_VALID:
never executed: case SCT_VALIDATION_STATUS_VALID:
0
52 return
never executed: return "valid";
"valid";
never executed: return "valid";
0
53 }-
54 return
never executed: return "unknown status";
"unknown status";
never executed: return "unknown status";
0
55}-
56-
57void SCT_print(const SCT *sct, BIO *out, int indent,-
58 const CTLOG_STORE *log_store)-
59{-
60 const CTLOG *log = -
61 ((void *)0)-
62 ;-
63-
64 if (log_store !=
log_store != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10671 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-10671
65 ((void *)0)
log_store != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10671 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-10671
66 ) {-
67 log = CTLOG_STORE_get0_log_by_id(log_store, sct->log_id,-
68 sct->log_id_len);-
69 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
70-
71 BIO_printf(out, "%*sSigned Certificate Timestamp:", indent, "");-
72 BIO_printf(out, "\n%*sVersion : ", indent + 4, "");-
73-
74 if (sct->version != SCT_VERSION_V1
sct->version != SCT_VERSION_V1Description
TRUEevaluated 8335 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2338 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
2338-8335
75 BIO_printf(out, "unknown\n%*s", indent + 16, "");-
76 BIO_hex_string(out, indent + 16, 16, sct->sct, sct->sct_len);-
77 return;
executed 8335 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
8335
78 }-
79-
80 BIO_printf(out, "v1 (0x0)");-
81-
82 if (log !=
log != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-2336
83 ((void *)0)
log != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-2336
84 ) {-
85 BIO_printf(out, "\n%*sLog : %s", indent + 4, "",-
86 CTLOG_get0_name(log));-
87 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
88-
89 BIO_printf(out, "\n%*sLog ID : ", indent + 4, "");-
90 BIO_hex_string(out, indent + 16, 16, sct->log_id, sct->log_id_len);-
91-
92 BIO_printf(out, "\n%*sTimestamp : ", indent + 4, "");-
93 timestamp_print(sct->timestamp, out);-
94-
95 BIO_printf(out, "\n%*sExtensions: ", indent + 4, "");-
96 if (sct->ext_len == 0
sct->ext_len == 0Description
TRUEevaluated 2220 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 118 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
118-2220
97 BIO_printf(out, "none");
executed 2220 times by 1 test: BIO_printf(out, "none");
Executed by:
  • libcrypto.so.1.1
2220
98 else-
99 BIO_hex_string(out, indent + 16, 16, sct->ext, sct->ext_len);
executed 118 times by 1 test: BIO_hex_string(out, indent + 16, 16, sct->ext, sct->ext_len);
Executed by:
  • libcrypto.so.1.1
118
100-
101 BIO_printf(out, "\n%*sSignature : ", indent + 4, "");-
102 SCT_signature_algorithms_print(sct, out);-
103 BIO_printf(out, "\n%*s ", indent + 4, "");-
104 BIO_hex_string(out, indent + 16, 16, sct->sig, sct->sig_len);-
105}
executed 2338 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2338
106-
107void SCT_LIST_print(const struct stack_st_SCT *sct_list, BIO *out, int indent,-
108 const char *separator, const CTLOG_STORE *log_store)-
109{-
110 int sct_count = sk_SCT_num(sct_list);-
111 int i;-
112-
113 for (i = 0; i < sct_count
i < sct_countDescription
TRUEevaluated 10671 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2731 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; ++i) {
2731-10671
114 SCT *sct = sk_SCT_value(sct_list, i);-
115-
116 SCT_print(sct, out, indent, log_store);-
117 if (i < sk_SCT_num(sct_list) - 1
i < sk_SCT_num(sct_list) - 1Description
TRUEevaluated 8405 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2266 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2266-8405
118 BIO_printf(out, "%s", separator);
executed 8405 times by 1 test: BIO_printf(out, "%s", separator);
Executed by:
  • libcrypto.so.1.1
8405
119 }
executed 10671 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
10671
120}
executed 2731 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2731
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2