| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ts/ts_rsp_print.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | struct status_map_st { | - | ||||||||||||
| 4 | int bit; | - | ||||||||||||
| 5 | const char *text; | - | ||||||||||||
| 6 | }; | - | ||||||||||||
| 7 | - | |||||||||||||
| 8 | static int ts_status_map_print(BIO *bio, const struct status_map_st *a, | - | ||||||||||||
| 9 | const ASN1_BIT_STRING *v); | - | ||||||||||||
| 10 | static int ts_ACCURACY_print_bio(BIO *bio, const TS_ACCURACY *accuracy); | - | ||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | int TS_RESP_print_bio(BIO *bio, TS_RESP *a) | - | ||||||||||||
| 14 | { | - | ||||||||||||
| 15 | BIO_printf(bio, "Status info:\n"); | - | ||||||||||||
| 16 | TS_STATUS_INFO_print_bio(bio, a->status_info); | - | ||||||||||||
| 17 | - | |||||||||||||
| 18 | BIO_printf(bio, "\nTST info:\n"); | - | ||||||||||||
| 19 | if (a->tst_info !=
| 0-3 | ||||||||||||
| 20 | ((void *)0)
| 0-3 | ||||||||||||
| 21 | ) | - | ||||||||||||
| 22 | TS_TST_INFO_print_bio(bio, a->tst_info); never executed: TS_TST_INFO_print_bio(bio, a->tst_info); | 0 | ||||||||||||
| 23 | else | - | ||||||||||||
| 24 | BIO_printf(bio, "Not included.\n"); executed 3 times by 1 test: BIO_printf(bio, "Not included.\n");Executed by:
| 3 | ||||||||||||
| 25 | - | |||||||||||||
| 26 | return executed 3 times by 1 test: 1;return 1;Executed by:
executed 3 times by 1 test: return 1;Executed by:
| 3 | ||||||||||||
| 27 | } | - | ||||||||||||
| 28 | - | |||||||||||||
| 29 | int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a) | - | ||||||||||||
| 30 | { | - | ||||||||||||
| 31 | static const char *status_map[] = { | - | ||||||||||||
| 32 | "Granted.", | - | ||||||||||||
| 33 | "Granted with modifications.", | - | ||||||||||||
| 34 | "Rejected.", | - | ||||||||||||
| 35 | "Waiting.", | - | ||||||||||||
| 36 | "Revocation warning.", | - | ||||||||||||
| 37 | "Revoked." | - | ||||||||||||
| 38 | }; | - | ||||||||||||
| 39 | static const struct status_map_st failure_map[] = { | - | ||||||||||||
| 40 | {0, | - | ||||||||||||
| 41 | "unrecognized or unsupported algorithm identifier"}, | - | ||||||||||||
| 42 | {2, | - | ||||||||||||
| 43 | "transaction not permitted or supported"}, | - | ||||||||||||
| 44 | {5, | - | ||||||||||||
| 45 | "the data submitted has the wrong format"}, | - | ||||||||||||
| 46 | {14, | - | ||||||||||||
| 47 | "the TSA's time source is not available"}, | - | ||||||||||||
| 48 | {15, | - | ||||||||||||
| 49 | "the requested TSA policy is not supported by the TSA"}, | - | ||||||||||||
| 50 | {16, | - | ||||||||||||
| 51 | "the requested extension is not supported by the TSA"}, | - | ||||||||||||
| 52 | {17, | - | ||||||||||||
| 53 | "the additional information requested could not be understood " | - | ||||||||||||
| 54 | "or is not available"}, | - | ||||||||||||
| 55 | {25, | - | ||||||||||||
| 56 | "the request cannot be handled due to system failure"}, | - | ||||||||||||
| 57 | {-1, | - | ||||||||||||
| 58 | ((void *)0) | - | ||||||||||||
| 59 | } | - | ||||||||||||
| 60 | }; | - | ||||||||||||
| 61 | long status; | - | ||||||||||||
| 62 | int i, lines = 0; | - | ||||||||||||
| 63 | - | |||||||||||||
| 64 | BIO_printf(bio, "Status: "); | - | ||||||||||||
| 65 | status = ASN1_INTEGER_get(a->status); | - | ||||||||||||
| 66 | if (0 <= status
| 5-136 | ||||||||||||
| 67 | BIO_printf(bio, "%s\n", status_map[status]); executed 5 times by 1 test: BIO_printf(bio, "%s\n", status_map[status]);Executed by:
| 5 | ||||||||||||
| 68 | else | - | ||||||||||||
| 69 | BIO_printf(bio, "out of bounds\n"); executed 166 times by 1 test: BIO_printf(bio, "out of bounds\n");Executed by:
| 166 | ||||||||||||
| 70 | - | |||||||||||||
| 71 | BIO_printf(bio, "Status description: "); | - | ||||||||||||
| 72 | for (i = 0; i < sk_ASN1_UTF8STRING_num(a->text)
| 171-6183 | ||||||||||||
| 73 | if (i > 0
| 152-6031 | ||||||||||||
| 74 | BIO_puts(bio, "\t"); executed 6031 times by 1 test: BIO_puts(bio, "\t");Executed by:
| 6031 | ||||||||||||
| 75 | ASN1_STRING_print_ex(bio, sk_ASN1_UTF8STRING_value(a->text, i), 0); | - | ||||||||||||
| 76 | BIO_puts(bio, "\n"); | - | ||||||||||||
| 77 | } executed 6183 times by 1 test: end of blockExecuted by:
| 6183 | ||||||||||||
| 78 | if (i == 0
| 19-152 | ||||||||||||
| 79 | BIO_printf(bio, "unspecified\n"); executed 19 times by 1 test: BIO_printf(bio, "unspecified\n");Executed by:
| 19 | ||||||||||||
| 80 | - | |||||||||||||
| 81 | BIO_printf(bio, "Failure info: "); | - | ||||||||||||
| 82 | if (a->failure_info !=
| 12-159 | ||||||||||||
| 83 | ((void *)0)
| 12-159 | ||||||||||||
| 84 | ) | - | ||||||||||||
| 85 | lines = ts_status_map_print(bio, failure_map, a->failure_info); executed 12 times by 1 test: lines = ts_status_map_print(bio, failure_map, a->failure_info);Executed by:
| 12 | ||||||||||||
| 86 | if (lines == 0
| 11-160 | ||||||||||||
| 87 | BIO_printf(bio, "unspecified"); executed 160 times by 1 test: BIO_printf(bio, "unspecified");Executed by:
| 160 | ||||||||||||
| 88 | BIO_printf(bio, "\n"); | - | ||||||||||||
| 89 | - | |||||||||||||
| 90 | return executed 171 times by 1 test: 1;return 1;Executed by:
executed 171 times by 1 test: return 1;Executed by:
| 171 | ||||||||||||
| 91 | } | - | ||||||||||||
| 92 | - | |||||||||||||
| 93 | static int ts_status_map_print(BIO *bio, const struct status_map_st *a, | - | ||||||||||||
| 94 | const ASN1_BIT_STRING *v) | - | ||||||||||||
| 95 | { | - | ||||||||||||
| 96 | int lines = 0; | - | ||||||||||||
| 97 | - | |||||||||||||
| 98 | for (; a->bit >= 0
| 12-96 | ||||||||||||
| 99 | if (ASN1_BIT_STRING_get_bit(v, a->bit)
| 34-62 | ||||||||||||
| 100 | if (++
| 11-23 | ||||||||||||
| 101 | BIO_printf(bio, ", "); executed 23 times by 1 test: BIO_printf(bio, ", ");Executed by:
| 23 | ||||||||||||
| 102 | BIO_printf(bio, "%s", a->text); | - | ||||||||||||
| 103 | } executed 34 times by 1 test: end of blockExecuted by:
| 34 | ||||||||||||
| 104 | } executed 96 times by 1 test: end of blockExecuted by:
| 96 | ||||||||||||
| 105 | - | |||||||||||||
| 106 | return executed 12 times by 1 test: lines;return lines;Executed by:
executed 12 times by 1 test: return lines;Executed by:
| 12 | ||||||||||||
| 107 | } | - | ||||||||||||
| 108 | - | |||||||||||||
| 109 | int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a) | - | ||||||||||||
| 110 | { | - | ||||||||||||
| 111 | int v; | - | ||||||||||||
| 112 | - | |||||||||||||
| 113 | if (a ==
| 0 | ||||||||||||
| 114 | ((void *)0)
| 0 | ||||||||||||
| 115 | ) | - | ||||||||||||
| 116 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 117 | - | |||||||||||||
| 118 | v = ASN1_INTEGER_get(a->version); | - | ||||||||||||
| 119 | BIO_printf(bio, "Version: %d\n", v); | - | ||||||||||||
| 120 | - | |||||||||||||
| 121 | BIO_printf(bio, "Policy OID: "); | - | ||||||||||||
| 122 | TS_OBJ_print_bio(bio, a->policy_id); | - | ||||||||||||
| 123 | - | |||||||||||||
| 124 | TS_MSG_IMPRINT_print_bio(bio, a->msg_imprint); | - | ||||||||||||
| 125 | - | |||||||||||||
| 126 | BIO_printf(bio, "Serial number: "); | - | ||||||||||||
| 127 | if (a->serial ==
| 0 | ||||||||||||
| 128 | ((void *)0)
| 0 | ||||||||||||
| 129 | ) | - | ||||||||||||
| 130 | BIO_printf(bio, "unspecified"); never executed: BIO_printf(bio, "unspecified"); | 0 | ||||||||||||
| 131 | else | - | ||||||||||||
| 132 | TS_ASN1_INTEGER_print_bio(bio, a->serial); never executed: TS_ASN1_INTEGER_print_bio(bio, a->serial); | 0 | ||||||||||||
| 133 | BIO_write(bio, "\n", 1); | - | ||||||||||||
| 134 | - | |||||||||||||
| 135 | BIO_printf(bio, "Time stamp: "); | - | ||||||||||||
| 136 | ASN1_GENERALIZEDTIME_print(bio, a->time); | - | ||||||||||||
| 137 | BIO_write(bio, "\n", 1); | - | ||||||||||||
| 138 | - | |||||||||||||
| 139 | BIO_printf(bio, "Accuracy: "); | - | ||||||||||||
| 140 | if (a->accuracy ==
| 0 | ||||||||||||
| 141 | ((void *)0)
| 0 | ||||||||||||
| 142 | ) | - | ||||||||||||
| 143 | BIO_printf(bio, "unspecified"); never executed: BIO_printf(bio, "unspecified"); | 0 | ||||||||||||
| 144 | else | - | ||||||||||||
| 145 | ts_ACCURACY_print_bio(bio, a->accuracy); never executed: ts_ACCURACY_print_bio(bio, a->accuracy); | 0 | ||||||||||||
| 146 | BIO_write(bio, "\n", 1); | - | ||||||||||||
| 147 | - | |||||||||||||
| 148 | BIO_printf(bio, "Ordering: %s\n", a->ordering ? "yes" : "no"); | - | ||||||||||||
| 149 | - | |||||||||||||
| 150 | BIO_printf(bio, "Nonce: "); | - | ||||||||||||
| 151 | if (a->nonce ==
| 0 | ||||||||||||
| 152 | ((void *)0)
| 0 | ||||||||||||
| 153 | ) | - | ||||||||||||
| 154 | BIO_printf(bio, "unspecified"); never executed: BIO_printf(bio, "unspecified"); | 0 | ||||||||||||
| 155 | else | - | ||||||||||||
| 156 | TS_ASN1_INTEGER_print_bio(bio, a->nonce); never executed: TS_ASN1_INTEGER_print_bio(bio, a->nonce); | 0 | ||||||||||||
| 157 | BIO_write(bio, "\n", 1); | - | ||||||||||||
| 158 | - | |||||||||||||
| 159 | BIO_printf(bio, "TSA: "); | - | ||||||||||||
| 160 | if (a->tsa ==
| 0 | ||||||||||||
| 161 | ((void *)0)
| 0 | ||||||||||||
| 162 | ) | - | ||||||||||||
| 163 | BIO_printf(bio, "unspecified"); never executed: BIO_printf(bio, "unspecified"); | 0 | ||||||||||||
| 164 | else { | - | ||||||||||||
| 165 | struct stack_st_CONF_VALUE *nval; | - | ||||||||||||
| 166 | if ((
| 0 | ||||||||||||
| 167 | ((void *)0)
| 0 | ||||||||||||
| 168 | , a->tsa,
| 0 | ||||||||||||
| 169 | ((void *)0)
| 0 | ||||||||||||
| 170 | ))
| 0 | ||||||||||||
| 171 | X509V3_EXT_val_prn(bio, nval, 0, 0); never executed: X509V3_EXT_val_prn(bio, nval, 0, 0); | 0 | ||||||||||||
| 172 | sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); | - | ||||||||||||
| 173 | } never executed: end of block | 0 | ||||||||||||
| 174 | BIO_write(bio, "\n", 1); | - | ||||||||||||
| 175 | - | |||||||||||||
| 176 | TS_ext_print_bio(bio, a->extensions); | - | ||||||||||||
| 177 | - | |||||||||||||
| 178 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||
| 179 | } | - | ||||||||||||
| 180 | - | |||||||||||||
| 181 | static int ts_ACCURACY_print_bio(BIO *bio, const TS_ACCURACY *a) | - | ||||||||||||
| 182 | { | - | ||||||||||||
| 183 | if (a->seconds !=
| 0 | ||||||||||||
| 184 | ((void *)0)
| 0 | ||||||||||||
| 185 | ) | - | ||||||||||||
| 186 | TS_ASN1_INTEGER_print_bio(bio, a->seconds); never executed: TS_ASN1_INTEGER_print_bio(bio, a->seconds); | 0 | ||||||||||||
| 187 | else | - | ||||||||||||
| 188 | BIO_printf(bio, "unspecified"); never executed: BIO_printf(bio, "unspecified"); | 0 | ||||||||||||
| 189 | BIO_printf(bio, " seconds, "); | - | ||||||||||||
| 190 | if (a->millis !=
| 0 | ||||||||||||
| 191 | ((void *)0)
| 0 | ||||||||||||
| 192 | ) | - | ||||||||||||
| 193 | TS_ASN1_INTEGER_print_bio(bio, a->millis); never executed: TS_ASN1_INTEGER_print_bio(bio, a->millis); | 0 | ||||||||||||
| 194 | else | - | ||||||||||||
| 195 | BIO_printf(bio, "unspecified"); never executed: BIO_printf(bio, "unspecified"); | 0 | ||||||||||||
| 196 | BIO_printf(bio, " millis, "); | - | ||||||||||||
| 197 | if (a->micros !=
| 0 | ||||||||||||
| 198 | ((void *)0)
| 0 | ||||||||||||
| 199 | ) | - | ||||||||||||
| 200 | TS_ASN1_INTEGER_print_bio(bio, a->micros); never executed: TS_ASN1_INTEGER_print_bio(bio, a->micros); | 0 | ||||||||||||
| 201 | else | - | ||||||||||||
| 202 | BIO_printf(bio, "unspecified"); never executed: BIO_printf(bio, "unspecified"); | 0 | ||||||||||||
| 203 | BIO_printf(bio, " micros"); | - | ||||||||||||
| 204 | - | |||||||||||||
| 205 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||
| 206 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |