| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/ssl/t1_lib.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||||||||
| 7 | SSL3_ENC_METHOD const TLSv1_enc_data = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 8 | tls1_enc, | - | ||||||||||||||||||||||||||||||||||||||||||
| 9 | tls1_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 10 | tls1_setup_key_block, | - | ||||||||||||||||||||||||||||||||||||||||||
| 11 | tls1_generate_master_secret, | - | ||||||||||||||||||||||||||||||||||||||||||
| 12 | tls1_change_cipher_state, | - | ||||||||||||||||||||||||||||||||||||||||||
| 13 | tls1_final_finish_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 14 | "client finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 15 | "server finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 16 | tls1_alert_code, | - | ||||||||||||||||||||||||||||||||||||||||||
| 17 | tls1_export_keying_material, | - | ||||||||||||||||||||||||||||||||||||||||||
| 18 | 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 19 | ssl3_set_handshake_header, | - | ||||||||||||||||||||||||||||||||||||||||||
| 20 | tls_close_construct_packet, | - | ||||||||||||||||||||||||||||||||||||||||||
| 21 | ssl3_handshake_write | - | ||||||||||||||||||||||||||||||||||||||||||
| 22 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||||||||||||||||||||
| 24 | SSL3_ENC_METHOD const TLSv1_1_enc_data = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 25 | tls1_enc, | - | ||||||||||||||||||||||||||||||||||||||||||
| 26 | tls1_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 27 | tls1_setup_key_block, | - | ||||||||||||||||||||||||||||||||||||||||||
| 28 | tls1_generate_master_secret, | - | ||||||||||||||||||||||||||||||||||||||||||
| 29 | tls1_change_cipher_state, | - | ||||||||||||||||||||||||||||||||||||||||||
| 30 | tls1_final_finish_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 31 | "client finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 32 | "server finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 33 | tls1_alert_code, | - | ||||||||||||||||||||||||||||||||||||||||||
| 34 | tls1_export_keying_material, | - | ||||||||||||||||||||||||||||||||||||||||||
| 35 | 0x1, | - | ||||||||||||||||||||||||||||||||||||||||||
| 36 | ssl3_set_handshake_header, | - | ||||||||||||||||||||||||||||||||||||||||||
| 37 | tls_close_construct_packet, | - | ||||||||||||||||||||||||||||||||||||||||||
| 38 | ssl3_handshake_write | - | ||||||||||||||||||||||||||||||||||||||||||
| 39 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||||||||||||||||||||
| 41 | SSL3_ENC_METHOD const TLSv1_2_enc_data = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 42 | tls1_enc, | - | ||||||||||||||||||||||||||||||||||||||||||
| 43 | tls1_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 44 | tls1_setup_key_block, | - | ||||||||||||||||||||||||||||||||||||||||||
| 45 | tls1_generate_master_secret, | - | ||||||||||||||||||||||||||||||||||||||||||
| 46 | tls1_change_cipher_state, | - | ||||||||||||||||||||||||||||||||||||||||||
| 47 | tls1_final_finish_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 48 | "client finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 49 | "server finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 50 | tls1_alert_code, | - | ||||||||||||||||||||||||||||||||||||||||||
| 51 | tls1_export_keying_material, | - | ||||||||||||||||||||||||||||||||||||||||||
| 52 | 0x1 | 0x2 | 0x4 | - | ||||||||||||||||||||||||||||||||||||||||||
| 53 | | 0x10, | - | ||||||||||||||||||||||||||||||||||||||||||
| 54 | ssl3_set_handshake_header, | - | ||||||||||||||||||||||||||||||||||||||||||
| 55 | tls_close_construct_packet, | - | ||||||||||||||||||||||||||||||||||||||||||
| 56 | ssl3_handshake_write | - | ||||||||||||||||||||||||||||||||||||||||||
| 57 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||||||||||||||||||||
| 59 | SSL3_ENC_METHOD const TLSv1_3_enc_data = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 60 | tls13_enc, | - | ||||||||||||||||||||||||||||||||||||||||||
| 61 | tls1_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 62 | tls13_setup_key_block, | - | ||||||||||||||||||||||||||||||||||||||||||
| 63 | tls13_generate_master_secret, | - | ||||||||||||||||||||||||||||||||||||||||||
| 64 | tls13_change_cipher_state, | - | ||||||||||||||||||||||||||||||||||||||||||
| 65 | tls13_final_finish_mac, | - | ||||||||||||||||||||||||||||||||||||||||||
| 66 | "client finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 67 | "server finished", 15, | - | ||||||||||||||||||||||||||||||||||||||||||
| 68 | tls13_alert_code, | - | ||||||||||||||||||||||||||||||||||||||||||
| 69 | tls13_export_keying_material, | - | ||||||||||||||||||||||||||||||||||||||||||
| 70 | 0x2 | 0x4, | - | ||||||||||||||||||||||||||||||||||||||||||
| 71 | ssl3_set_handshake_header, | - | ||||||||||||||||||||||||||||||||||||||||||
| 72 | tls_close_construct_packet, | - | ||||||||||||||||||||||||||||||||||||||||||
| 73 | ssl3_handshake_write | - | ||||||||||||||||||||||||||||||||||||||||||
| 74 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||||||||||||||||||||
| 76 | long tls1_default_timeout(void) | - | ||||||||||||||||||||||||||||||||||||||||||
| 77 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||||||||||||||||||||
| 80 | - | |||||||||||||||||||||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||||||||||||||||||||
| 82 | return executed 7712 times by 2 tests: (60 * 60 * 2);return (60 * 60 * 2);Executed by:
executed 7712 times by 2 tests: return (60 * 60 * 2);Executed by:
| 7712 | ||||||||||||||||||||||||||||||||||||||||||
| 83 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||||||||||||||||||||
| 85 | int tls1_new(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 86 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 87 | if (!ssl3_new(s)
| 0-7949 | ||||||||||||||||||||||||||||||||||||||||||
| 88 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 89 | if (!s->method->ssl_clear(s)
| 0-7949 | ||||||||||||||||||||||||||||||||||||||||||
| 90 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||||||||||||||||||||
| 92 | return executed 7949 times by 2 tests: 1;return 1;Executed by:
executed 7949 times by 2 tests: return 1;Executed by:
| 7949 | ||||||||||||||||||||||||||||||||||||||||||
| 93 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||||||||||||||||||||
| 95 | void tls1_free(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 96 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 97 | CRYPTO_free(s->ext.session_ticket, __FILE__, 114); | - | ||||||||||||||||||||||||||||||||||||||||||
| 98 | ssl3_free(s); | - | ||||||||||||||||||||||||||||||||||||||||||
| 99 | } executed 7949 times by 2 tests: end of blockExecuted by:
| 7949 | ||||||||||||||||||||||||||||||||||||||||||
| 100 | - | |||||||||||||||||||||||||||||||||||||||||||
| 101 | int tls1_clear(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 102 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 103 | if (!ssl3_clear(s)
| 0-31388 | ||||||||||||||||||||||||||||||||||||||||||
| 104 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||||||||||||||
| 106 | if (s->method->version == 0x10000
| 0-31388 | ||||||||||||||||||||||||||||||||||||||||||
| 107 | s->version = 0x0304; executed 31388 times by 2 tests: s->version = 0x0304;Executed by:
| 31388 | ||||||||||||||||||||||||||||||||||||||||||
| 108 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 109 | s->version = s->method->version; never executed: s->version = s->method->version; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 110 | - | |||||||||||||||||||||||||||||||||||||||||||
| 111 | return executed 31388 times by 2 tests: 1;return 1;Executed by:
executed 31388 times by 2 tests: return 1;Executed by:
| 31388 | ||||||||||||||||||||||||||||||||||||||||||
| 112 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 113 | static const TLS_GROUP_INFO nid_list[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 114 | {721, 80, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 115 | {722, 80, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 116 | {723, 80, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 117 | {724, 80, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 118 | {725, 80, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 119 | {726, 112, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 120 | {727, 112, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 121 | {728, 112, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 122 | {729, 128, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 123 | {730, 128, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 124 | {731, 192, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 125 | {732, 192, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 126 | {733, 256, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 127 | {734, 256, 0x1}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 128 | {708, 80, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 129 | {709, 80, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 130 | {710, 80, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 131 | {711, 80, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 132 | {409, 80, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 133 | {712, 112, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 134 | {713, 112, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 135 | {714, 128, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 136 | {415, 128, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 137 | {715, 192, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 138 | {716, 256, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 139 | {927, 128, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 140 | {931, 192, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 141 | {933, 256, 0x0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 142 | {1034, 128, 0x2}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 143 | {1035, 224, 0x2}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 144 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||||||||||||||||||||
| 146 | static const unsigned char ecformats_default[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 148 | 1, | - | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 2 | - | ||||||||||||||||||||||||||||||||||||||||||
| 150 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||||||||||||||||||||
| 153 | static const uint16_t eccurves_default[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 154 | 29, | - | ||||||||||||||||||||||||||||||||||||||||||
| 155 | 23, | - | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 30, | - | ||||||||||||||||||||||||||||||||||||||||||
| 157 | 25, | - | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 24, | - | ||||||||||||||||||||||||||||||||||||||||||
| 159 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||||||||||||||||||||
| 161 | static const uint16_t suiteb_curves[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 23, | - | ||||||||||||||||||||||||||||||||||||||||||
| 163 | 24 | - | ||||||||||||||||||||||||||||||||||||||||||
| 164 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||||||||||||||||||||
| 166 | const TLS_GROUP_INFO *tls1_group_id_lookup(uint16_t group_id) | - | ||||||||||||||||||||||||||||||||||||||||||
| 167 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||||||||||||||||||||
| 169 | if (group_id < 1
| 0-42060 | ||||||||||||||||||||||||||||||||||||||||||
| 170 | return executed 4 times by 1 test: return ((void *)0) ;Executed by:
executed 4 times by 1 test: return ((void *)0) ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 171 | ((void *)0) executed 4 times by 1 test: return ((void *)0) ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 172 | ; executed 4 times by 1 test: return ((void *)0) ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 173 | return executed 42056 times by 1 test: &nid_list[group_id - 1];return &nid_list[group_id - 1];Executed by:
executed 42056 times by 1 test: return &nid_list[group_id - 1];Executed by:
| 42056 | ||||||||||||||||||||||||||||||||||||||||||
| 174 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||||||||||||||||||||
| 176 | static uint16_t tls1_nid2group_id(int nid) | - | ||||||||||||||||||||||||||||||||||||||||||
| 177 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 178 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 179 | for (i = 0; i < (sizeof(nid_list)/sizeof((nid_list)[0]))
| 1-21158 | ||||||||||||||||||||||||||||||||||||||||||
| 180 | if (nid_list[i].nid == nid
| 929-20229 | ||||||||||||||||||||||||||||||||||||||||||
| 181 | return executed 929 times by 1 test: (uint16_t)(i + 1);return (uint16_t)(i + 1);Executed by:
executed 929 times by 1 test: return (uint16_t)(i + 1);Executed by:
| 929 | ||||||||||||||||||||||||||||||||||||||||||
| 182 | } executed 20229 times by 1 test: end of blockExecuted by:
| 20229 | ||||||||||||||||||||||||||||||||||||||||||
| 183 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 184 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||||||||||||||||||||
| 190 | void tls1_get_supported_groups(SSL *s, const uint16_t **pgroups, | - | ||||||||||||||||||||||||||||||||||||||||||
| 191 | size_t *pgroupslen) | - | ||||||||||||||||||||||||||||||||||||||||||
| 192 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||||||||||||||||||||
| 195 | switch ((s->cert->cert_flags & 0x30000)) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 196 | case executed 2 times by 1 test: 0x30000:case 0x30000:Executed by:
executed 2 times by 1 test: case 0x30000:Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 197 | *pgroups = suiteb_curves; | - | ||||||||||||||||||||||||||||||||||||||||||
| 198 | *pgroupslen = (sizeof(suiteb_curves)/sizeof((suiteb_curves)[0])); | - | ||||||||||||||||||||||||||||||||||||||||||
| 199 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 200 | - | |||||||||||||||||||||||||||||||||||||||||||
| 201 | case never executed: 0x10000:case 0x10000:never executed: case 0x10000: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 202 | *pgroups = suiteb_curves; | - | ||||||||||||||||||||||||||||||||||||||||||
| 203 | *pgroupslen = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 204 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||||||||||||||||||||
| 206 | case never executed: 0x20000:case 0x20000:never executed: case 0x20000: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 207 | *pgroups = suiteb_curves + 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 208 | *pgroupslen = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 209 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 210 | - | |||||||||||||||||||||||||||||||||||||||||||
| 211 | default executed 19557 times by 1 test: :default:Executed by:
executed 19557 times by 1 test: default:Executed by:
| 19557 | ||||||||||||||||||||||||||||||||||||||||||
| 212 | if (s->ext.supportedgroups ==
| 279-19278 | ||||||||||||||||||||||||||||||||||||||||||
| 213 | ((void *)0)
| 279-19278 | ||||||||||||||||||||||||||||||||||||||||||
| 214 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 215 | *pgroups = eccurves_default; | - | ||||||||||||||||||||||||||||||||||||||||||
| 216 | *pgroupslen = (sizeof(eccurves_default)/sizeof((eccurves_default)[0])); | - | ||||||||||||||||||||||||||||||||||||||||||
| 217 | } executed 19278 times by 1 test: else {end of blockExecuted by:
| 19278 | ||||||||||||||||||||||||||||||||||||||||||
| 218 | *pgroups = s->ext.supportedgroups; | - | ||||||||||||||||||||||||||||||||||||||||||
| 219 | *pgroupslen = s->ext.supportedgroups_len; | - | ||||||||||||||||||||||||||||||||||||||||||
| 220 | } executed 279 times by 1 test: end of blockExecuted by:
| 279 | ||||||||||||||||||||||||||||||||||||||||||
| 221 | break; executed 19557 times by 1 test: break;Executed by:
| 19557 | ||||||||||||||||||||||||||||||||||||||||||
| 222 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 223 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||||||||||||||||||||
| 226 | int tls_curve_allowed(SSL *s, uint16_t curve, int op) | - | ||||||||||||||||||||||||||||||||||||||||||
| 227 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 228 | const TLS_GROUP_INFO *cinfo = tls1_group_id_lookup(curve); | - | ||||||||||||||||||||||||||||||||||||||||||
| 229 | unsigned char ctmp[2]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||||||||||||||||||||
| 231 | if (cinfo ==
| 0-34756 | ||||||||||||||||||||||||||||||||||||||||||
| 232 | ((void *)0)
| 0-34756 | ||||||||||||||||||||||||||||||||||||||||||
| 233 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 234 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 235 | - | |||||||||||||||||||||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||||||||||||||||||||
| 239 | ctmp[0] = curve >> 8; | - | ||||||||||||||||||||||||||||||||||||||||||
| 240 | ctmp[1] = curve & 0xff; | - | ||||||||||||||||||||||||||||||||||||||||||
| 241 | return executed 34756 times by 1 test: ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)ctmp);return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)ctmp);Executed by:
executed 34756 times by 1 test: return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)ctmp);Executed by:
| 34756 | ||||||||||||||||||||||||||||||||||||||||||
| 242 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||||||||||||||||||||
| 244 | - | |||||||||||||||||||||||||||||||||||||||||||
| 245 | static int tls1_in_list(uint16_t id, const uint16_t *list, size_t listlen) | - | ||||||||||||||||||||||||||||||||||||||||||
| 246 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 247 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 248 | for (i = 0; i < listlen
| 1730-14185 | ||||||||||||||||||||||||||||||||||||||||||
| 249 | if (list[i] == id
| 4136-10049 | ||||||||||||||||||||||||||||||||||||||||||
| 250 | return executed 4136 times by 1 test: 1;return 1;Executed by:
executed 4136 times by 1 test: return 1;Executed by:
| 4136 | ||||||||||||||||||||||||||||||||||||||||||
| 251 | return executed 1730 times by 1 test: 0;return 0;Executed by:
executed 1730 times by 1 test: return 0;Executed by:
| 1730 | ||||||||||||||||||||||||||||||||||||||||||
| 252 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 253 | uint16_t tls1_shared_group(SSL *s, int nmatch) | - | ||||||||||||||||||||||||||||||||||||||||||
| 254 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 255 | const uint16_t *pref, *supp; | - | ||||||||||||||||||||||||||||||||||||||||||
| 256 | size_t num_pref, num_supp, i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 257 | int k; | - | ||||||||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||||||||||||||||||||
| 260 | if (s->server == 0
| 0-7034 | ||||||||||||||||||||||||||||||||||||||||||
| 261 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 262 | if (nmatch == -2
| 1085-5949 | ||||||||||||||||||||||||||||||||||||||||||
| 263 | if ((
| 2-1083 | ||||||||||||||||||||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||||||||||||||||||||
| 268 | unsigned long cid = s->s3->tmp.new_cipher->id; | - | ||||||||||||||||||||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||||||||||||||||||||
| 270 | if (cid == 0x0300C02B
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 271 | return executed 2 times by 1 test: 23;return 23;Executed by:
executed 2 times by 1 test: return 23;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 272 | if (cid == 0x0300C02C
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 273 | return never executed: 24;return 24;never executed: return 24; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||||||||||||||||||||
| 275 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 276 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||||||||||||||||||||
| 278 | nmatch = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 279 | } executed 1083 times by 1 test: end of blockExecuted by:
| 1083 | ||||||||||||||||||||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||||||||||||||||||||
| 284 | if (s->options & 0x00400000U
| 13-7019 | ||||||||||||||||||||||||||||||||||||||||||
| 285 | tls1_get_supported_groups(s, &pref, &num_pref); | - | ||||||||||||||||||||||||||||||||||||||||||
| 286 | tls1_get_peer_groups(s, &supp, &num_supp); | - | ||||||||||||||||||||||||||||||||||||||||||
| 287 | } executed 13 times by 1 test: else {end of blockExecuted by:
| 13 | ||||||||||||||||||||||||||||||||||||||||||
| 288 | tls1_get_peer_groups(s, &pref, &num_pref); | - | ||||||||||||||||||||||||||||||||||||||||||
| 289 | tls1_get_supported_groups(s, &supp, &num_supp); | - | ||||||||||||||||||||||||||||||||||||||||||
| 290 | } executed 7019 times by 1 test: end of blockExecuted by:
| 7019 | ||||||||||||||||||||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||||||||||||||||||||
| 292 | for (k = 0, i = 0; i < num_pref
| 4289-4352 | ||||||||||||||||||||||||||||||||||||||||||
| 293 | uint16_t id = pref[i]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 294 | - | |||||||||||||||||||||||||||||||||||||||||||
| 295 | if (!tls1_in_list(id, supp, num_supp)
| 1609-2680 | ||||||||||||||||||||||||||||||||||||||||||
| 296 | || !tls_curve_allowed(s, id, (5 | (2 << 16)))
| 0-2680 | ||||||||||||||||||||||||||||||||||||||||||
| 297 | continue; executed 1609 times by 1 test: continue;Executed by:
| 1609 | ||||||||||||||||||||||||||||||||||||||||||
| 298 | if (nmatch == k
| 0-2680 | ||||||||||||||||||||||||||||||||||||||||||
| 299 | return executed 2680 times by 1 test: id;return id;Executed by:
executed 2680 times by 1 test: return id;Executed by:
| 2680 | ||||||||||||||||||||||||||||||||||||||||||
| 300 | k++; | - | ||||||||||||||||||||||||||||||||||||||||||
| 301 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 302 | if (nmatch == -1
| 0-4352 | ||||||||||||||||||||||||||||||||||||||||||
| 303 | return never executed: k;return k;never executed: return k; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 304 | - | |||||||||||||||||||||||||||||||||||||||||||
| 305 | return executed 4352 times by 1 test: 0;return 0;Executed by:
executed 4352 times by 1 test: return 0;Executed by:
| 4352 | ||||||||||||||||||||||||||||||||||||||||||
| 306 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||||||||||||||||||||
| 308 | int tls1_set_groups(uint16_t **pext, size_t *pextlen, | - | ||||||||||||||||||||||||||||||||||||||||||
| 309 | int *groups, size_t ngroups) | - | ||||||||||||||||||||||||||||||||||||||||||
| 310 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 311 | uint16_t *glist; | - | ||||||||||||||||||||||||||||||||||||||||||
| 312 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||||||||||||||||||||
| 317 | unsigned long dup_list = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 318 | - | |||||||||||||||||||||||||||||||||||||||||||
| 319 | if ((
| 0-111 | ||||||||||||||||||||||||||||||||||||||||||
| 320 | ((void *)0)
| 0-111 | ||||||||||||||||||||||||||||||||||||||||||
| 321 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 322 | ERR_put_error(20,(629),((1|64)),__FILE__,347); | - | ||||||||||||||||||||||||||||||||||||||||||
| 323 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 324 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 325 | for (i = 0; i < ngroups
| 111-116 | ||||||||||||||||||||||||||||||||||||||||||
| 326 | unsigned long idmask; | - | ||||||||||||||||||||||||||||||||||||||||||
| 327 | uint16_t id; | - | ||||||||||||||||||||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||||||||||||||||||||
| 329 | id = tls1_nid2group_id(groups[i]); | - | ||||||||||||||||||||||||||||||||||||||||||
| 330 | idmask = 1L << id; | - | ||||||||||||||||||||||||||||||||||||||||||
| 331 | if (!id
| 0-116 | ||||||||||||||||||||||||||||||||||||||||||
| 332 | CRYPTO_free(glist, __FILE__, 357); | - | ||||||||||||||||||||||||||||||||||||||||||
| 333 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 334 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 335 | dup_list |= idmask; | - | ||||||||||||||||||||||||||||||||||||||||||
| 336 | glist[i] = id; | - | ||||||||||||||||||||||||||||||||||||||||||
| 337 | } executed 116 times by 1 test: end of blockExecuted by:
| 116 | ||||||||||||||||||||||||||||||||||||||||||
| 338 | CRYPTO_free(*pext, __FILE__, 363); | - | ||||||||||||||||||||||||||||||||||||||||||
| 339 | *pext = glist; | - | ||||||||||||||||||||||||||||||||||||||||||
| 340 | *pextlen = ngroups; | - | ||||||||||||||||||||||||||||||||||||||||||
| 341 | return executed 111 times by 1 test: 1;return 1;Executed by:
executed 111 times by 1 test: return 1;Executed by:
| 111 | ||||||||||||||||||||||||||||||||||||||||||
| 342 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||||||||||||||||||||
| 346 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||||||||
| 347 | size_t nidcnt; | - | ||||||||||||||||||||||||||||||||||||||||||
| 348 | int nid_arr[(sizeof(nid_list)/sizeof((nid_list)[0]))]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 349 | } nid_cb_st; | - | ||||||||||||||||||||||||||||||||||||||||||
| 350 | - | |||||||||||||||||||||||||||||||||||||||||||
| 351 | static int nid_cb(const char *elem, int len, void *arg) | - | ||||||||||||||||||||||||||||||||||||||||||
| 352 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 353 | nid_cb_st *narg = arg; | - | ||||||||||||||||||||||||||||||||||||||||||
| 354 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 355 | int nid; | - | ||||||||||||||||||||||||||||||||||||||||||
| 356 | char etmp[20]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 357 | if (elem ==
| 0-116 | ||||||||||||||||||||||||||||||||||||||||||
| 358 | ((void *)0)
| 0-116 | ||||||||||||||||||||||||||||||||||||||||||
| 359 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 360 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 361 | if (narg->nidcnt == (sizeof(nid_list)/sizeof((nid_list)[0]))
| 0-116 | ||||||||||||||||||||||||||||||||||||||||||
| 362 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 363 | if (len > (int)(sizeof(etmp) - 1)
| 0-116 | ||||||||||||||||||||||||||||||||||||||||||
| 364 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 365 | memcpy(etmp, elem, len); | - | ||||||||||||||||||||||||||||||||||||||||||
| 366 | etmp[len] = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 367 | nid = EC_curve_nist2nid(etmp); | - | ||||||||||||||||||||||||||||||||||||||||||
| 368 | if (nid == 0
| 46-70 | ||||||||||||||||||||||||||||||||||||||||||
| 369 | nid = OBJ_sn2nid(etmp); executed 70 times by 1 test: nid = OBJ_sn2nid(etmp);Executed by:
| 70 | ||||||||||||||||||||||||||||||||||||||||||
| 370 | if (nid == 0
| 0-116 | ||||||||||||||||||||||||||||||||||||||||||
| 371 | nid = OBJ_ln2nid(etmp); never executed: nid = OBJ_ln2nid(etmp); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 372 | if (nid == 0
| 0-116 | ||||||||||||||||||||||||||||||||||||||||||
| 373 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 374 | for (i = 0; i < narg->nidcnt
| 5-116 | ||||||||||||||||||||||||||||||||||||||||||
| 375 | if (narg->nid_arr[i] == nid
| 0-5 | ||||||||||||||||||||||||||||||||||||||||||
| 376 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 377 | narg->nid_arr[narg->nidcnt++] = nid; | - | ||||||||||||||||||||||||||||||||||||||||||
| 378 | return executed 116 times by 1 test: 1;return 1;Executed by:
executed 116 times by 1 test: return 1;Executed by:
| 116 | ||||||||||||||||||||||||||||||||||||||||||
| 379 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||||||||||||||||||||
| 382 | int tls1_set_groups_list(uint16_t **pext, size_t *pextlen, const char *str) | - | ||||||||||||||||||||||||||||||||||||||||||
| 383 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 384 | nid_cb_st ncb; | - | ||||||||||||||||||||||||||||||||||||||||||
| 385 | ncb.nidcnt = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 386 | if (!CONF_parse_list(str, ':', 1, nid_cb, &ncb)
| 0-111 | ||||||||||||||||||||||||||||||||||||||||||
| 387 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 388 | if (pext ==
| 0-111 | ||||||||||||||||||||||||||||||||||||||||||
| 389 | ((void *)0)
| 0-111 | ||||||||||||||||||||||||||||||||||||||||||
| 390 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 391 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 392 | return executed 111 times by 1 test: tls1_set_groups(pext, pextlen, ncb.nid_arr, ncb.nidcnt);return tls1_set_groups(pext, pextlen, ncb.nid_arr, ncb.nidcnt);Executed by:
executed 111 times by 1 test: return tls1_set_groups(pext, pextlen, ncb.nid_arr, ncb.nidcnt);Executed by:
| 111 | ||||||||||||||||||||||||||||||||||||||||||
| 393 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||||||||||||||||||||
| 395 | static uint16_t tls1_get_group_id(EVP_PKEY *pkey) | - | ||||||||||||||||||||||||||||||||||||||||||
| 396 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 397 | EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 398 | const EC_GROUP *grp; | - | ||||||||||||||||||||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||||||||||||||||||||
| 400 | if (ec ==
| 0-814 | ||||||||||||||||||||||||||||||||||||||||||
| 401 | ((void *)0)
| 0-814 | ||||||||||||||||||||||||||||||||||||||||||
| 402 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 403 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 404 | grp = EC_KEY_get0_group(ec); | - | ||||||||||||||||||||||||||||||||||||||||||
| 405 | return executed 814 times by 1 test: tls1_nid2group_id(EC_GROUP_get_curve_name(grp));return tls1_nid2group_id(EC_GROUP_get_curve_name(grp));Executed by:
executed 814 times by 1 test: return tls1_nid2group_id(EC_GROUP_get_curve_name(grp));Executed by:
| 814 | ||||||||||||||||||||||||||||||||||||||||||
| 406 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||||||||||||||||||||
| 409 | static int tls1_check_pkey_comp(SSL *s, EVP_PKEY *pkey) | - | ||||||||||||||||||||||||||||||||||||||||||
| 410 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 411 | const EC_KEY *ec; | - | ||||||||||||||||||||||||||||||||||||||||||
| 412 | const EC_GROUP *grp; | - | ||||||||||||||||||||||||||||||||||||||||||
| 413 | unsigned char comp_id; | - | ||||||||||||||||||||||||||||||||||||||||||
| 414 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 415 | - | |||||||||||||||||||||||||||||||||||||||||||
| 416 | - | |||||||||||||||||||||||||||||||||||||||||||
| 417 | if (EVP_PKEY_id(pkey) != 408
| 0-869 | ||||||||||||||||||||||||||||||||||||||||||
| 418 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 419 | ec = EVP_PKEY_get0_EC_KEY(pkey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 420 | grp = EC_KEY_get0_group(ec); | - | ||||||||||||||||||||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||||||||||||||||||||
| 423 | if (EC_KEY_get_conv_form(ec) == POINT_CONVERSION_UNCOMPRESSED
| 6-863 | ||||||||||||||||||||||||||||||||||||||||||
| 424 | comp_id = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 425 | } executed 863 times by 1 test: else if ((!(s->method->ssl3_enc->enc_flags & 0x8)end of blockExecuted by:
| 0-863 | ||||||||||||||||||||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||||||||||||||||||||
| 427 | - | |||||||||||||||||||||||||||||||||||||||||||
| 428 | - | |||||||||||||||||||||||||||||||||||||||||||
| 429 | - | |||||||||||||||||||||||||||||||||||||||||||
| 430 | return executed 1 time by 1 test: 1;return 1;Executed by:
executed 1 time by 1 test: return 1;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 431 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||
| 432 | int field_type = EC_METHOD_get_field_type(EC_GROUP_method_of(grp)); | - | ||||||||||||||||||||||||||||||||||||||||||
| 433 | - | |||||||||||||||||||||||||||||||||||||||||||
| 434 | if (field_type == 406
| 1-4 | ||||||||||||||||||||||||||||||||||||||||||
| 435 | comp_id = 1; executed 4 times by 1 test: comp_id = 1;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 436 | else if (field_type == 407
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||
| 437 | comp_id = 2; executed 1 time by 1 test: comp_id = 2;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 438 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 439 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 440 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||||||||||||||||||||
| 442 | - | |||||||||||||||||||||||||||||||||||||||||||
| 443 | - | |||||||||||||||||||||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||||||||||||||||||||
| 445 | if (s->session->ext.ecpointformats ==
| 417-451 | ||||||||||||||||||||||||||||||||||||||||||
| 446 | ((void *)0)
| 417-451 | ||||||||||||||||||||||||||||||||||||||||||
| 447 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 448 | return executed 417 times by 1 test: 1;return 1;Executed by:
executed 417 times by 1 test: return 1;Executed by:
| 417 | ||||||||||||||||||||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||||||||||||||||||||
| 450 | for (i = 0; i < s->session->ext.ecpointformats_len
| 46-796 | ||||||||||||||||||||||||||||||||||||||||||
| 451 | if (s->session->ext.ecpointformats[i] == comp_id
| 391-405 | ||||||||||||||||||||||||||||||||||||||||||
| 452 | return executed 405 times by 1 test: 1;return 1;Executed by:
executed 405 times by 1 test: return 1;Executed by:
| 405 | ||||||||||||||||||||||||||||||||||||||||||
| 453 | } executed 391 times by 1 test: end of blockExecuted by:
| 391 | ||||||||||||||||||||||||||||||||||||||||||
| 454 | return executed 46 times by 1 test: 0;return 0;Executed by:
executed 46 times by 1 test: return 0;Executed by:
| 46 | ||||||||||||||||||||||||||||||||||||||||||
| 455 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||||||||||||||||||||
| 458 | int tls1_check_group_id(SSL *s, uint16_t group_id, int check_own_groups) | - | ||||||||||||||||||||||||||||||||||||||||||
| 459 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 460 | const uint16_t *groups; | - | ||||||||||||||||||||||||||||||||||||||||||
| 461 | size_t groups_len; | - | ||||||||||||||||||||||||||||||||||||||||||
| 462 | - | |||||||||||||||||||||||||||||||||||||||||||
| 463 | if (group_id == 0
| 1-1805 | ||||||||||||||||||||||||||||||||||||||||||
| 464 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||||||||||||||||||||
| 466 | - | |||||||||||||||||||||||||||||||||||||||||||
| 467 | if ((
| 0-1801 | ||||||||||||||||||||||||||||||||||||||||||
| 468 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||
| 469 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 470 | unsigned long cid = s->s3->tmp.new_cipher->id; | - | ||||||||||||||||||||||||||||||||||||||||||
| 471 | - | |||||||||||||||||||||||||||||||||||||||||||
| 472 | if (cid == 0x0300C02B
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 473 | if (group_id != 23
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 474 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 475 | } never executed: else if (cid == 0x0300C02Cend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 476 | if (group_id != 24
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 477 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 478 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||||||||||||||
| 480 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 481 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 482 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||||||||||||||||||||
| 484 | if (check_own_groups
| 643-1162 | ||||||||||||||||||||||||||||||||||||||||||
| 485 | - | |||||||||||||||||||||||||||||||||||||||||||
| 486 | tls1_get_supported_groups(s, &groups, &groups_len); | - | ||||||||||||||||||||||||||||||||||||||||||
| 487 | if (!tls1_in_list(group_id, groups, groups_len)
| 3-1159 | ||||||||||||||||||||||||||||||||||||||||||
| 488 | return executed 3 times by 1 test: 0;return 0;Executed by:
executed 3 times by 1 test: return 0;Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||
| 489 | } executed 1159 times by 1 test: end of blockExecuted by:
| 1159 | ||||||||||||||||||||||||||||||||||||||||||
| 490 | - | |||||||||||||||||||||||||||||||||||||||||||
| 491 | if (!tls_curve_allowed(s, group_id, (6 | (2 << 16)))
| 0-1802 | ||||||||||||||||||||||||||||||||||||||||||
| 492 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||||||||||||||||||||
| 494 | - | |||||||||||||||||||||||||||||||||||||||||||
| 495 | if (!s->server
| 645-1157 | ||||||||||||||||||||||||||||||||||||||||||
| 496 | return executed 1157 times by 1 test: 1;return 1;Executed by:
executed 1157 times by 1 test: return 1;Executed by:
| 1157 | ||||||||||||||||||||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||||||||||||||||||||
| 498 | - | |||||||||||||||||||||||||||||||||||||||||||
| 499 | tls1_get_peer_groups(s, &groups, &groups_len); | - | ||||||||||||||||||||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||||||||||||||||||||
| 505 | - | |||||||||||||||||||||||||||||||||||||||||||
| 506 | - | |||||||||||||||||||||||||||||||||||||||||||
| 507 | if (groups_len == 0
| 230-415 | ||||||||||||||||||||||||||||||||||||||||||
| 508 | return executed 230 times by 1 test: 1;return 1;Executed by:
executed 230 times by 1 test: return 1;Executed by:
| 230 | ||||||||||||||||||||||||||||||||||||||||||
| 509 | return executed 415 times by 1 test: tls1_in_list(group_id, groups, groups_len);return tls1_in_list(group_id, groups, groups_len);Executed by:
executed 415 times by 1 test: return tls1_in_list(group_id, groups, groups_len);Executed by:
| 415 | ||||||||||||||||||||||||||||||||||||||||||
| 510 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||||||||||||||||||||
| 512 | void tls1_get_formatlist(SSL *s, const unsigned char **pformats, | - | ||||||||||||||||||||||||||||||||||||||||||
| 513 | size_t *num_formats) | - | ||||||||||||||||||||||||||||||||||||||||||
| 514 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 515 | - | |||||||||||||||||||||||||||||||||||||||||||
| 516 | - | |||||||||||||||||||||||||||||||||||||||||||
| 517 | - | |||||||||||||||||||||||||||||||||||||||||||
| 518 | if (s->ext.ecpointformats
| 0-5858 | ||||||||||||||||||||||||||||||||||||||||||
| 519 | *pformats = s->ext.ecpointformats; | - | ||||||||||||||||||||||||||||||||||||||||||
| 520 | *num_formats = s->ext.ecpointformats_len; | - | ||||||||||||||||||||||||||||||||||||||||||
| 521 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 522 | *pformats = ecformats_default; | - | ||||||||||||||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||||||||||||||
| 524 | if ((
| 2-5856 | ||||||||||||||||||||||||||||||||||||||||||
| 525 | * executed 2 times by 1 test: num_formats = sizeof(ecformats_default) - 1;*num_formats = sizeof(ecformats_default) - 1;Executed by:
executed 2 times by 1 test: *num_formats = sizeof(ecformats_default) - 1;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 526 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 527 | * executed 5856 times by 1 test: num_formats = sizeof(ecformats_default);*num_formats = sizeof(ecformats_default);Executed by:
executed 5856 times by 1 test: *num_formats = sizeof(ecformats_default);Executed by:
| 5856 | ||||||||||||||||||||||||||||||||||||||||||
| 528 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 529 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 530 | - | |||||||||||||||||||||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||||||||||||||||||||
| 532 | - | |||||||||||||||||||||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||||||||||||||||||||
| 535 | static int tls1_check_cert_param(SSL *s, X509 *x, int check_ee_md) | - | ||||||||||||||||||||||||||||||||||||||||||
| 536 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 537 | uint16_t group_id; | - | ||||||||||||||||||||||||||||||||||||||||||
| 538 | EVP_PKEY *pkey; | - | ||||||||||||||||||||||||||||||||||||||||||
| 539 | pkey = X509_get0_pubkey(x); | - | ||||||||||||||||||||||||||||||||||||||||||
| 540 | if (pkey ==
| 0-2982 | ||||||||||||||||||||||||||||||||||||||||||
| 541 | ((void *)0)
| 0-2982 | ||||||||||||||||||||||||||||||||||||||||||
| 542 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 543 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 544 | - | |||||||||||||||||||||||||||||||||||||||||||
| 545 | if (EVP_PKEY_id(pkey) != 408
| 688-2294 | ||||||||||||||||||||||||||||||||||||||||||
| 546 | return executed 2294 times by 1 test: 1;return 1;Executed by:
executed 2294 times by 1 test: return 1;Executed by:
| 2294 | ||||||||||||||||||||||||||||||||||||||||||
| 547 | - | |||||||||||||||||||||||||||||||||||||||||||
| 548 | if (!tls1_check_pkey_comp(s, pkey)
| 45-643 | ||||||||||||||||||||||||||||||||||||||||||
| 549 | return executed 45 times by 1 test: 0;return 0;Executed by:
executed 45 times by 1 test: return 0;Executed by:
| 45 | ||||||||||||||||||||||||||||||||||||||||||
| 550 | group_id = tls1_get_group_id(pkey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 551 | - | |||||||||||||||||||||||||||||||||||||||||||
| 552 | - | |||||||||||||||||||||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||||||||||||||||||||
| 555 | if (!tls1_check_group_id(s, group_id, !s->server)
| 118-525 | ||||||||||||||||||||||||||||||||||||||||||
| 556 | return executed 118 times by 1 test: 0;return 0;Executed by:
executed 118 times by 1 test: return 0;Executed by:
| 118 | ||||||||||||||||||||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||||||||||||||||||||
| 560 | - | |||||||||||||||||||||||||||||||||||||||||||
| 561 | if (check_ee_md
| 0-525 | ||||||||||||||||||||||||||||||||||||||||||
| 562 | int check_md; | - | ||||||||||||||||||||||||||||||||||||||||||
| 563 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 564 | CERT *c = s->cert; | - | ||||||||||||||||||||||||||||||||||||||||||
| 565 | - | |||||||||||||||||||||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||||||||||||||||||||
| 567 | if (group_id == 23
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 568 | check_md = 794; executed 1 time by 1 test: check_md = 794;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 569 | else if (group_id == 24
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||
| 570 | check_md = 795; executed 1 time by 1 test: check_md = 795;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 571 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 572 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 573 | for (i = 0; i < c->shared_sigalgslen
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||
| 574 | if (check_md == c->shared_sigalgs[i]->sigandhash
| 1-2 | ||||||||||||||||||||||||||||||||||||||||||
| 575 | return executed 2 times by 1 test: 1;return 1;Executed by:
executed 2 times by 1 test: ;return 1;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 576 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 577 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 578 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 579 | return executed 523 times by 1 test: 1;return 1;Executed by:
executed 523 times by 1 test: return 1;Executed by:
| 523 | ||||||||||||||||||||||||||||||||||||||||||
| 580 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 581 | int tls1_check_ec_tmp_key(SSL *s, unsigned long cid) | - | ||||||||||||||||||||||||||||||||||||||||||
| 582 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 583 | - | |||||||||||||||||||||||||||||||||||||||||||
| 584 | if (!(s->cert->cert_flags & 0x30000)
| 2-5949 | ||||||||||||||||||||||||||||||||||||||||||
| 585 | return executed 5949 times by 1 test: tls1_shared_group(s, 0) != 0;return tls1_shared_group(s, 0) != 0;Executed by:
executed 5949 times by 1 test: return tls1_shared_group(s, 0) != 0;Executed by:
| 5949 | ||||||||||||||||||||||||||||||||||||||||||
| 586 | - | |||||||||||||||||||||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||||||||||||||||||||
| 588 | - | |||||||||||||||||||||||||||||||||||||||||||
| 589 | - | |||||||||||||||||||||||||||||||||||||||||||
| 590 | if (cid == 0x0300C02B
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 591 | return executed 2 times by 1 test: tls1_check_group_id(s, 23, 1);return tls1_check_group_id(s, 23, 1);Executed by:
executed 2 times by 1 test: return tls1_check_group_id(s, 23, 1);Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 592 | if (cid == 0x0300C02C
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 593 | return never executed: tls1_check_group_id(s, 24, 1);return tls1_check_group_id(s, 24, 1);never executed: return tls1_check_group_id(s, 24, 1); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||||||||||||||||||||
| 595 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 596 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 597 | static const uint16_t tls12_sigalgs[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 598 | - | |||||||||||||||||||||||||||||||||||||||||||
| 599 | 0x0403, | - | ||||||||||||||||||||||||||||||||||||||||||
| 600 | 0x0503, | - | ||||||||||||||||||||||||||||||||||||||||||
| 601 | 0x0603, | - | ||||||||||||||||||||||||||||||||||||||||||
| 602 | 0x0807, | - | ||||||||||||||||||||||||||||||||||||||||||
| 603 | 0x0808, | - | ||||||||||||||||||||||||||||||||||||||||||
| 604 | - | |||||||||||||||||||||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||||||||||||||||||||
| 606 | 0x0809, | - | ||||||||||||||||||||||||||||||||||||||||||
| 607 | 0x080a, | - | ||||||||||||||||||||||||||||||||||||||||||
| 608 | 0x080b, | - | ||||||||||||||||||||||||||||||||||||||||||
| 609 | 0x0804, | - | ||||||||||||||||||||||||||||||||||||||||||
| 610 | 0x0805, | - | ||||||||||||||||||||||||||||||||||||||||||
| 611 | 0x0806, | - | ||||||||||||||||||||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||||||||||||||||||||
| 613 | 0x0401, | - | ||||||||||||||||||||||||||||||||||||||||||
| 614 | 0x0501, | - | ||||||||||||||||||||||||||||||||||||||||||
| 615 | 0x0601, | - | ||||||||||||||||||||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||||||||||||||||||||
| 618 | 0x0303, | - | ||||||||||||||||||||||||||||||||||||||||||
| 619 | 0x0203, | - | ||||||||||||||||||||||||||||||||||||||||||
| 620 | - | |||||||||||||||||||||||||||||||||||||||||||
| 621 | 0x0301, | - | ||||||||||||||||||||||||||||||||||||||||||
| 622 | 0x0201, | - | ||||||||||||||||||||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||||||||||||||||||||
| 624 | 0x0302, | - | ||||||||||||||||||||||||||||||||||||||||||
| 625 | 0x0202, | - | ||||||||||||||||||||||||||||||||||||||||||
| 626 | - | |||||||||||||||||||||||||||||||||||||||||||
| 627 | 0x0402, | - | ||||||||||||||||||||||||||||||||||||||||||
| 628 | 0x0502, | - | ||||||||||||||||||||||||||||||||||||||||||
| 629 | 0x0602, | - | ||||||||||||||||||||||||||||||||||||||||||
| 630 | - | |||||||||||||||||||||||||||||||||||||||||||
| 631 | - | |||||||||||||||||||||||||||||||||||||||||||
| 632 | 0xeeee, | - | ||||||||||||||||||||||||||||||||||||||||||
| 633 | 0xefef, | - | ||||||||||||||||||||||||||||||||||||||||||
| 634 | 0xeded, | - | ||||||||||||||||||||||||||||||||||||||||||
| 635 | - | |||||||||||||||||||||||||||||||||||||||||||
| 636 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 637 | - | |||||||||||||||||||||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||||||||||||||||||||
| 639 | static const uint16_t suiteb_sigalgs[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 640 | 0x0403, | - | ||||||||||||||||||||||||||||||||||||||||||
| 641 | 0x0503 | - | ||||||||||||||||||||||||||||||||||||||||||
| 642 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||||||||||||||||||||
| 645 | static const SIGALG_LOOKUP sigalg_lookup_tbl[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||||||||||||||||||||
| 647 | {"ecdsa_secp256r1_sha256", 0x0403, | - | ||||||||||||||||||||||||||||||||||||||||||
| 648 | 672, 4, 408, 3, | - | ||||||||||||||||||||||||||||||||||||||||||
| 649 | 794, 415}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 650 | {"ecdsa_secp384r1_sha384", 0x0503, | - | ||||||||||||||||||||||||||||||||||||||||||
| 651 | 673, 5, 408, 3, | - | ||||||||||||||||||||||||||||||||||||||||||
| 652 | 795, 715}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 653 | {"ecdsa_secp521r1_sha512", 0x0603, | - | ||||||||||||||||||||||||||||||||||||||||||
| 654 | 674, 11, 408, 3, | - | ||||||||||||||||||||||||||||||||||||||||||
| 655 | 796, 716}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 656 | {"ed25519", 0x0807, | - | ||||||||||||||||||||||||||||||||||||||||||
| 657 | 0, -1, 1087, 7, | - | ||||||||||||||||||||||||||||||||||||||||||
| 658 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 659 | {"ed448", 0x0808, | - | ||||||||||||||||||||||||||||||||||||||||||
| 660 | 0, -1, 1088, 8, | - | ||||||||||||||||||||||||||||||||||||||||||
| 661 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 662 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 663 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 664 | , 0x0303, | - | ||||||||||||||||||||||||||||||||||||||||||
| 665 | 675, 10, 408, 3, | - | ||||||||||||||||||||||||||||||||||||||||||
| 666 | 793, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 667 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 668 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 669 | , 0x0203, | - | ||||||||||||||||||||||||||||||||||||||||||
| 670 | 64, 1, 408, 3, | - | ||||||||||||||||||||||||||||||||||||||||||
| 671 | 416, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 672 | - | |||||||||||||||||||||||||||||||||||||||||||
| 673 | {"rsa_pss_rsae_sha256", 0x0804, | - | ||||||||||||||||||||||||||||||||||||||||||
| 674 | 672, 4, 912, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 675 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 676 | {"rsa_pss_rsae_sha384", 0x0805, | - | ||||||||||||||||||||||||||||||||||||||||||
| 677 | 673, 5, 912, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 678 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 679 | {"rsa_pss_rsae_sha512", 0x0806, | - | ||||||||||||||||||||||||||||||||||||||||||
| 680 | 674, 11, 912, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 681 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 682 | {"rsa_pss_pss_sha256", 0x0809, | - | ||||||||||||||||||||||||||||||||||||||||||
| 683 | 672, 4, 912, 1, | - | ||||||||||||||||||||||||||||||||||||||||||
| 684 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 685 | {"rsa_pss_pss_sha384", 0x080a, | - | ||||||||||||||||||||||||||||||||||||||||||
| 686 | 673, 5, 912, 1, | - | ||||||||||||||||||||||||||||||||||||||||||
| 687 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 688 | {"rsa_pss_pss_sha512", 0x080b, | - | ||||||||||||||||||||||||||||||||||||||||||
| 689 | 674, 11, 912, 1, | - | ||||||||||||||||||||||||||||||||||||||||||
| 690 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 691 | {"rsa_pkcs1_sha256", 0x0401, | - | ||||||||||||||||||||||||||||||||||||||||||
| 692 | 672, 4, 6, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 693 | 668, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 694 | {"rsa_pkcs1_sha384", 0x0501, | - | ||||||||||||||||||||||||||||||||||||||||||
| 695 | 673, 5, 6, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 696 | 669, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 697 | {"rsa_pkcs1_sha512", 0x0601, | - | ||||||||||||||||||||||||||||||||||||||||||
| 698 | 674, 11, 6, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 699 | 670, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 700 | {"rsa_pkcs1_sha224", 0x0301, | - | ||||||||||||||||||||||||||||||||||||||||||
| 701 | 675, 10, 6, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 702 | 671, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 703 | {"rsa_pkcs1_sha1", 0x0201, | - | ||||||||||||||||||||||||||||||||||||||||||
| 704 | 64, 1, 6, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 705 | 65, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 706 | - | |||||||||||||||||||||||||||||||||||||||||||
| 707 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 708 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 709 | , 0x0402, | - | ||||||||||||||||||||||||||||||||||||||||||
| 710 | 672, 4, 116, 2, | - | ||||||||||||||||||||||||||||||||||||||||||
| 711 | 803, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 712 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 713 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 714 | , 0x0502, | - | ||||||||||||||||||||||||||||||||||||||||||
| 715 | 673, 5, 116, 2, | - | ||||||||||||||||||||||||||||||||||||||||||
| 716 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 717 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 718 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 719 | , 0x0602, | - | ||||||||||||||||||||||||||||||||||||||||||
| 720 | 674, 11, 116, 2, | - | ||||||||||||||||||||||||||||||||||||||||||
| 721 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 722 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 723 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 724 | , 0x0302, | - | ||||||||||||||||||||||||||||||||||||||||||
| 725 | 675, 10, 116, 2, | - | ||||||||||||||||||||||||||||||||||||||||||
| 726 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 727 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 728 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 729 | , 0x0202, | - | ||||||||||||||||||||||||||||||||||||||||||
| 730 | 64, 1, 116, 2, | - | ||||||||||||||||||||||||||||||||||||||||||
| 731 | 113, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 732 | - | |||||||||||||||||||||||||||||||||||||||||||
| 733 | - | |||||||||||||||||||||||||||||||||||||||||||
| 734 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 735 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 736 | , 0xeeee, | - | ||||||||||||||||||||||||||||||||||||||||||
| 737 | 982, 6, | - | ||||||||||||||||||||||||||||||||||||||||||
| 738 | 979, 5, | - | ||||||||||||||||||||||||||||||||||||||||||
| 739 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 740 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 741 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 742 | , 0xefef, | - | ||||||||||||||||||||||||||||||||||||||||||
| 743 | 983, 8, | - | ||||||||||||||||||||||||||||||||||||||||||
| 744 | 980, 6, | - | ||||||||||||||||||||||||||||||||||||||||||
| 745 | 0, 0}, | - | ||||||||||||||||||||||||||||||||||||||||||
| 746 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 747 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 748 | , 0xeded, | - | ||||||||||||||||||||||||||||||||||||||||||
| 749 | 809, 2, | - | ||||||||||||||||||||||||||||||||||||||||||
| 750 | 811, 4, | - | ||||||||||||||||||||||||||||||||||||||||||
| 751 | 0, 0} | - | ||||||||||||||||||||||||||||||||||||||||||
| 752 | - | |||||||||||||||||||||||||||||||||||||||||||
| 753 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 754 | - | |||||||||||||||||||||||||||||||||||||||||||
| 755 | static const SIGALG_LOOKUP legacy_rsa_sigalg = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 756 | "rsa_pkcs1_md5_sha1", 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 757 | 114, 9, | - | ||||||||||||||||||||||||||||||||||||||||||
| 758 | 6, 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 759 | 0, 0 | - | ||||||||||||||||||||||||||||||||||||||||||
| 760 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 761 | - | |||||||||||||||||||||||||||||||||||||||||||
| 762 | - | |||||||||||||||||||||||||||||||||||||||||||
| 763 | - | |||||||||||||||||||||||||||||||||||||||||||
| 764 | - | |||||||||||||||||||||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||||||||||||||||||||
| 766 | static const uint16_t tls_default_sigalg[] = { | - | ||||||||||||||||||||||||||||||||||||||||||
| 767 | 0x0201, | - | ||||||||||||||||||||||||||||||||||||||||||
| 768 | 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 769 | 0x0202, | - | ||||||||||||||||||||||||||||||||||||||||||
| 770 | 0x0203, | - | ||||||||||||||||||||||||||||||||||||||||||
| 771 | 0xeded, | - | ||||||||||||||||||||||||||||||||||||||||||
| 772 | 0xeeee, | - | ||||||||||||||||||||||||||||||||||||||||||
| 773 | 0xefef, | - | ||||||||||||||||||||||||||||||||||||||||||
| 774 | 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 775 | 0, | - | ||||||||||||||||||||||||||||||||||||||||||
| 776 | }; | - | ||||||||||||||||||||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||||||||||||||||||||
| 779 | static const SIGALG_LOOKUP *tls1_lookup_sigalg(uint16_t sigalg) | - | ||||||||||||||||||||||||||||||||||||||||||
| 780 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 781 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 782 | const SIGALG_LOOKUP *s; | - | ||||||||||||||||||||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||||||||||||||||||||
| 784 | for (i = 0, s = sigalg_lookup_tbl; i < (sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0]))
| 26938-5135349 | ||||||||||||||||||||||||||||||||||||||||||
| 785 | i++, s++) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 786 | if (s->sigalg == sigalg
| 328869-4806480 | ||||||||||||||||||||||||||||||||||||||||||
| 787 | return executed 328869 times by 1 test: s;return s;Executed by:
executed 328869 times by 1 test: return s;Executed by:
| 328869 | ||||||||||||||||||||||||||||||||||||||||||
| 788 | } executed 4806480 times by 1 test: end of blockExecuted by:
| 4806480 | ||||||||||||||||||||||||||||||||||||||||||
| 789 | return executed 26938 times by 1 test: return ((void *)0) ;Executed by:
executed 26938 times by 1 test: return ((void *)0) ;Executed by:
| 26938 | ||||||||||||||||||||||||||||||||||||||||||
| 790 | ((void *)0) executed 26938 times by 1 test: return ((void *)0) ;Executed by:
| 26938 | ||||||||||||||||||||||||||||||||||||||||||
| 791 | ; executed 26938 times by 1 test: return ((void *)0) ;Executed by:
| 26938 | ||||||||||||||||||||||||||||||||||||||||||
| 792 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 793 | - | |||||||||||||||||||||||||||||||||||||||||||
| 794 | int tls1_lookup_md(const SIGALG_LOOKUP *lu, const EVP_MD **pmd) | - | ||||||||||||||||||||||||||||||||||||||||||
| 795 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 796 | const EVP_MD *md; | - | ||||||||||||||||||||||||||||||||||||||||||
| 797 | if (lu ==
| 24719-221615 | ||||||||||||||||||||||||||||||||||||||||||
| 798 | ((void *)0)
| 24719-221615 | ||||||||||||||||||||||||||||||||||||||||||
| 799 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 800 | return executed 24719 times by 1 test: 0;return 0;Executed by:
executed 24719 times by 1 test: return 0;Executed by:
| 24719 | ||||||||||||||||||||||||||||||||||||||||||
| 801 | - | |||||||||||||||||||||||||||||||||||||||||||
| 802 | if (lu->hash == 0
| 16291-205324 | ||||||||||||||||||||||||||||||||||||||||||
| 803 | md = | - | ||||||||||||||||||||||||||||||||||||||||||
| 804 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 805 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 806 | } executed 16291 times by 1 test: else {end of blockExecuted by:
| 16291 | ||||||||||||||||||||||||||||||||||||||||||
| 807 | md = ssl_md(lu->hash_idx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 808 | if (md ==
| 18881-186443 | ||||||||||||||||||||||||||||||||||||||||||
| 809 | ((void *)0)
| 18881-186443 | ||||||||||||||||||||||||||||||||||||||||||
| 810 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 811 | return executed 18881 times by 1 test: 0;return 0;Executed by:
executed 18881 times by 1 test: return 0;Executed by:
| 18881 | ||||||||||||||||||||||||||||||||||||||||||
| 812 | } executed 186443 times by 1 test: end of blockExecuted by:
| 186443 | ||||||||||||||||||||||||||||||||||||||||||
| 813 | if (pmd
| 6264-196470 | ||||||||||||||||||||||||||||||||||||||||||
| 814 | * executed 6264 times by 1 test: pmd = md;*pmd = md;Executed by:
executed 6264 times by 1 test: *pmd = md;Executed by:
| 6264 | ||||||||||||||||||||||||||||||||||||||||||
| 815 | return executed 202734 times by 1 test: 1;return 1;Executed by:
executed 202734 times by 1 test: return 1;Executed by:
| 202734 | ||||||||||||||||||||||||||||||||||||||||||
| 816 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 817 | static int rsa_pss_check_min_key_size(const RSA *rsa, const SIGALG_LOOKUP *lu) | - | ||||||||||||||||||||||||||||||||||||||||||
| 818 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 819 | const EVP_MD *md; | - | ||||||||||||||||||||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||||||||||||||||||||
| 821 | if (rsa ==
| 0-1249 | ||||||||||||||||||||||||||||||||||||||||||
| 822 | ((void *)0)
| 0-1249 | ||||||||||||||||||||||||||||||||||||||||||
| 823 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 824 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 825 | if (!tls1_lookup_md(lu, &md)
| 0-1249 | ||||||||||||||||||||||||||||||||||||||||||
| 826 | ((void *)0)
| 0-1249 | ||||||||||||||||||||||||||||||||||||||||||
| 827 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 828 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 829 | if (RSA_size(rsa) < (2 * EVP_MD_size(md) + 2)
| 0-1249 | ||||||||||||||||||||||||||||||||||||||||||
| 830 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 831 | return executed 1249 times by 1 test: 1;return 1;Executed by:
executed 1249 times by 1 test: return 1;Executed by:
| 1249 | ||||||||||||||||||||||||||||||||||||||||||
| 832 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||||||||||||||||||||
| 834 | - | |||||||||||||||||||||||||||||||||||||||||||
| 835 | - | |||||||||||||||||||||||||||||||||||||||||||
| 836 | - | |||||||||||||||||||||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||||||||||||||||||||
| 838 | static const SIGALG_LOOKUP *tls1_get_legacy_sigalg(const SSL *s, int idx) | - | ||||||||||||||||||||||||||||||||||||||||||
| 839 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 840 | if (idx == -1
| 563-6566 | ||||||||||||||||||||||||||||||||||||||||||
| 841 | if (s->server
| 9-554 | ||||||||||||||||||||||||||||||||||||||||||
| 842 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 843 | - | |||||||||||||||||||||||||||||||||||||||||||
| 844 | - | |||||||||||||||||||||||||||||||||||||||||||
| 845 | for (i = 0; i < 9
| 0-687 | ||||||||||||||||||||||||||||||||||||||||||
| 846 | const SSL_CERT_LOOKUP *clu = ssl_cert_lookup_by_idx(i); | - | ||||||||||||||||||||||||||||||||||||||||||
| 847 | - | |||||||||||||||||||||||||||||||||||||||||||
| 848 | if (clu->amask & s->s3->tmp.new_cipher->algorithm_auth
| 133-554 | ||||||||||||||||||||||||||||||||||||||||||
| 849 | idx = i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 850 | break; executed 554 times by 1 test: break;Executed by:
| 554 | ||||||||||||||||||||||||||||||||||||||||||
| 851 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 852 | } executed 133 times by 1 test: end of blockExecuted by:
| 133 | ||||||||||||||||||||||||||||||||||||||||||
| 853 | - | |||||||||||||||||||||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||||||||||||||||||||
| 856 | - | |||||||||||||||||||||||||||||||||||||||||||
| 857 | if (idx == 4
| 0-554 | ||||||||||||||||||||||||||||||||||||||||||
| 858 | int real_idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 859 | - | |||||||||||||||||||||||||||||||||||||||||||
| 860 | for (real_idx = 6; real_idx >= 4
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 861 | real_idx--) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 862 | if (s->cert->pkeys[real_idx].privatekey !=
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 863 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 864 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 865 | idx = real_idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 866 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 867 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 868 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 869 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 870 | } executed 554 times by 1 test: else {end of blockExecuted by:
| 554 | ||||||||||||||||||||||||||||||||||||||||||
| 871 | idx = s->cert->key - s->cert->pkeys; | - | ||||||||||||||||||||||||||||||||||||||||||
| 872 | } executed 9 times by 1 test: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||
| 873 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 874 | if (idx < 0
| 0-7129 | ||||||||||||||||||||||||||||||||||||||||||
| 875 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 876 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 877 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 878 | if ((
| 1269-5288 | ||||||||||||||||||||||||||||||||||||||||||
| 879 | const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(tls_default_sigalg[idx]); | - | ||||||||||||||||||||||||||||||||||||||||||
| 880 | - | |||||||||||||||||||||||||||||||||||||||||||
| 881 | if (!tls1_lookup_md(lu,
| 1725-4135 | ||||||||||||||||||||||||||||||||||||||||||
| 882 | ((void *)0)
| 1725-4135 | ||||||||||||||||||||||||||||||||||||||||||
| 883 | )
| 1725-4135 | ||||||||||||||||||||||||||||||||||||||||||
| 884 | return executed 4135 times by 1 test: return ((void *)0) ;Executed by:
executed 4135 times by 1 test: return ((void *)0) ;Executed by:
| 4135 | ||||||||||||||||||||||||||||||||||||||||||
| 885 | ((void *)0) executed 4135 times by 1 test: return ((void *)0) ;Executed by:
| 4135 | ||||||||||||||||||||||||||||||||||||||||||
| 886 | ; executed 4135 times by 1 test: return ((void *)0) ;Executed by:
| 4135 | ||||||||||||||||||||||||||||||||||||||||||
| 887 | return executed 1725 times by 1 test: lu;return lu;Executed by:
executed 1725 times by 1 test: return lu;Executed by:
| 1725 | ||||||||||||||||||||||||||||||||||||||||||
| 888 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 889 | return executed 1269 times by 1 test: &legacy_rsa_sigalg;return &legacy_rsa_sigalg;Executed by:
executed 1269 times by 1 test: return &legacy_rsa_sigalg;Executed by:
| 1269 | ||||||||||||||||||||||||||||||||||||||||||
| 890 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||||||||||||||||||||
| 892 | int tls1_set_peer_legacy_sigalg(SSL *s, const EVP_PKEY *pkey) | - | ||||||||||||||||||||||||||||||||||||||||||
| 893 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 894 | size_t idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 895 | const SIGALG_LOOKUP *lu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||||||||||||||||||||
| 897 | if (ssl_cert_lookup_by_pkey(pkey, &idx) ==
| 0-365 | ||||||||||||||||||||||||||||||||||||||||||
| 898 | ((void *)0)
| 0-365 | ||||||||||||||||||||||||||||||||||||||||||
| 899 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 900 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 901 | lu = tls1_get_legacy_sigalg(s, idx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 902 | if (lu ==
| 1-364 | ||||||||||||||||||||||||||||||||||||||||||
| 903 | ((void *)0)
| 1-364 | ||||||||||||||||||||||||||||||||||||||||||
| 904 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 905 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 906 | s->s3->tmp.peer_sigalg = lu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 907 | return executed 364 times by 1 test: 1;return 1;Executed by:
executed 364 times by 1 test: return 1;Executed by:
| 364 | ||||||||||||||||||||||||||||||||||||||||||
| 908 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 909 | - | |||||||||||||||||||||||||||||||||||||||||||
| 910 | size_t tls12_get_psigalgs(SSL *s, int sent, const uint16_t **psigs) | - | ||||||||||||||||||||||||||||||||||||||||||
| 911 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 912 | - | |||||||||||||||||||||||||||||||||||||||||||
| 913 | - | |||||||||||||||||||||||||||||||||||||||||||
| 914 | - | |||||||||||||||||||||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||||||||||||||||||||
| 916 | - | |||||||||||||||||||||||||||||||||||||||||||
| 917 | switch ((s->cert->cert_flags & 0x30000)) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 918 | case executed 2 times by 1 test: 0x30000:case 0x30000:Executed by:
executed 2 times by 1 test: case 0x30000:Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 919 | *psigs = suiteb_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 920 | return executed 2 times by 1 test: (sizeof(suiteb_sigalgs)/sizeof((suiteb_sigalgs)[0]));return (sizeof(suiteb_sigalgs)/sizeof((suiteb_sigalgs)[0]));Executed by:
executed 2 times by 1 test: return (sizeof(suiteb_sigalgs)/sizeof((suiteb_sigalgs)[0]));Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 921 | - | |||||||||||||||||||||||||||||||||||||||||||
| 922 | case never executed: 0x10000:case 0x10000:never executed: case 0x10000: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 923 | *psigs = suiteb_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 924 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||||||||||||||||||||
| 926 | case never executed: 0x20000:case 0x20000:never executed: case 0x20000: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 927 | *psigs = suiteb_sigalgs + 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 928 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 929 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 930 | - | |||||||||||||||||||||||||||||||||||||||||||
| 931 | - | |||||||||||||||||||||||||||||||||||||||||||
| 932 | - | |||||||||||||||||||||||||||||||||||||||||||
| 933 | - | |||||||||||||||||||||||||||||||||||||||||||
| 934 | - | |||||||||||||||||||||||||||||||||||||||||||
| 935 | - | |||||||||||||||||||||||||||||||||||||||||||
| 936 | if ((
| 21-12720 | ||||||||||||||||||||||||||||||||||||||||||
| 937 | ((void *)0)
| 21-1045 | ||||||||||||||||||||||||||||||||||||||||||
| 938 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 939 | *psigs = s->cert->client_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 940 | return executed 21 times by 1 test: s->cert->client_sigalgslen;return s->cert->client_sigalgslen;Executed by:
executed 21 times by 1 test: return s->cert->client_sigalgslen;Executed by:
| 21 | ||||||||||||||||||||||||||||||||||||||||||
| 941 | } else if (s->cert->conf_sigalgs
| 129-13636 | ||||||||||||||||||||||||||||||||||||||||||
| 942 | *psigs = s->cert->conf_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 943 | return executed 129 times by 1 test: s->cert->conf_sigalgslen;return s->cert->conf_sigalgslen;Executed by:
executed 129 times by 1 test: return s->cert->conf_sigalgslen;Executed by:
| 129 | ||||||||||||||||||||||||||||||||||||||||||
| 944 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||
| 945 | *psigs = tls12_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 946 | return executed 13636 times by 1 test: (sizeof(tls12_sigalgs)/sizeof((tls12_sigalgs)[0]));return (sizeof(tls12_sigalgs)/sizeof((tls12_sigalgs)[0]));Executed by:
executed 13636 times by 1 test: return (sizeof(tls12_sigalgs)/sizeof((tls12_sigalgs)[0]));Executed by:
| 13636 | ||||||||||||||||||||||||||||||||||||||||||
| 947 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 948 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 949 | - | |||||||||||||||||||||||||||||||||||||||||||
| 950 | - | |||||||||||||||||||||||||||||||||||||||||||
| 951 | - | |||||||||||||||||||||||||||||||||||||||||||
| 952 | - | |||||||||||||||||||||||||||||||||||||||||||
| 953 | - | |||||||||||||||||||||||||||||||||||||||||||
| 954 | - | |||||||||||||||||||||||||||||||||||||||||||
| 955 | int tls12_check_peer_sigalg(SSL *s, uint16_t sig, EVP_PKEY *pkey) | - | ||||||||||||||||||||||||||||||||||||||||||
| 956 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 957 | const uint16_t *sent_sigs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 958 | const EVP_MD *md = | - | ||||||||||||||||||||||||||||||||||||||||||
| 959 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 960 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 961 | char sigalgstr[2]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 962 | size_t sent_sigslen, i, cidx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 963 | int pkeyid = EVP_PKEY_id(pkey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 964 | const SIGALG_LOOKUP *lu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 965 | - | |||||||||||||||||||||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||||||||||||||||||||
| 967 | if (pkeyid == -1
| 0-1389 | ||||||||||||||||||||||||||||||||||||||||||
| 968 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 969 | if ((!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-1293 | ||||||||||||||||||||||||||||||||||||||||||
| 970 | - | |||||||||||||||||||||||||||||||||||||||||||
| 971 | if (pkeyid == 116
| 0-489 | ||||||||||||||||||||||||||||||||||||||||||
| 972 | ossl_statem_fatal((s), (47), (333), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 973 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 974 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 975 | 969 | - | ||||||||||||||||||||||||||||||||||||||||||
| 976 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 977 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 978 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 979 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 980 | - | |||||||||||||||||||||||||||||||||||||||||||
| 981 | if (pkeyid == 6
| 14-475 | ||||||||||||||||||||||||||||||||||||||||||
| 982 | pkeyid = 912; executed 475 times by 1 test: pkeyid = 912;Executed by:
| 475 | ||||||||||||||||||||||||||||||||||||||||||
| 983 | } executed 489 times by 1 test: end of blockExecuted by:
| 489 | ||||||||||||||||||||||||||||||||||||||||||
| 984 | lu = tls1_lookup_sigalg(sig); | - | ||||||||||||||||||||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||||||||||||||||||||
| 986 | - | |||||||||||||||||||||||||||||||||||||||||||
| 987 | - | |||||||||||||||||||||||||||||||||||||||||||
| 988 | - | |||||||||||||||||||||||||||||||||||||||||||
| 989 | if (lu ==
| 1-1388 | ||||||||||||||||||||||||||||||||||||||||||
| 990 | ((void *)0)
| 1-1388 | ||||||||||||||||||||||||||||||||||||||||||
| 991 | - | |||||||||||||||||||||||||||||||||||||||||||
| 992 | || ((!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-1292 | ||||||||||||||||||||||||||||||||||||||||||
| 993 | || (pkeyid != lu->sig
| 461-927 | ||||||||||||||||||||||||||||||||||||||||||
| 994 | && (lu->sig != 912
| 1-459 | ||||||||||||||||||||||||||||||||||||||||||
| 995 | ossl_statem_fatal((s), (47), (333), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 996 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 997 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 998 | 986 | - | ||||||||||||||||||||||||||||||||||||||||||
| 999 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1000 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1001 | return executed 4 times by 1 test: 0;return 0;Executed by:
executed 4 times by 1 test: return 0;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 1002 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1003 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1004 | if (!ssl_cert_lookup_by_nid(EVP_PKEY_id(pkey), &cidx)
| 0-1385 | ||||||||||||||||||||||||||||||||||||||||||
| 1005 | || lu->sig_idx != (int)cidx
| 3-1382 | ||||||||||||||||||||||||||||||||||||||||||
| 1006 | ossl_statem_fatal((s), (47), (333), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1007 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1008 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1009 | 993 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1010 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1011 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1012 | return executed 3 times by 1 test: 0;return 0;Executed by:
executed 3 times by 1 test: return 0;Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||
| 1013 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1014 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1015 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1016 | if (pkeyid == 408
| 181-1201 | ||||||||||||||||||||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1018 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1019 | if (!tls1_check_pkey_comp(s, pkey)
| 1-180 | ||||||||||||||||||||||||||||||||||||||||||
| 1020 | ossl_statem_fatal((s), (47), (333), (162), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1022 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1023 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1024 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1025 | 1004 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1026 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1028 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1029 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 1030 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1033 | if ((!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-180 | ||||||||||||||||||||||||||||||||||||||||||
| 1034 | EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1035 | int curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1036 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1037 | if (lu->curve != 0
| 0-9 | ||||||||||||||||||||||||||||||||||||||||||
| 1038 | ossl_statem_fatal((s), (47), (333), (378), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1039 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1040 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1041 | 1015 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1042 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1043 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1044 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1045 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1046 | } executed 9 times by 1 test: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||
| 1047 | if (!(!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-180 | ||||||||||||||||||||||||||||||||||||||||||
| 1048 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1049 | if (!tls1_check_group_id(s, tls1_get_group_id(pkey), 1)
| 3-168 | ||||||||||||||||||||||||||||||||||||||||||
| 1050 | ossl_statem_fatal((s), (47), (333), (378), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1051 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1052 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1053 | 1023 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1054 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1055 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1056 | return executed 3 times by 1 test: 0;return 0;Executed by:
executed 3 times by 1 test: return 0;Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||
| 1057 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1058 | if ((
| 0-168 | ||||||||||||||||||||||||||||||||||||||||||
| 1059 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1060 | if (sig != 0x0403
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1061 | && sig != 0x0503
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1062 | ossl_statem_fatal((s), (40), (333), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1063 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1064 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1065 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1066 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1067 | 1032 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1068 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1069 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1070 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1071 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1072 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1073 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1074 | } executed 168 times by 1 test: end of blockExecuted by:
| 168 | ||||||||||||||||||||||||||||||||||||||||||
| 1075 | } executed 177 times by 1 test: else if ((end of blockExecuted by:
| 0-1201 | ||||||||||||||||||||||||||||||||||||||||||
| 1076 | ossl_statem_fatal((s), (40), (333), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1077 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1078 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1079 | 1039 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1080 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1081 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1082 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1083 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1084 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1085 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1086 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1087 | sent_sigslen = tls12_get_psigalgs(s, 1, &sent_sigs); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1088 | for (i = 0; i < sent_sigslen
| 1-14288 | ||||||||||||||||||||||||||||||||||||||||||
| 1089 | if (sig == *sent_sigs
| 1377-12911 | ||||||||||||||||||||||||||||||||||||||||||
| 1090 | break; executed 1377 times by 1 test: break;Executed by:
| 1377 | ||||||||||||||||||||||||||||||||||||||||||
| 1091 | } executed 12911 times by 1 test: end of blockExecuted by:
| 12911 | ||||||||||||||||||||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1093 | if (i == sent_sigslen
| 0-1377 | ||||||||||||||||||||||||||||||||||||||||||
| 1094 | || s->cert->cert_flags & (0x30000|0x00000001U)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1095 | ossl_statem_fatal((s), (40), (333), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1096 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1097 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1098 | 1054 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1099 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1100 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1101 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 1102 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1103 | if (!tls1_lookup_md(lu, &md)
| 0-1377 | ||||||||||||||||||||||||||||||||||||||||||
| 1104 | ossl_statem_fatal((s), (40), (333), (368), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1105 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1106 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1107 | 1059 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1108 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1109 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1110 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1111 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1112 | if (md !=
| 10-1367 | ||||||||||||||||||||||||||||||||||||||||||
| 1113 | ((void *)0)
| 10-1367 | ||||||||||||||||||||||||||||||||||||||||||
| 1114 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1115 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1116 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1117 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1118 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1119 | sigalgstr[0] = (sig >> 8) & 0xff; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1120 | sigalgstr[1] = sig & 0xff; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1121 | if (!ssl_security(s, (13 | (5 << 16)),
| 0-1367 | ||||||||||||||||||||||||||||||||||||||||||
| 1122 | EVP_MD_size(md) * 4, EVP_MD_type(md),
| 0-1367 | ||||||||||||||||||||||||||||||||||||||||||
| 1123 | (void *)sigalgstr)
| 0-1367 | ||||||||||||||||||||||||||||||||||||||||||
| 1124 | ossl_statem_fatal((s), (40), (333), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1125 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1126 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1127 | 1073 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1128 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1129 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1130 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1131 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1132 | } executed 1367 times by 1 test: end of blockExecuted by:
| 1367 | ||||||||||||||||||||||||||||||||||||||||||
| 1133 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1134 | s->s3->tmp.peer_sigalg = lu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1135 | return executed 1377 times by 1 test: 1;return 1;Executed by:
executed 1377 times by 1 test: return 1;Executed by:
| 1377 | ||||||||||||||||||||||||||||||||||||||||||
| 1136 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1137 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1138 | int SSL_get_peer_signature_type_nid(const SSL *s, int *pnid) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1139 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1140 | if (s->s3->tmp.peer_sigalg ==
| 978-1635 | ||||||||||||||||||||||||||||||||||||||||||
| 1141 | ((void *)0)
| 978-1635 | ||||||||||||||||||||||||||||||||||||||||||
| 1142 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1143 | return executed 1635 times by 1 test: 0;return 0;Executed by:
executed 1635 times by 1 test: return 0;Executed by:
| 1635 | ||||||||||||||||||||||||||||||||||||||||||
| 1144 | *pnid = s->s3->tmp.peer_sigalg->sig; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1145 | return executed 978 times by 1 test: 1;return 1;Executed by:
executed 978 times by 1 test: return 1;Executed by:
| 978 | ||||||||||||||||||||||||||||||||||||||||||
| 1146 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1147 | int ssl_set_client_disabled(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1148 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1149 | s->s3->tmp.mask_a = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1150 | s->s3->tmp.mask_k = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1151 | ssl_set_sig_mask(&s->s3->tmp.mask_a, s, (14 | (5 << 16))); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1152 | if (ssl_get_min_max_version(s, &s->s3->tmp.min_ver,
| 0-4948 | ||||||||||||||||||||||||||||||||||||||||||
| 1153 | &s->s3->tmp.max_ver,
| 0-4948 | ||||||||||||||||||||||||||||||||||||||||||
| 1154 | ((void *)0)
| 0-4948 | ||||||||||||||||||||||||||||||||||||||||||
| 1155 | ) != 0
| 0-4948 | ||||||||||||||||||||||||||||||||||||||||||
| 1156 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1157 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1158 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1159 | if (!s->psk_client_callback
| 42-4906 | ||||||||||||||||||||||||||||||||||||||||||
| 1160 | s->s3->tmp.mask_a |= 0x00000010U; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1161 | s->s3->tmp.mask_k |= (0x00000008U | 0x00000040U | 0x00000080U | 0x00000100U); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1162 | } executed 4906 times by 1 test: end of blockExecuted by:
| 4906 | ||||||||||||||||||||||||||||||||||||||||||
| 1163 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1164 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1165 | if (!(s->srp_ctx.srp_Mask & 0x00000020U)
| 11-4937 | ||||||||||||||||||||||||||||||||||||||||||
| 1166 | s->s3->tmp.mask_a |= 0x00000040U; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1167 | s->s3->tmp.mask_k |= 0x00000020U; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1168 | } executed 4937 times by 1 test: end of blockExecuted by:
| 4937 | ||||||||||||||||||||||||||||||||||||||||||
| 1169 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1170 | return executed 4948 times by 1 test: 1;return 1;Executed by:
executed 4948 times by 1 test: return 1;Executed by:
| 4948 | ||||||||||||||||||||||||||||||||||||||||||
| 1171 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1172 | int ssl_cipher_disabled(SSL *s, const SSL_CIPHER *c, int op, int ecdhe) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1173 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1174 | if (c->algorithm_mkey & s->s3->tmp.mask_k
| 246524-345518 | ||||||||||||||||||||||||||||||||||||||||||
| 1175 | || c->algorithm_auth & s->s3->tmp.mask_a
| 620-344898 | ||||||||||||||||||||||||||||||||||||||||||
| 1176 | return executed 247144 times by 1 test: 1;return 1;Executed by:
executed 247144 times by 1 test: return 1;Executed by:
| 247144 | ||||||||||||||||||||||||||||||||||||||||||
| 1177 | if (s->s3->tmp.max_ver == 0
| 0-344898 | ||||||||||||||||||||||||||||||||||||||||||
| 1178 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1179 | if (!(s->method->ssl3_enc->enc_flags & 0x8)
| 4929-339969 | ||||||||||||||||||||||||||||||||||||||||||
| 1180 | int min_tls = c->min_tls; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1181 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1182 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1183 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1184 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1185 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1186 | if (min_tls == 0x0301
| 434-306295 | ||||||||||||||||||||||||||||||||||||||||||
| 1187 | && (
| 1-433 | ||||||||||||||||||||||||||||||||||||||||||
| 1188 | min_tls = 0x0300; executed 433 times by 1 test: min_tls = 0x0300;Executed by:
| 433 | ||||||||||||||||||||||||||||||||||||||||||
| 1189 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1190 | if ((
| 2925-332725 | ||||||||||||||||||||||||||||||||||||||||||
| 1191 | return executed 10169 times by 1 test: 1;return 1;Executed by:
executed 10169 times by 1 test: return 1;Executed by:
| 10169 | ||||||||||||||||||||||||||||||||||||||||||
| 1192 | } executed 329800 times by 1 test: end of blockExecuted by:
| 329800 | ||||||||||||||||||||||||||||||||||||||||||
| 1193 | if ((
| 1146-329800 | ||||||||||||||||||||||||||||||||||||||||||
| 1194 | || ((((
| 0-3783 | ||||||||||||||||||||||||||||||||||||||||||
| 1195 | return executed 1146 times by 1 test: 1;return 1;Executed by:
executed 1146 times by 1 test: return 1;Executed by:
| 1146 | ||||||||||||||||||||||||||||||||||||||||||
| 1196 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1197 | return executed 333583 times by 1 test: !ssl_security(s, op, c->strength_bits, 0, (void *)c);return !ssl_security(s, op, c->strength_bits, 0, (void *)c);Executed by:
executed 333583 times by 1 test: return !ssl_security(s, op, c->strength_bits, 0, (void *)c);Executed by:
| 333583 | ||||||||||||||||||||||||||||||||||||||||||
| 1198 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1199 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1200 | int tls_use_ticket(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1201 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1202 | if ((
| 93-9514 | ||||||||||||||||||||||||||||||||||||||||||
| 1203 | return executed 93 times by 1 test: 0;return 0;Executed by:
executed 93 times by 1 test: return 0;Executed by:
| 93 | ||||||||||||||||||||||||||||||||||||||||||
| 1204 | return executed 9514 times by 1 test: ssl_security(s, (10 | 0), 0, 0, return ssl_security(s, (10 | 0), 0, 0, ((void *)0) );Executed by:
executed 9514 times by 1 test: return ssl_security(s, (10 | 0), 0, 0, ((void *)0) );Executed by:
| 9514 | ||||||||||||||||||||||||||||||||||||||||||
| 1205 | ((void *)0) executed 9514 times by 1 test: return ssl_security(s, (10 | 0), 0, 0, ((void *)0) );Executed by:
| 9514 | ||||||||||||||||||||||||||||||||||||||||||
| 1206 | ); executed 9514 times by 1 test: return ssl_security(s, (10 | 0), 0, 0, ((void *)0) );Executed by:
| 9514 | ||||||||||||||||||||||||||||||||||||||||||
| 1207 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1209 | int tls1_set_server_sigalgs(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1210 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1211 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1212 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1213 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1214 | CRYPTO_free(s->cert->shared_sigalgs, __FILE__, 1173); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1215 | s->cert->shared_sigalgs = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1216 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1217 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1218 | s->cert->shared_sigalgslen = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1219 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1220 | for (i = 0; i < 9
| 2503-22527 | ||||||||||||||||||||||||||||||||||||||||||
| 1221 | s->s3->tmp.valid_flags[i] = 0; executed 22527 times by 1 test: s->s3->tmp.valid_flags[i] = 0;Executed by:
| 22527 | ||||||||||||||||||||||||||||||||||||||||||
| 1222 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1223 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1226 | if (s->s3->tmp.peer_cert_sigalgs ==
| 52-2451 | ||||||||||||||||||||||||||||||||||||||||||
| 1227 | ((void *)0)
| 52-2451 | ||||||||||||||||||||||||||||||||||||||||||
| 1228 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1229 | && s->s3->tmp.peer_sigalgs ==
| 689-1762 | ||||||||||||||||||||||||||||||||||||||||||
| 1230 | ((void *)0)
| 689-1762 | ||||||||||||||||||||||||||||||||||||||||||
| 1231 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1232 | const uint16_t *sent_sigs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1233 | size_t sent_sigslen = tls12_get_psigalgs(s, 1, &sent_sigs); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1234 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1235 | for (i = 0; i < 9
| 689-6201 | ||||||||||||||||||||||||||||||||||||||||||
| 1236 | const SIGALG_LOOKUP *lu = tls1_get_legacy_sigalg(s, i); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1237 | size_t j; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1238 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1239 | if (lu ==
| 2067-4134 | ||||||||||||||||||||||||||||||||||||||||||
| 1240 | ((void *)0)
| 2067-4134 | ||||||||||||||||||||||||||||||||||||||||||
| 1241 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1242 | continue; executed 4134 times by 1 test: continue;Executed by:
| 4134 | ||||||||||||||||||||||||||||||||||||||||||
| 1243 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1244 | for (j = 0; j < sent_sigslen
| 498-41190 | ||||||||||||||||||||||||||||||||||||||||||
| 1245 | if (lu->sigalg == sent_sigs[j]
| 1569-39621 | ||||||||||||||||||||||||||||||||||||||||||
| 1246 | s->s3->tmp.valid_flags[i] = 0x2; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1247 | break; executed 1569 times by 1 test: break;Executed by:
| 1569 | ||||||||||||||||||||||||||||||||||||||||||
| 1248 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1249 | } executed 39621 times by 1 test: end of blockExecuted by:
| 39621 | ||||||||||||||||||||||||||||||||||||||||||
| 1250 | } executed 2067 times by 1 test: end of blockExecuted by:
| 2067 | ||||||||||||||||||||||||||||||||||||||||||
| 1251 | return executed 689 times by 1 test: 1;return 1;Executed by:
executed 689 times by 1 test: return 1;Executed by:
| 689 | ||||||||||||||||||||||||||||||||||||||||||
| 1252 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1253 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1254 | if (!tls1_process_sigalgs(s)
| 0-1814 | ||||||||||||||||||||||||||||||||||||||||||
| 1255 | ossl_statem_fatal((s), (80), (335), ((4|64)), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1256 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1257 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1258 | 1207 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1259 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1260 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1261 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1262 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1263 | if (s->cert->shared_sigalgs !=
| 19-1795 | ||||||||||||||||||||||||||||||||||||||||||
| 1264 | ((void *)0)
| 19-1795 | ||||||||||||||||||||||||||||||||||||||||||
| 1265 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1266 | return executed 1795 times by 1 test: 1;return 1;Executed by:
executed 1795 times by 1 test: return 1;Executed by:
| 1795 | ||||||||||||||||||||||||||||||||||||||||||
| 1267 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1268 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1269 | ossl_statem_fatal((s), (40), (335), (376), | - | ||||||||||||||||||||||||||||||||||||||||||
| 1270 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 1271 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 1272 | 1215 | - | ||||||||||||||||||||||||||||||||||||||||||
| 1273 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1274 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1275 | return executed 19 times by 1 test: 0;return 0;Executed by:
executed 19 times by 1 test: return 0;Executed by:
| 19 | ||||||||||||||||||||||||||||||||||||||||||
| 1276 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1277 | SSL_TICKET_STATUS tls_get_ticket_from_client(SSL *s, CLIENTHELLO_MSG *hello, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1278 | SSL_SESSION **ret) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1279 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1280 | size_t size; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1281 | RAW_EXTENSION *ticketext; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1282 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1283 | *ret = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1284 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1285 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1286 | s->ext.ticket_expected = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1287 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1288 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1289 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1290 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1291 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1292 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1293 | if (s->version <= 0x0300
| 0-1922 | ||||||||||||||||||||||||||||||||||||||||||
| 1294 | return executed 81 times by 1 test: 2;return 2;Executed by:
executed 81 times by 1 test: return 2;Executed by:
| 81 | ||||||||||||||||||||||||||||||||||||||||||
| 1295 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1296 | ticketext = &hello->pre_proc_exts[TLSEXT_IDX_session_ticket]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1297 | if (!ticketext->present
| 517-1324 | ||||||||||||||||||||||||||||||||||||||||||
| 1298 | return executed 517 times by 1 test: 2;return 2;Executed by:
executed 517 times by 1 test: return 2;Executed by:
| 517 | ||||||||||||||||||||||||||||||||||||||||||
| 1299 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1300 | size = PACKET_remaining(&ticketext->data); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1301 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1302 | return executed 1324 times by 1 test: tls_decrypt_ticket(s, PACKET_data(&ticketext->data), size,return tls_decrypt_ticket(s, PACKET_data(&ticketext->data), size, hello->session_id, hello->session_id_len, ret);Executed by:
executed 1324 times by 1 test: return tls_decrypt_ticket(s, PACKET_data(&ticketext->data), size, hello->session_id, hello->session_id_len, ret);Executed by:
| 1324 | ||||||||||||||||||||||||||||||||||||||||||
| 1303 | hello->session_id, hello->session_id_len, ret); executed 1324 times by 1 test: return tls_decrypt_ticket(s, PACKET_data(&ticketext->data), size, hello->session_id, hello->session_id_len, ret);Executed by:
| 1324 | ||||||||||||||||||||||||||||||||||||||||||
| 1304 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1305 | SSL_TICKET_STATUS tls_decrypt_ticket(SSL *s, const unsigned char *etick, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1306 | size_t eticklen, const unsigned char *sess_id, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1307 | size_t sesslen, SSL_SESSION **psess) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1308 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1309 | SSL_SESSION *sess = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1310 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1311 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1312 | unsigned char *sdec; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1313 | const unsigned char *p; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1314 | int slen, renew_ticket = 0, declen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1315 | SSL_TICKET_STATUS ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1316 | size_t mlen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1317 | unsigned char tick_hmac[64]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1318 | HMAC_CTX *hctx = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1319 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1320 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1321 | EVP_CIPHER_CTX *ctx = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1322 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1323 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1324 | SSL_CTX *tctx = s->session_ctx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1325 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1326 | if (eticklen == 0
| 284-1140 | ||||||||||||||||||||||||||||||||||||||||||
| 1327 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1328 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1329 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1330 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1331 | ret = 3; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1332 | goto executed 1140 times by 1 test: end;goto end;Executed by:
executed 1140 times by 1 test: goto end;Executed by:
| 1140 | ||||||||||||||||||||||||||||||||||||||||||
| 1333 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1334 | if (!(!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-269 | ||||||||||||||||||||||||||||||||||||||||||
| 1335 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1336 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1337 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1338 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1339 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1340 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1341 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1342 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1343 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1344 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1345 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1346 | if (eticklen < 16 + 16
| 51-233 | ||||||||||||||||||||||||||||||||||||||||||
| 1347 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1348 | goto executed 51 times by 1 test: end;goto end;Executed by:
executed 51 times by 1 test: goto end;Executed by:
| 51 | ||||||||||||||||||||||||||||||||||||||||||
| 1349 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1350 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1351 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1352 | hctx = HMAC_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1353 | if (hctx ==
| 0-233 | ||||||||||||||||||||||||||||||||||||||||||
| 1354 | ((void *)0)
| 0-233 | ||||||||||||||||||||||||||||||||||||||||||
| 1355 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1356 | ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1357 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1358 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1359 | ctx = EVP_CIPHER_CTX_new(); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1360 | if (ctx ==
| 0-233 | ||||||||||||||||||||||||||||||||||||||||||
| 1361 | ((void *)0)
| 0-233 | ||||||||||||||||||||||||||||||||||||||||||
| 1362 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1363 | ret = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1364 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1365 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1366 | if (tctx->ext.ticket_key_cb
| 4-229 | ||||||||||||||||||||||||||||||||||||||||||
| 1367 | unsigned char *nctick = (unsigned char *)etick; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1368 | int rv = tctx->ext.ticket_key_cb(s, nctick, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1369 | nctick + 16, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1370 | ctx, hctx, 0); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1371 | if (rv < 0
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||
| 1372 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1373 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1374 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1375 | if (rv == 0
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||
| 1376 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1377 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1378 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1379 | if (rv == 2
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 1380 | renew_ticket = 1; executed 2 times by 1 test: renew_ticket = 1;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 1381 | } executed 4 times by 1 test: else {end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 1382 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1383 | if (memcmp(etick, tctx->ext.tick_key_name,
| 12-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1384 | 16) != 0
| 12-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1385 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1386 | goto executed 12 times by 1 test: end;goto end;Executed by:
executed 12 times by 1 test: goto end;Executed by:
| 12 | ||||||||||||||||||||||||||||||||||||||||||
| 1387 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1388 | if (HMAC_Init_ex(hctx, tctx->ext.secure->tick_hmac_key,
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1389 | sizeof(tctx->ext.secure->tick_hmac_key),
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1390 | EVP_sha256(),
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1391 | ((void *)0)
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1392 | ) <= 0
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1393 | || EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(),
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1394 | ((void *)0)
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1395 | ,
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1396 | tctx->ext.secure->tick_aes_key,
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1397 | etick + 16) <= 0
| 0-217 | ||||||||||||||||||||||||||||||||||||||||||
| 1398 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1399 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1400 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1401 | if ((!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-202 | ||||||||||||||||||||||||||||||||||||||||||
| 1402 | renew_ticket = 1; executed 85 times by 1 test: renew_ticket = 1;Executed by:
| 85 | ||||||||||||||||||||||||||||||||||||||||||
| 1403 | } executed 217 times by 1 test: end of blockExecuted by:
| 217 | ||||||||||||||||||||||||||||||||||||||||||
| 1404 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1405 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1406 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1407 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1408 | mlen = HMAC_size(hctx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1409 | if (mlen == 0
| 0-221 | ||||||||||||||||||||||||||||||||||||||||||
| 1410 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1411 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1412 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1413 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1414 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1415 | if (eticklen <=
| 1-220 | ||||||||||||||||||||||||||||||||||||||||||
| 1416 | 16 + EVP_CIPHER_CTX_iv_length(ctx) + mlen
| 1-220 | ||||||||||||||||||||||||||||||||||||||||||
| 1417 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1418 | goto executed 1 time by 1 test: end;goto end;Executed by:
executed 1 time by 1 test: goto end;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 1419 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1420 | eticklen -= mlen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1421 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1422 | if (HMAC_Update(hctx, etick, eticklen) <= 0
| 0-220 | ||||||||||||||||||||||||||||||||||||||||||
| 1423 | || HMAC_Final(hctx, tick_hmac,
| 0-220 | ||||||||||||||||||||||||||||||||||||||||||
| 1424 | ((void *)0)
| 0-220 | ||||||||||||||||||||||||||||||||||||||||||
| 1425 | ) <= 0
| 0-220 | ||||||||||||||||||||||||||||||||||||||||||
| 1426 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1427 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1428 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1429 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1430 | if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen)
| 7-213 | ||||||||||||||||||||||||||||||||||||||||||
| 1431 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1432 | goto executed 7 times by 1 test: end;goto end;Executed by:
executed 7 times by 1 test: goto end;Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||
| 1433 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1434 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1435 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1436 | p = etick + 16 + EVP_CIPHER_CTX_iv_length(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1437 | eticklen -= 16 + EVP_CIPHER_CTX_iv_length(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1438 | sdec = CRYPTO_malloc(eticklen, __FILE__, 1393); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1439 | if (sdec ==
| 0-213 | ||||||||||||||||||||||||||||||||||||||||||
| 1440 | ((void *)0)
| 0-213 | ||||||||||||||||||||||||||||||||||||||||||
| 1441 | || EVP_DecryptUpdate(ctx, sdec, &slen, p,
| 0-213 | ||||||||||||||||||||||||||||||||||||||||||
| 1442 | (int)eticklen) <= 0
| 0-213 | ||||||||||||||||||||||||||||||||||||||||||
| 1443 | CRYPTO_free(sdec, __FILE__, 1396); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1444 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1445 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1446 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1447 | if (EVP_DecryptFinal(ctx, sdec + slen, &declen) <= 0
| 8-205 | ||||||||||||||||||||||||||||||||||||||||||
| 1448 | CRYPTO_free(sdec, __FILE__, 1401); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1449 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1450 | goto executed 8 times by 1 test: end;goto end;Executed by:
executed 8 times by 1 test: goto end;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 1451 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1452 | slen += declen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1453 | p = sdec; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1454 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1455 | sess = d2i_SSL_SESSION( | - | ||||||||||||||||||||||||||||||||||||||||||
| 1456 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1457 | , &p, slen); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1458 | slen -= p - sdec; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1459 | CRYPTO_free(sdec, __FILE__, 1410); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1460 | if (sess
| 22-183 | ||||||||||||||||||||||||||||||||||||||||||
| 1461 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1462 | if (slen != 0
| 2-181 | ||||||||||||||||||||||||||||||||||||||||||
| 1463 | SSL_SESSION_free(sess); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1464 | sess = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1465 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1466 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1467 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1468 | goto executed 2 times by 1 test: end;goto end;Executed by:
executed 2 times by 1 test: goto end;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 1469 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1470 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1472 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1474 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1475 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1476 | if (sesslen
| 83-98 | ||||||||||||||||||||||||||||||||||||||||||
| 1477 | memcpy(sess->session_id, sess_id, sesslen); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1478 | sess->session_id_length = sesslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1479 | } executed 98 times by 1 test: end of blockExecuted by:
| 98 | ||||||||||||||||||||||||||||||||||||||||||
| 1480 | if (renew_ticket
| 80-101 | ||||||||||||||||||||||||||||||||||||||||||
| 1481 | ret = 6; executed 80 times by 1 test: ret = 6;Executed by:
| 80 | ||||||||||||||||||||||||||||||||||||||||||
| 1482 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 1483 | ret = 5; executed 101 times by 1 test: ret = 5;Executed by:
| 101 | ||||||||||||||||||||||||||||||||||||||||||
| 1484 | goto executed 181 times by 1 test: end;goto end;Executed by:
executed 181 times by 1 test: goto end;Executed by:
| 181 | ||||||||||||||||||||||||||||||||||||||||||
| 1485 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1486 | ERR_clear_error(); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1487 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1488 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1489 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1490 | ret = 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1491 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1492 | end: code before this statement executed 22 times by 1 test: end:Executed by:
| 22 | ||||||||||||||||||||||||||||||||||||||||||
| 1493 | EVP_CIPHER_CTX_free(ctx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1494 | HMAC_CTX_free(hctx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1496 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1497 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1498 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1499 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1500 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1501 | if (s->session_ctx->decrypt_ticket_cb !=
| 21-1403 | ||||||||||||||||||||||||||||||||||||||||||
| 1502 | ((void *)0)
| 21-1403 | ||||||||||||||||||||||||||||||||||||||||||
| 1503 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1504 | && (ret == 3
| 7-14 | ||||||||||||||||||||||||||||||||||||||||||
| 1505 | || ret == 4
| 0-14 | ||||||||||||||||||||||||||||||||||||||||||
| 1506 | || ret == 5
| 7 | ||||||||||||||||||||||||||||||||||||||||||
| 1507 | || ret == 6
| 0-7 | ||||||||||||||||||||||||||||||||||||||||||
| 1508 | size_t keyname_len = eticklen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1509 | int retcb; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1510 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1511 | if (keyname_len > 16
| 7-14 | ||||||||||||||||||||||||||||||||||||||||||
| 1512 | keyname_len = 16; executed 14 times by 1 test: keyname_len = 16;Executed by:
| 14 | ||||||||||||||||||||||||||||||||||||||||||
| 1513 | retcb = s->session_ctx->decrypt_ticket_cb(s, sess, etick, keyname_len, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1514 | ret, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1515 | s->session_ctx->ticket_cb_data); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1516 | switch (retcb) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1517 | case never executed: 0:case 0:never executed: case 0: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1518 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1519 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1520 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1521 | case executed 2 times by 1 test: 1:case 1:Executed by:
executed 2 times by 1 test: case 1:Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 1522 | ret = 2; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1523 | SSL_SESSION_free(sess); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1524 | sess = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1525 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1526 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1527 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 1528 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1529 | case executed 9 times by 1 test: 2:case 2:Executed by:
executed 9 times by 1 test: case 2:Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||
| 1530 | if (ret != 3
| 0-7 | ||||||||||||||||||||||||||||||||||||||||||
| 1531 | ret = 4; executed 2 times by 1 test: ret = 4;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 1532 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1533 | SSL_SESSION_free(sess); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1534 | sess = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1535 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1536 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1537 | break; executed 9 times by 1 test: break;Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||||||||
| 1538 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1539 | case executed 5 times by 1 test: 3:case 3:Executed by:
executed 5 times by 1 test: case 3:Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||
| 1540 | case executed 5 times by 1 test: 4:case 4:Executed by:
executed 5 times by 1 test: case 4:Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||
| 1541 | if (ret != 5
| 5 | ||||||||||||||||||||||||||||||||||||||||||
| 1542 | && ret != 6
| 0-5 | ||||||||||||||||||||||||||||||||||||||||||
| 1543 | ret = 1; never executed: ret = 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1544 | else if (retcb == 3
| 5 | ||||||||||||||||||||||||||||||||||||||||||
| 1545 | ret = 5; executed 5 times by 1 test: ret = 5;Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||
| 1546 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 1547 | ret = 6; executed 5 times by 1 test: ret = 6;Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||
| 1548 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||
| 1549 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1550 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1551 | ret = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1552 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1553 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1554 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1555 | if (s->ext.session_secret_cb ==
| 0-1424 | ||||||||||||||||||||||||||||||||||||||||||
| 1556 | ((void *)0)
| 0-1424 | ||||||||||||||||||||||||||||||||||||||||||
| 1557 | || (!(s->method->ssl3_enc->enc_flags & 0x8)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1558 | switch (ret) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1559 | case executed 105 times by 1 test: 4:case 4:Executed by:
executed 105 times by 1 test: case 4:Executed by:
| 105 | ||||||||||||||||||||||||||||||||||||||||||
| 1560 | case executed 78 times by 1 test: 6:case 6:Executed by:
executed 78 times by 1 test: case 6:Executed by:
| 78 | ||||||||||||||||||||||||||||||||||||||||||
| 1561 | case executed 1140 times by 1 test: 3:case 3:Executed by:
executed 1140 times by 1 test: case 3:Executed by:
| 1140 | ||||||||||||||||||||||||||||||||||||||||||
| 1562 | s->ext.ticket_expected = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1563 | } executed 1323 times by 1 test: end of blockExecuted by:
| 1323 | ||||||||||||||||||||||||||||||||||||||||||
| 1564 | } executed 1424 times by 1 test: end of blockExecuted by:
| 1424 | ||||||||||||||||||||||||||||||||||||||||||
| 1565 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1566 | *psess = sess; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1567 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1568 | return executed 1424 times by 1 test: ret;return ret;Executed by:
executed 1424 times by 1 test: return ret;Executed by:
| 1424 | ||||||||||||||||||||||||||||||||||||||||||
| 1569 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1570 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1571 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1572 | static int tls12_sigalg_allowed(SSL *s, int op, const SIGALG_LOOKUP *lu) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1573 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1574 | unsigned char sigalgstr[2]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1575 | int secbits; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1576 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1577 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1578 | if (!tls1_lookup_md(lu,
| 39465-189541 | ||||||||||||||||||||||||||||||||||||||||||
| 1579 | ((void *)0)
| 39465-189541 | ||||||||||||||||||||||||||||||||||||||||||
| 1580 | )
| 39465-189541 | ||||||||||||||||||||||||||||||||||||||||||
| 1581 | return executed 39465 times by 1 test: 0;return 0;Executed by:
executed 39465 times by 1 test: return 0;Executed by:
| 39465 | ||||||||||||||||||||||||||||||||||||||||||
| 1582 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1583 | if ((!(s->method->ssl3_enc->enc_flags & 0x8)
| 5462-178806 | ||||||||||||||||||||||||||||||||||||||||||
| 1584 | return executed 5462 times by 1 test: 0;return 0;Executed by:
executed 5462 times by 1 test: return 0;Executed by:
| 5462 | ||||||||||||||||||||||||||||||||||||||||||
| 1585 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1586 | if (!s->server
| 3293-127645 | ||||||||||||||||||||||||||||||||||||||||||
| 1587 | && (lu->sig == 116
| 306-2768 | ||||||||||||||||||||||||||||||||||||||||||
| 1588 | || lu->hash_idx == 0
| 0-2462 | ||||||||||||||||||||||||||||||||||||||||||
| 1589 | || lu->hash_idx == 10
| 306-2156 | ||||||||||||||||||||||||||||||||||||||||||
| 1590 | return executed 1137 times by 1 test: 0;return 0;Executed by:
executed 1137 times by 1 test: return 0;Executed by:
| 1137 | ||||||||||||||||||||||||||||||||||||||||||
| 1591 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1592 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1593 | if (ssl_cert_is_disabled(lu->sig_idx)
| 0-182942 | ||||||||||||||||||||||||||||||||||||||||||
| 1594 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1595 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1596 | if (lu->sig == 979
| 0-182942 | ||||||||||||||||||||||||||||||||||||||||||
| 1597 | || lu->sig == 980
| 0-182942 | ||||||||||||||||||||||||||||||||||||||||||
| 1598 | || lu->sig == 811
| 0-182942 | ||||||||||||||||||||||||||||||||||||||||||
| 1599 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1600 | if (s->server
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1601 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1602 | if (!s->server
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1603 | && s->method->version == 0x10000
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1604 | && s->s3->tmp.max_ver >= 0x0304
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1605 | int i, num; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1606 | struct stack_st_SSL_CIPHER *sk; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1607 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1608 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1609 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1610 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1611 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1612 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1613 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1614 | if (s->s3->tmp.min_ver >= 0x0304
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1615 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1616 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1617 | sk = SSL_get_ciphers(s); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1618 | num = sk !=
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1619 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1620 | ? sk_SSL_CIPHER_num(sk) : 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1621 | for (i = 0; i < num
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1622 | const SSL_CIPHER *c; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1623 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1624 | c = sk_SSL_CIPHER_value(sk, i); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1625 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1626 | if (ssl_cipher_disabled(s, c, (1 | (1 << 16)), 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1627 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1628 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1629 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1630 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1631 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1632 | if (i == num
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1633 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1634 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1635 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1636 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1637 | if (lu->hash == 0
| 15187-167755 | ||||||||||||||||||||||||||||||||||||||||||
| 1638 | return executed 15187 times by 1 test: 1;return 1;Executed by:
executed 15187 times by 1 test: return 1;Executed by:
| 15187 | ||||||||||||||||||||||||||||||||||||||||||
| 1639 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1640 | secbits = EVP_MD_size(ssl_md(lu->hash_idx)) * 4; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1641 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1642 | sigalgstr[0] = (lu->sigalg >> 8) & 0xff; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1643 | sigalgstr[1] = lu->sigalg & 0xff; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1644 | return executed 167755 times by 1 test: ssl_security(s, op, secbits, lu->hash, (void *)sigalgstr);return ssl_security(s, op, secbits, lu->hash, (void *)sigalgstr);Executed by:
executed 167755 times by 1 test: return ssl_security(s, op, secbits, lu->hash, (void *)sigalgstr);Executed by:
| 167755 | ||||||||||||||||||||||||||||||||||||||||||
| 1645 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1646 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1647 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1648 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1649 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1650 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1651 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1652 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1653 | void ssl_set_sig_mask(uint32_t *pmask_a, SSL *s, int op) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1654 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1655 | const uint16_t *sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1656 | size_t i, sigalgslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1657 | uint32_t disabled_mask = 0x00000001U | 0x00000002U | 0x00000008U; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1658 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1659 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1660 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1661 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1662 | sigalgslen = tls12_get_psigalgs(s, 1, &sigalgs); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1663 | for (i = 0; i < sigalgslen
| 4983-128352 | ||||||||||||||||||||||||||||||||||||||||||
| 1664 | const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(*sigalgs); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1665 | const SSL_CERT_LOOKUP *clu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1666 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1667 | if (lu ==
| 0-128352 | ||||||||||||||||||||||||||||||||||||||||||
| 1668 | ((void *)0)
| 0-128352 | ||||||||||||||||||||||||||||||||||||||||||
| 1669 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1670 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1671 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1672 | clu = ssl_cert_lookup_by_idx(lu->sig_idx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1673 | if (clu ==
| 0-128352 | ||||||||||||||||||||||||||||||||||||||||||
| 1674 | ((void *)0)
| 0-128352 | ||||||||||||||||||||||||||||||||||||||||||
| 1675 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1676 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1677 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1678 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1679 | if ((
| 14858-113494 | ||||||||||||||||||||||||||||||||||||||||||
| 1680 | && tls12_sigalg_allowed(s, op, lu)
| 0-14858 | ||||||||||||||||||||||||||||||||||||||||||
| 1681 | disabled_mask &= ~clu->amask; executed 14858 times by 1 test: disabled_mask &= ~clu->amask;Executed by:
| 14858 | ||||||||||||||||||||||||||||||||||||||||||
| 1682 | } executed 128352 times by 1 test: end of blockExecuted by:
| 128352 | ||||||||||||||||||||||||||||||||||||||||||
| 1683 | *pmask_a |= disabled_mask; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1684 | } executed 4983 times by 1 test: end of blockExecuted by:
| 4983 | ||||||||||||||||||||||||||||||||||||||||||
| 1685 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1686 | int tls12_copy_sigalgs(SSL *s, WPACKET *pkt, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1687 | const uint16_t *psig, size_t psiglen) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1688 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1689 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1690 | int rv = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1691 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1692 | for (i = 0; i < psiglen
| 4683-120354 | ||||||||||||||||||||||||||||||||||||||||||
| 1693 | const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(*psig); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1694 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1695 | if (!tls12_sigalg_allowed(s, (11 | (5 << 16)), lu)
| 15014-105340 | ||||||||||||||||||||||||||||||||||||||||||
| 1696 | continue; executed 15014 times by 1 test: continue;Executed by:
| 15014 | ||||||||||||||||||||||||||||||||||||||||||
| 1697 | if (!WPACKET_put_bytes__((pkt), (*psig), 2)
| 0-105340 | ||||||||||||||||||||||||||||||||||||||||||
| 1698 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1699 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1700 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1701 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1702 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1703 | if (rv == 0
| 27-100656 | ||||||||||||||||||||||||||||||||||||||||||
| 1704 | || (lu->sig != 6
| 1-46 | ||||||||||||||||||||||||||||||||||||||||||
| 1705 | && lu->hash != 64
| 1-45 | ||||||||||||||||||||||||||||||||||||||||||
| 1706 | && lu->hash != 675
| 0-45 | ||||||||||||||||||||||||||||||||||||||||||
| 1707 | rv = 1; executed 4682 times by 1 test: rv = 1;Executed by:
| 4682 | ||||||||||||||||||||||||||||||||||||||||||
| 1708 | } executed 105340 times by 1 test: end of blockExecuted by:
| 105340 | ||||||||||||||||||||||||||||||||||||||||||
| 1709 | if (rv == 0
| 1-4682 | ||||||||||||||||||||||||||||||||||||||||||
| 1710 | ERR_put_error(20,(533),(118),__FILE__,1643); executed 1 time by 1 test: ERR_put_error(20,(533),(118),__FILE__,1643);Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 1711 | return executed 4683 times by 1 test: rv;return rv;Executed by:
executed 4683 times by 1 test: return rv;Executed by:
| 4683 | ||||||||||||||||||||||||||||||||||||||||||
| 1712 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1713 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1714 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1715 | static size_t tls12_shared_sigalgs(SSL *s, const SIGALG_LOOKUP **shsig, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1716 | const uint16_t *pref, size_t preflen, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1717 | const uint16_t *allow, size_t allowlen) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1718 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1719 | const uint16_t *ptmp, *atmp; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1720 | size_t i, j, nmatch = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1721 | for (i = 0, ptmp = pref; i < preflen
| 3818-93794 | ||||||||||||||||||||||||||||||||||||||||||
| 1722 | const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(*ptmp); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1723 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1724 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1725 | if (!tls12_sigalg_allowed(s, (12 | (5 << 16)), lu)
| 31050-62744 | ||||||||||||||||||||||||||||||||||||||||||
| 1726 | continue; executed 31050 times by 1 test: continue;Executed by:
| 31050 | ||||||||||||||||||||||||||||||||||||||||||
| 1727 | for (j = 0, atmp = allow; j < allowlen
| 0-739174 | ||||||||||||||||||||||||||||||||||||||||||
| 1728 | if (*
| 62744-676430 | ||||||||||||||||||||||||||||||||||||||||||
| 1729 | nmatch++; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1730 | if (shsig
| 31372 | ||||||||||||||||||||||||||||||||||||||||||
| 1731 | * executed 31372 times by 1 test: shsig++ = lu;*shsig++ = lu;Executed by:
executed 31372 times by 1 test: *shsig++ = lu;Executed by:
| 31372 | ||||||||||||||||||||||||||||||||||||||||||
| 1732 | break; executed 62744 times by 1 test: break;Executed by:
| 62744 | ||||||||||||||||||||||||||||||||||||||||||
| 1733 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1734 | } executed 676430 times by 1 test: end of blockExecuted by:
| 676430 | ||||||||||||||||||||||||||||||||||||||||||
| 1735 | } executed 62744 times by 1 test: end of blockExecuted by:
| 62744 | ||||||||||||||||||||||||||||||||||||||||||
| 1736 | return executed 3818 times by 1 test: nmatch;return nmatch;Executed by:
executed 3818 times by 1 test: return nmatch;Executed by:
| 3818 | ||||||||||||||||||||||||||||||||||||||||||
| 1737 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1738 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1739 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1740 | static int tls1_set_shared_sigalgs(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1741 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1742 | const uint16_t *pref, *allow, *conf; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1743 | size_t preflen, allowlen, conflen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1744 | size_t nmatch; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1745 | const SIGALG_LOOKUP **salgs = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1746 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1747 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1748 | CERT *c = s->cert; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1749 | unsigned int is_suiteb = (s->cert->cert_flags & 0x30000); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1750 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1751 | CRYPTO_free(c->shared_sigalgs, __FILE__, 1682); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1752 | c->shared_sigalgs = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1753 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1754 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1755 | c->shared_sigalgslen = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1756 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1757 | if (!s->server
| 0-1814 | ||||||||||||||||||||||||||||||||||||||||||
| 1758 | conf = c->client_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1759 | conflen = c->client_sigalgslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1760 | } never executed: else if (c->conf_sigalgsend of block
| 0-1933 | ||||||||||||||||||||||||||||||||||||||||||
| 1761 | conf = c->conf_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1762 | conflen = c->conf_sigalgslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1763 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1764 | conflen = tls12_get_psigalgs(s, 0, &conf); executed 1933 times by 1 test: conflen = tls12_get_psigalgs(s, 0, &conf);Executed by:
| 1933 | ||||||||||||||||||||||||||||||||||||||||||
| 1765 | if (s->options & 0x00400000U
| 2-1927 | ||||||||||||||||||||||||||||||||||||||||||
| 1766 | pref = conf; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1767 | preflen = conflen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1768 | allow = s->s3->tmp.peer_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1769 | allowlen = s->s3->tmp.peer_sigalgslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1770 | } executed 8 times by 1 test: else {end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 1771 | allow = conf; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1772 | allowlen = conflen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1773 | pref = s->s3->tmp.peer_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1774 | preflen = s->s3->tmp.peer_sigalgslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1775 | } executed 1925 times by 1 test: end of blockExecuted by:
| 1925 | ||||||||||||||||||||||||||||||||||||||||||
| 1776 | nmatch = tls12_shared_sigalgs(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1777 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1778 | , pref, preflen, allow, allowlen); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1779 | if (nmatch
| 48-1885 | ||||||||||||||||||||||||||||||||||||||||||
| 1780 | if ((
| 0-1885 | ||||||||||||||||||||||||||||||||||||||||||
| 1781 | ((void *)0)
| 0-1885 | ||||||||||||||||||||||||||||||||||||||||||
| 1782 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1783 | ERR_put_error(20,(631),((1|64)),__FILE__,1708); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1784 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1785 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1786 | nmatch = tls12_shared_sigalgs(s, salgs, pref, preflen, allow, allowlen); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1787 | } executed 1885 times by 1 test: else {end of blockExecuted by:
| 1885 | ||||||||||||||||||||||||||||||||||||||||||
| 1788 | salgs = | - | ||||||||||||||||||||||||||||||||||||||||||
| 1789 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1790 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1791 | } executed 48 times by 1 test: end of blockExecuted by:
| 48 | ||||||||||||||||||||||||||||||||||||||||||
| 1792 | c->shared_sigalgs = salgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1793 | c->shared_sigalgslen = nmatch; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1794 | return executed 1933 times by 1 test: 1;return 1;Executed by:
executed 1933 times by 1 test: return 1;Executed by:
| 1933 | ||||||||||||||||||||||||||||||||||||||||||
| 1795 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1796 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1797 | int tls1_save_u16(PACKET *pkt, uint16_t **pdest, size_t *pdestlen) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1798 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1799 | unsigned int stmp; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1800 | size_t size, i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1801 | uint16_t *buf; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1802 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1803 | size = PACKET_remaining(pkt); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1804 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1805 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1806 | if (size == 0
| 1-4501 | ||||||||||||||||||||||||||||||||||||||||||
| 1807 | return executed 4 times by 1 test: 0;return 0;Executed by:
executed 4 times by 1 test: return 0;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 1808 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1809 | size >>= 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1810 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1811 | if ((
| 0-4498 | ||||||||||||||||||||||||||||||||||||||||||
| 1812 | ((void *)0)
| 0-4498 | ||||||||||||||||||||||||||||||||||||||||||
| 1813 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1814 | ERR_put_error(20,(628),((1|64)),__FILE__,1735); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1815 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1816 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1817 | for (i = 0; i < size
| 0-61735 | ||||||||||||||||||||||||||||||||||||||||||
| 1818 | buf[i] = stmp; executed 61735 times by 1 test: buf[i] = stmp;Executed by:
| 61735 | ||||||||||||||||||||||||||||||||||||||||||
| 1819 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1820 | if (i != size
| 0-4498 | ||||||||||||||||||||||||||||||||||||||||||
| 1821 | CRYPTO_free(buf, __FILE__, 1742); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1822 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1823 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1825 | CRYPTO_free(*pdest, __FILE__, 1746); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1826 | *pdest = buf; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1827 | *pdestlen = size; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1828 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1829 | return executed 4498 times by 1 test: 1;return 1;Executed by:
executed 4498 times by 1 test: return 1;Executed by:
| 4498 | ||||||||||||||||||||||||||||||||||||||||||
| 1830 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1831 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1832 | int tls1_save_sigalgs(SSL *s, PACKET *pkt, int cert) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1833 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1834 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1835 | if (!(s->method->ssl3_enc->enc_flags & 0x2)
| 152-2062 | ||||||||||||||||||||||||||||||||||||||||||
| 1836 | return executed 152 times by 1 test: 1;return 1;Executed by:
executed 152 times by 1 test: return 1;Executed by:
| 152 | ||||||||||||||||||||||||||||||||||||||||||
| 1837 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1838 | if (s->cert ==
| 0-2062 | ||||||||||||||||||||||||||||||||||||||||||
| 1839 | ((void *)0)
| 0-2062 | ||||||||||||||||||||||||||||||||||||||||||
| 1840 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1841 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1842 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1843 | if (cert
| 54-2008 | ||||||||||||||||||||||||||||||||||||||||||
| 1844 | return executed 54 times by 1 test: tls1_save_u16(pkt, &s->s3->tmp.peer_cert_sigalgs,return tls1_save_u16(pkt, &s->s3->tmp.peer_cert_sigalgs, &s->s3->tmp.peer_cert_sigalgslen);Executed by:
executed 54 times by 1 test: return tls1_save_u16(pkt, &s->s3->tmp.peer_cert_sigalgs, &s->s3->tmp.peer_cert_sigalgslen);Executed by:
| 54 | ||||||||||||||||||||||||||||||||||||||||||
| 1845 | &s->s3->tmp.peer_cert_sigalgslen); executed 54 times by 1 test: return tls1_save_u16(pkt, &s->s3->tmp.peer_cert_sigalgs, &s->s3->tmp.peer_cert_sigalgslen);Executed by:
| 54 | ||||||||||||||||||||||||||||||||||||||||||
| 1846 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 1847 | return executed 2008 times by 1 test: tls1_save_u16(pkt, &s->s3->tmp.peer_sigalgs,return tls1_save_u16(pkt, &s->s3->tmp.peer_sigalgs, &s->s3->tmp.peer_sigalgslen);Executed by:
executed 2008 times by 1 test: return tls1_save_u16(pkt, &s->s3->tmp.peer_sigalgs, &s->s3->tmp.peer_sigalgslen);Executed by:
| 2008 | ||||||||||||||||||||||||||||||||||||||||||
| 1848 | &s->s3->tmp.peer_sigalgslen); executed 2008 times by 1 test: return tls1_save_u16(pkt, &s->s3->tmp.peer_sigalgs, &s->s3->tmp.peer_sigalgslen);Executed by:
| 2008 | ||||||||||||||||||||||||||||||||||||||||||
| 1849 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1850 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1851 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1852 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1853 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1854 | int tls1_process_sigalgs(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1855 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1856 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1857 | uint32_t *pvalid = s->s3->tmp.valid_flags; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1858 | CERT *c = s->cert; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1860 | if (!tls1_set_shared_sigalgs(s)
| 0-1933 | ||||||||||||||||||||||||||||||||||||||||||
| 1861 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1862 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1863 | for (i = 0; i < 9
| 1933-17397 | ||||||||||||||||||||||||||||||||||||||||||
| 1864 | pvalid[i] = 0; executed 17397 times by 1 test: pvalid[i] = 0;Executed by:
| 17397 | ||||||||||||||||||||||||||||||||||||||||||
| 1865 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1866 | for (i = 0; i < c->shared_sigalgslen
| 1933-31372 | ||||||||||||||||||||||||||||||||||||||||||
| 1867 | const SIGALG_LOOKUP *sigptr = c->shared_sigalgs[i]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1868 | int idx = sigptr->sig_idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1869 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1870 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1871 | if ((!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-28244 | ||||||||||||||||||||||||||||||||||||||||||
| 1872 | continue; executed 2759 times by 1 test: continue;Executed by:
| 2759 | ||||||||||||||||||||||||||||||||||||||||||
| 1873 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1874 | if (pvalid[idx] == 0
| 0-20819 | ||||||||||||||||||||||||||||||||||||||||||
| 1875 | pvalid[idx] = 0x100 | 0x2; executed 7794 times by 1 test: pvalid[idx] = 0x100 | 0x2;Executed by:
| 7794 | ||||||||||||||||||||||||||||||||||||||||||
| 1876 | } executed 28613 times by 1 test: end of blockExecuted by:
| 28613 | ||||||||||||||||||||||||||||||||||||||||||
| 1877 | return executed 1933 times by 1 test: 1;return 1;Executed by:
executed 1933 times by 1 test: return 1;Executed by:
| 1933 | ||||||||||||||||||||||||||||||||||||||||||
| 1878 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1879 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1880 | int SSL_get_sigalgs(SSL *s, int idx, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1881 | int *psign, int *phash, int *psignhash, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1882 | unsigned char *rsig, unsigned char *rhash) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1883 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1884 | uint16_t *psig = s->s3->tmp.peer_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1885 | size_t numsigalgs = s->s3->tmp.peer_sigalgslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1886 | if (psig ==
| 212-2296 | ||||||||||||||||||||||||||||||||||||||||||
| 1887 | ((void *)0)
| 212-2296 | ||||||||||||||||||||||||||||||||||||||||||
| 1888 | || numsigalgs > 0x7fffffff
| 0-2296 | ||||||||||||||||||||||||||||||||||||||||||
| 1889 | return executed 212 times by 1 test: 0;return 0;Executed by:
executed 212 times by 1 test: return 0;Executed by:
| 212 | ||||||||||||||||||||||||||||||||||||||||||
| 1890 | if (idx >= 0
| 99-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1891 | const SIGALG_LOOKUP *lu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1892 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1893 | if (idx >= (int)numsigalgs
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1894 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1895 | psig += idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1896 | if (rhash !=
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1897 | ((void *)0)
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1898 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1899 | * executed 2197 times by 1 test: rhash = (unsigned char)((*psig >> 8) & 0xff);*rhash = (unsigned char)((*psig >> 8) & 0xff);Executed by:
executed 2197 times by 1 test: *rhash = (unsigned char)((*psig >> 8) & 0xff);Executed by:
| 2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1900 | if (rsig !=
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1901 | ((void *)0)
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1902 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1903 | * executed 2197 times by 1 test: rsig = (unsigned char)(*psig & 0xff);*rsig = (unsigned char)(*psig & 0xff);Executed by:
executed 2197 times by 1 test: *rsig = (unsigned char)(*psig & 0xff);Executed by:
| 2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1904 | lu = tls1_lookup_sigalg(*psig); | - | ||||||||||||||||||||||||||||||||||||||||||
| 1905 | if (psign !=
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1906 | ((void *)0)
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1907 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1908 | * executed 2197 times by 1 test: psign = lu != *psign = lu != ((void *)0) ? lu->sig : 0;Executed by:
executed 2197 times by 1 test: *psign = lu != ((void *)0) ? lu->sig : 0;Executed by:
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1909 | ((void *)0)
executed 2197 times by 1 test: *psign = lu != ((void *)0) ? lu->sig : 0;Executed by:
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1910 | ? lu->sig : 0; executed 2197 times by 1 test: *psign = lu != ((void *)0) ? lu->sig : 0;Executed by:
| 2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1911 | if (phash !=
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1912 | ((void *)0)
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1913 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1914 | * executed 2197 times by 1 test: phash = lu != *phash = lu != ((void *)0) ? lu->hash : 0;Executed by:
executed 2197 times by 1 test: *phash = lu != ((void *)0) ? lu->hash : 0;Executed by:
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1915 | ((void *)0)
executed 2197 times by 1 test: *phash = lu != ((void *)0) ? lu->hash : 0;Executed by:
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1916 | ? lu->hash : 0; executed 2197 times by 1 test: *phash = lu != ((void *)0) ? lu->hash : 0;Executed by:
| 2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1917 | if (psignhash !=
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1918 | ((void *)0)
| 0-2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1919 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1920 | * never executed: psignhash = lu != *psignhash = lu != ((void *)0) ? lu->sigandhash : 0;
never executed: *psignhash = lu != ((void *)0) ? lu->sigandhash : 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1921 | ((void *)0)
never executed: *psignhash = lu != ((void *)0) ? lu->sigandhash : 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1922 | ? lu->sigandhash : 0; never executed: *psignhash = lu != ((void *)0) ? lu->sigandhash : 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1923 | } executed 2197 times by 1 test: end of blockExecuted by:
| 2197 | ||||||||||||||||||||||||||||||||||||||||||
| 1924 | return executed 2296 times by 1 test: (int)numsigalgs;return (int)numsigalgs;Executed by:
executed 2296 times by 1 test: return (int)numsigalgs;Executed by:
| 2296 | ||||||||||||||||||||||||||||||||||||||||||
| 1925 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1926 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1927 | int SSL_get_shared_sigalgs(SSL *s, int idx, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1928 | int *psign, int *phash, int *psignhash, | - | ||||||||||||||||||||||||||||||||||||||||||
| 1929 | unsigned char *rsig, unsigned char *rhash) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1930 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1931 | const SIGALG_LOOKUP *shsigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1932 | if (s->cert->shared_sigalgs ==
| 63-188 | ||||||||||||||||||||||||||||||||||||||||||
| 1933 | ((void *)0)
| 63-188 | ||||||||||||||||||||||||||||||||||||||||||
| 1934 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1935 | || idx < 0
| 0-63 | ||||||||||||||||||||||||||||||||||||||||||
| 1936 | || idx >= (int)s->cert->shared_sigalgslen
| 0-63 | ||||||||||||||||||||||||||||||||||||||||||
| 1937 | || s->cert->shared_sigalgslen > 0x7fffffff
| 0-63 | ||||||||||||||||||||||||||||||||||||||||||
| 1938 | return executed 188 times by 1 test: 0;return 0;Executed by:
executed 188 times by 1 test: return 0;Executed by:
| 188 | ||||||||||||||||||||||||||||||||||||||||||
| 1939 | shsigalgs = s->cert->shared_sigalgs[idx]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1940 | if (phash !=
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1941 | ((void *)0)
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1942 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1943 | * executed 60 times by 1 test: phash = shsigalgs->hash;*phash = shsigalgs->hash;Executed by:
executed 60 times by 1 test: *phash = shsigalgs->hash;Executed by:
| 60 | ||||||||||||||||||||||||||||||||||||||||||
| 1944 | if (psign !=
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1945 | ((void *)0)
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1946 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1947 | * executed 60 times by 1 test: psign = shsigalgs->sig;*psign = shsigalgs->sig;Executed by:
executed 60 times by 1 test: *psign = shsigalgs->sig;Executed by:
| 60 | ||||||||||||||||||||||||||||||||||||||||||
| 1948 | if (psignhash !=
| 0-63 | ||||||||||||||||||||||||||||||||||||||||||
| 1949 | ((void *)0)
| 0-63 | ||||||||||||||||||||||||||||||||||||||||||
| 1950 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1951 | * never executed: psignhash = shsigalgs->sigandhash;*psignhash = shsigalgs->sigandhash;never executed: *psignhash = shsigalgs->sigandhash; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 1952 | if (rsig !=
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1953 | ((void *)0)
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1954 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1955 | * executed 60 times by 1 test: rsig = (unsigned char)(shsigalgs->sigalg & 0xff);*rsig = (unsigned char)(shsigalgs->sigalg & 0xff);Executed by:
executed 60 times by 1 test: *rsig = (unsigned char)(shsigalgs->sigalg & 0xff);Executed by:
| 60 | ||||||||||||||||||||||||||||||||||||||||||
| 1956 | if (rhash !=
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1957 | ((void *)0)
| 3-60 | ||||||||||||||||||||||||||||||||||||||||||
| 1958 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1959 | * executed 60 times by 1 test: rhash = (unsigned char)((shsigalgs->sigalg >> 8) & 0xff);*rhash = (unsigned char)((shsigalgs->sigalg >> 8) & 0xff);Executed by:
executed 60 times by 1 test: *rhash = (unsigned char)((shsigalgs->sigalg >> 8) & 0xff);Executed by:
| 60 | ||||||||||||||||||||||||||||||||||||||||||
| 1960 | return executed 63 times by 1 test: (int)s->cert->shared_sigalgslen;return (int)s->cert->shared_sigalgslen;Executed by:
executed 63 times by 1 test: return (int)s->cert->shared_sigalgslen;Executed by:
| 63 | ||||||||||||||||||||||||||||||||||||||||||
| 1961 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1963 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1964 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1965 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1966 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1967 | size_t sigalgcnt; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1968 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1969 | uint16_t sigalgs[((sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0])) * 2)]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1970 | } sig_cb_st; | - | ||||||||||||||||||||||||||||||||||||||||||
| 1971 | - | |||||||||||||||||||||||||||||||||||||||||||
| 1972 | static void get_sigorhash(int *psig, int *phash, const char *str) | - | ||||||||||||||||||||||||||||||||||||||||||
| 1973 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 1974 | if ( | - | ||||||||||||||||||||||||||||||||||||||||||
| 1975 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1976 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1977 | ) && __builtin_constant_p (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1978 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1979 | ) && (__s1_len = __builtin_strlen (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1980 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1981 | ), __s2_len = __builtin_strlen (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1982 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1983 | ), (!((size_t)(const void *)((
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1984 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1985 | ) + 1) - (size_t)(const void *)(
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1986 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1987 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1988 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1989 | ) + 1) - (size_t)(const void *)(
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1990 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1991 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1992 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1993 | ,
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1994 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1995 | ) : (__builtin_constant_p (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1996 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1997 | ) && ((size_t)(const void *)((
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1998 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 1999 | ) + 1) - (size_t)(const void *)(
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2000 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2001 | ) == 1) && (__s1_len = __builtin_strlen (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2002 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2003 | ), __s1_len < 4) ? (__builtin_constant_p (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2004 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2005 | ) && ((size_t)(const void *)((
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2006 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2007 | ) + 1) - (size_t)(const void *)(
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2008 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2009 | ) == 1) ? __builtin_strcmp (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2010 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2011 | ,
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2012 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2013 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2014 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2015 | ); int __result = (((const unsigned char *) (const char *) (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2016 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2017 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2018 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2019 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2020 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2021 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);
| 0-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2022 | str
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]); | 0-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2023 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2024 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2025 | ) && ((size_t)(const void *)((
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2026 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2027 | ) + 1) - (size_t)(const void *)(
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2028 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2029 | ) == 1) && (__s2_len = __builtin_strlen (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2030 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2031 | ), __s2_len < 4) ? (__builtin_constant_p (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2032 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2033 | ) && ((size_t)(const void *)((
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2034 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2035 | ) + 1) - (size_t)(const void *)(
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2036 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2037 | ) == 1) ? __builtin_strcmp (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2038 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2039 | ,
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2040 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2041 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2042 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2043 | ); int __result = (((const unsigned char *) (const char *) (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2044 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2045 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-128 | ||||||||||||||||||||||||||||||||||||||||||
| 2046 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2047 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2048 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2049 | ))[2] - __s2[2]); if (__s2_len > 2
executed 20 times by 1 test: __result = (((const unsigned char *) (const char *) ( "RSA" ))[3] - __s2[3]);Executed by:
| 0-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2050 | "RSA"
executed 20 times by 1 test: __result = (((const unsigned char *) (const char *) ( "RSA" ))[3] - __s2[3]);Executed by:
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2051 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2052 | str
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2053 | ,
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2054 | "RSA"
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2055 | )))); })
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2056 | == 0
| 15-113 | ||||||||||||||||||||||||||||||||||||||||||
| 2057 | *psig = 6; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2058 | } executed 15 times by 1 test: else if (end of blockExecuted by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||
| 2059 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2060 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2061 | ) && __builtin_constant_p (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2062 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2063 | ) && (__s1_len = __builtin_strlen (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2064 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2065 | ), __s2_len = __builtin_strlen (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2066 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2067 | ), (!((size_t)(const void *)((
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2068 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2069 | ) + 1) - (size_t)(const void *)(
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2070 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2071 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2072 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2073 | ) + 1) - (size_t)(const void *)(
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2074 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2075 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2076 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2077 | ,
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2078 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2079 | ) : (__builtin_constant_p (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2080 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2081 | ) && ((size_t)(const void *)((
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2082 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2083 | ) + 1) - (size_t)(const void *)(
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2084 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2085 | ) == 1) && (__s1_len = __builtin_strlen (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2086 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2087 | ), __s1_len < 4) ? (__builtin_constant_p (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2088 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2089 | ) && ((size_t)(const void *)((
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2090 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2091 | ) + 1) - (size_t)(const void *)(
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2092 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2093 | ) == 1) ? __builtin_strcmp (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2094 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2095 | ,
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2096 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2097 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2098 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2099 | ); int __result = (((const unsigned char *) (const char *) (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2100 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2101 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2102 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2103 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2104 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2105 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2106 | str
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]); | 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2107 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2108 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2109 | ) && ((size_t)(const void *)((
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2110 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2111 | ) + 1) - (size_t)(const void *)(
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2112 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2113 | ) == 1) && (__s2_len = __builtin_strlen (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2114 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2115 | ), __s2_len < 4) ? (__builtin_constant_p (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2116 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2117 | ) && ((size_t)(const void *)((
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2118 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2119 | ) + 1) - (size_t)(const void *)(
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2120 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2121 | ) == 1) ? __builtin_strcmp (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2122 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2123 | ,
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2124 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2125 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2126 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2127 | ); int __result = (((const unsigned char *) (const char *) (
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2128 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2129 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2130 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2131 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2132 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2133 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "RSA-PSS" ))[3] - __s2[3]);
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2134 | "RSA-PSS"
never executed: __result = (((const unsigned char *) (const char *) ( "RSA-PSS" ))[3] - __s2[3]); | 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2135 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( "RSA-PSS" ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : __builtin_strcmp (end of block
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2136 | str
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2137 | ,
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2138 | "RSA-PSS"
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2139 | )))); })
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2140 | == 0
| 5-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2141 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2142 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2143 | ) && __builtin_constant_p (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2144 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2145 | ) && (__s1_len = __builtin_strlen (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2146 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2147 | ), __s2_len = __builtin_strlen (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2148 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2149 | ), (!((size_t)(const void *)((
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2150 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2151 | ) + 1) - (size_t)(const void *)(
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2152 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2153 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2154 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2155 | ) + 1) - (size_t)(const void *)(
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2156 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2157 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2158 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2159 | ,
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2160 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2161 | ) : (__builtin_constant_p (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2162 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2163 | ) && ((size_t)(const void *)((
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2164 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2165 | ) + 1) - (size_t)(const void *)(
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2166 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2167 | ) == 1) && (__s1_len = __builtin_strlen (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2168 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2169 | ), __s1_len < 4) ? (__builtin_constant_p (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2170 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2171 | ) && ((size_t)(const void *)((
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2172 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2173 | ) + 1) - (size_t)(const void *)(
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2174 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2175 | ) == 1) ? __builtin_strcmp (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2176 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2177 | ,
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2178 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2179 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2180 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2181 | ); int __result = (((const unsigned char *) (const char *) (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2182 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2183 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2184 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2185 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2186 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2187 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);
| 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2188 | str
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]); | 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2189 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2190 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2191 | ) && ((size_t)(const void *)((
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2192 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2193 | ) + 1) - (size_t)(const void *)(
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2194 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2195 | ) == 1) && (__s2_len = __builtin_strlen (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2196 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2197 | ), __s2_len < 4) ? (__builtin_constant_p (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2198 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2199 | ) && ((size_t)(const void *)((
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2200 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2201 | ) + 1) - (size_t)(const void *)(
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2202 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2203 | ) == 1) ? __builtin_strcmp (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2204 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2205 | ,
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2206 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2207 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2208 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2209 | ); int __result = (((const unsigned char *) (const char *) (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2210 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2211 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-108 | ||||||||||||||||||||||||||||||||||||||||||
| 2212 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2213 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2214 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2215 | ))[2] - __s2[2]); if (__s2_len > 2
executed 8 times by 1 test: __result = (((const unsigned char *) (const char *) ( "PSS" ))[3] - __s2[3]);Executed by:
| 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2216 | "PSS"
executed 8 times by 1 test: __result = (((const unsigned char *) (const char *) ( "PSS" ))[3] - __s2[3]);Executed by:
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2217 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2218 | str
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2219 | ,
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2220 | "PSS"
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2221 | )))); })
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2222 | == 0
| 8-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2223 | *psig = 912; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2224 | } executed 13 times by 1 test: else if (end of blockExecuted by:
| 13 | ||||||||||||||||||||||||||||||||||||||||||
| 2225 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2226 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2227 | ) && __builtin_constant_p (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2228 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2229 | ) && (__s1_len = __builtin_strlen (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2230 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2231 | ), __s2_len = __builtin_strlen (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2232 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2233 | ), (!((size_t)(const void *)((
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2234 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2235 | ) + 1) - (size_t)(const void *)(
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2236 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2237 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2238 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2239 | ) + 1) - (size_t)(const void *)(
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2240 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2241 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2242 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2243 | ,
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2244 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2245 | ) : (__builtin_constant_p (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2246 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2247 | ) && ((size_t)(const void *)((
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2248 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2249 | ) + 1) - (size_t)(const void *)(
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2250 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2251 | ) == 1) && (__s1_len = __builtin_strlen (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2252 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2253 | ), __s1_len < 4) ? (__builtin_constant_p (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2254 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2255 | ) && ((size_t)(const void *)((
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2256 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2257 | ) + 1) - (size_t)(const void *)(
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2258 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2259 | ) == 1) ? __builtin_strcmp (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2260 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2261 | ,
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2262 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2263 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2264 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2265 | ); int __result = (((const unsigned char *) (const char *) (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2266 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2267 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2268 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2269 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2270 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2271 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);
| 0-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2272 | str
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]); | 0-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2273 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2274 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2275 | ) && ((size_t)(const void *)((
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2276 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2277 | ) + 1) - (size_t)(const void *)(
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2278 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2279 | ) == 1) && (__s2_len = __builtin_strlen (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2280 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2281 | ), __s2_len < 4) ? (__builtin_constant_p (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2282 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2283 | ) && ((size_t)(const void *)((
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2284 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2285 | ) + 1) - (size_t)(const void *)(
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2286 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2287 | ) == 1) ? __builtin_strcmp (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2288 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2289 | ,
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2290 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2291 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2292 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2293 | ); int __result = (((const unsigned char *) (const char *) (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2294 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2295 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-100 | ||||||||||||||||||||||||||||||||||||||||||
| 2296 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2297 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2298 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2299 | ))[2] - __s2[2]); if (__s2_len > 2
executed 5 times by 1 test: __result = (((const unsigned char *) (const char *) ( "DSA" ))[3] - __s2[3]);Executed by:
| 0-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2300 | "DSA"
executed 5 times by 1 test: __result = (((const unsigned char *) (const char *) ( "DSA" ))[3] - __s2[3]);Executed by:
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2301 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2302 | str
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2303 | ,
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2304 | "DSA"
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2305 | )))); })
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2306 | == 0
| 5-95 | ||||||||||||||||||||||||||||||||||||||||||
| 2307 | *psig = 116; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2308 | } executed 5 times by 1 test: else if (end of blockExecuted by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||
| 2309 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2310 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2311 | ) && __builtin_constant_p (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2312 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2313 | ) && (__s1_len = __builtin_strlen (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2314 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2315 | ), __s2_len = __builtin_strlen (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2316 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2317 | ), (!((size_t)(const void *)((
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2318 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2319 | ) + 1) - (size_t)(const void *)(
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2320 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2321 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2322 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2323 | ) + 1) - (size_t)(const void *)(
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2324 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2325 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2326 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2327 | ,
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2328 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2329 | ) : (__builtin_constant_p (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2330 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2331 | ) && ((size_t)(const void *)((
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2332 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2333 | ) + 1) - (size_t)(const void *)(
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2334 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2335 | ) == 1) && (__s1_len = __builtin_strlen (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2336 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2337 | ), __s1_len < 4) ? (__builtin_constant_p (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2338 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2339 | ) && ((size_t)(const void *)((
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2340 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2341 | ) + 1) - (size_t)(const void *)(
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2342 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2343 | ) == 1) ? __builtin_strcmp (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2344 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2345 | ,
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2346 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2347 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2348 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2349 | ); int __result = (((const unsigned char *) (const char *) (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2350 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2351 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2352 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2353 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2354 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2355 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2356 | str
never executed: __result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]); | 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2357 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( str ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2358 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2359 | ) && ((size_t)(const void *)((
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2360 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2361 | ) + 1) - (size_t)(const void *)(
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2362 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2363 | ) == 1) && (__s2_len = __builtin_strlen (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2364 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2365 | ), __s2_len < 4) ? (__builtin_constant_p (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2366 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2367 | ) && ((size_t)(const void *)((
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2368 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2369 | ) + 1) - (size_t)(const void *)(
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2370 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2371 | ) == 1) ? __builtin_strcmp (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2372 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2373 | ,
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2374 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2375 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2376 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2377 | ); int __result = (((const unsigned char *) (const char *) (
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2378 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2379 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2380 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2381 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2382 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2383 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "ECDSA" ))[3] - __s2[3]);
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2384 | "ECDSA"
never executed: __result = (((const unsigned char *) (const char *) ( "ECDSA" ))[3] - __s2[3]); | 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2385 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( "ECDSA" ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : __builtin_strcmp (end of block
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2386 | str
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2387 | ,
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2388 | "ECDSA"
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2389 | )))); })
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2390 | == 0
| 31-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2391 | *psig = 408; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2392 | } executed 31 times by 1 test: else {end of blockExecuted by:
| 31 | ||||||||||||||||||||||||||||||||||||||||||
| 2393 | *phash = OBJ_sn2nid(str); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2394 | if (*
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2395 | * never executed: phash = OBJ_ln2nid(str);*phash = OBJ_ln2nid(str);never executed: *phash = OBJ_ln2nid(str); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2396 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||||||||||||||||||||
| 2397 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2398 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2399 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2400 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2401 | static int sig_cb(const char *elem, int len, void *arg) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2402 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2403 | sig_cb_st *sarg = arg; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2404 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2405 | const SIGALG_LOOKUP *s; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2406 | char etmp[40], *p; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2407 | int sig_alg = 0, hash_alg = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2408 | if (elem ==
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2409 | ((void *)0)
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2410 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2411 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2412 | if (sarg->sigalgcnt == ((sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0])) * 2)
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2413 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2414 | if (len > (int)(sizeof(etmp) - 1)
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2415 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2416 | memcpy(etmp, elem, len); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2417 | etmp[len] = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2418 | p = | - | ||||||||||||||||||||||||||||||||||||||||||
| 2419 | (__extension__ (__builtin_constant_p (
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2420 | '+'
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2421 | )
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2422 | etmp
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2423 | )
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2424 | '+'
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2425 | ) == '\0'
| 0-82 | ||||||||||||||||||||||||||||||||||||||||||
| 2426 | etmp | - | ||||||||||||||||||||||||||||||||||||||||||
| 2427 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2428 | '+' | - | ||||||||||||||||||||||||||||||||||||||||||
| 2429 | ) : __builtin_strchr ( | - | ||||||||||||||||||||||||||||||||||||||||||
| 2430 | etmp | - | ||||||||||||||||||||||||||||||||||||||||||
| 2431 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2432 | '+' | - | ||||||||||||||||||||||||||||||||||||||||||
| 2433 | ))) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2434 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2435 | if (p ==
| 18-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2436 | ((void *)0)
| 18-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2437 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2438 | for (i = 0, s = sigalg_lookup_tbl; i < (sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0]))
| 8-259 | ||||||||||||||||||||||||||||||||||||||||||
| 2439 | i++, s++) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2440 | if (s->name !=
| 82-177 | ||||||||||||||||||||||||||||||||||||||||||
| 2441 | ((void *)0)
| 82-177 | ||||||||||||||||||||||||||||||||||||||||||
| 2442 | && | - | ||||||||||||||||||||||||||||||||||||||||||
| 2443 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2444 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2445 | ) && __builtin_constant_p (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2446 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2447 | ) && (__s1_len = __builtin_strlen (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2448 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2449 | ), __s2_len = __builtin_strlen (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2450 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2451 | ), (!((size_t)(const void *)((
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2452 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2453 | ) + 1) - (size_t)(const void *)(
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2454 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2455 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2456 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2457 | ) + 1) - (size_t)(const void *)(
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2458 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2459 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2460 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2461 | ,
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2462 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2463 | ) : (__builtin_constant_p (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2464 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2465 | ) && ((size_t)(const void *)((
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2466 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2467 | ) + 1) - (size_t)(const void *)(
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2468 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2469 | ) == 1) && (__s1_len = __builtin_strlen (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2470 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2471 | ), __s1_len < 4) ? (__builtin_constant_p (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2472 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2473 | ) && ((size_t)(const void *)((
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2474 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2475 | ) + 1) - (size_t)(const void *)(
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2476 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2477 | ) == 1) ? __builtin_strcmp (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2478 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2479 | ,
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2480 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2481 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2482 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2483 | ); int __result = (((const unsigned char *) (const char *) (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2484 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2485 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2486 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2487 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2488 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2489 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( etmp ))[3] - __s2[3]);
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2490 | etmp
never executed: __result = (((const unsigned char *) (const char *) ( etmp ))[3] - __s2[3]); | 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2491 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( etmp ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2492 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2493 | ) && ((size_t)(const void *)((
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2494 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2495 | ) + 1) - (size_t)(const void *)(
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2496 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2497 | ) == 1) && (__s2_len = __builtin_strlen (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2498 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2499 | ), __s2_len < 4) ? (__builtin_constant_p (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2500 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2501 | ) && ((size_t)(const void *)((
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2502 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2503 | ) + 1) - (size_t)(const void *)(
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2504 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2505 | ) == 1) ? __builtin_strcmp (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2506 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2507 | ,
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2508 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2509 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2510 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2511 | ); int __result = (((const unsigned char *) (const char *) (
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2512 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2513 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2514 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2515 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2516 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2517 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( s->name ))[3] - __s2[3]);
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2518 | s->name
never executed: __result = (((const unsigned char *) (const char *) ( s->name ))[3] - __s2[3]); | 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2519 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( s->name ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : __builtin_strcmp (end of block
| 0-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2520 | etmp
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2521 | ,
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2522 | s->name
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2523 | )))); })
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2524 | == 0
| 10-167 | ||||||||||||||||||||||||||||||||||||||||||
| 2525 | sarg->sigalgs[sarg->sigalgcnt++] = s->sigalg; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2526 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||
| 2527 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2528 | } executed 249 times by 1 test: end of blockExecuted by:
| 249 | ||||||||||||||||||||||||||||||||||||||||||
| 2529 | if (i == (sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0]))
| 8-10 | ||||||||||||||||||||||||||||||||||||||||||
| 2530 | return executed 8 times by 1 test: 0;return 0;Executed by:
executed 8 times by 1 test: return 0;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 2531 | } executed 10 times by 1 test: else {end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||
| 2532 | *p = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2533 | p++; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2534 | if (*
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2535 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2536 | get_sigorhash(&sig_alg, &hash_alg, etmp); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2537 | get_sigorhash(&sig_alg, &hash_alg, p); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2538 | if (sig_alg == 0
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2539 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2540 | for (i = 0, s = sigalg_lookup_tbl; i < (sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0]))
| 0-483 | ||||||||||||||||||||||||||||||||||||||||||
| 2541 | i++, s++) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2542 | if (s->hash == hash_alg
| 64-345 | ||||||||||||||||||||||||||||||||||||||||||
| 2543 | sarg->sigalgs[sarg->sigalgcnt++] = s->sigalg; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2544 | break; executed 64 times by 1 test: break;Executed by:
| 64 | ||||||||||||||||||||||||||||||||||||||||||
| 2545 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2546 | } executed 419 times by 1 test: end of blockExecuted by:
| 419 | ||||||||||||||||||||||||||||||||||||||||||
| 2547 | if (i == (sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0]))
| 0-64 | ||||||||||||||||||||||||||||||||||||||||||
| 2548 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2549 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||||||||||||||||||||
| 2550 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2551 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2552 | for (i = 0; i < sarg->sigalgcnt - 1
| 22-74 | ||||||||||||||||||||||||||||||||||||||||||
| 2553 | if (sarg->sigalgs[i] == sarg->sigalgs[sarg->sigalgcnt - 1]
| 0-22 | ||||||||||||||||||||||||||||||||||||||||||
| 2554 | sarg->sigalgcnt--; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2555 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2556 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2557 | } executed 22 times by 1 test: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||||||||||||||||||||
| 2558 | return executed 74 times by 1 test: 1;return 1;Executed by:
executed 74 times by 1 test: return 1;Executed by:
| 74 | ||||||||||||||||||||||||||||||||||||||||||
| 2559 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2560 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2561 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2562 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2563 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2564 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2565 | int tls1_set_sigalgs_list(CERT *c, const char *str, int client) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2566 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2567 | sig_cb_st sig; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2568 | sig.sigalgcnt = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2569 | if (!CONF_parse_list(str, ':', 1, sig_cb, &sig)
| 8-52 | ||||||||||||||||||||||||||||||||||||||||||
| 2570 | return executed 8 times by 1 test: 0;return 0;Executed by:
executed 8 times by 1 test: return 0;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 2571 | if (c ==
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||
| 2572 | ((void *)0)
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||
| 2573 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2574 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2575 | return executed 52 times by 1 test: tls1_set_raw_sigalgs(c, sig.sigalgs, sig.sigalgcnt, client);return tls1_set_raw_sigalgs(c, sig.sigalgs, sig.sigalgcnt, client);Executed by:
executed 52 times by 1 test: return tls1_set_raw_sigalgs(c, sig.sigalgs, sig.sigalgcnt, client);Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||
| 2576 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2577 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2578 | int tls1_set_raw_sigalgs(CERT *c, const uint16_t *psigs, size_t salglen, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2579 | int client) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2580 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2581 | uint16_t *sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2582 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2583 | if ((
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||
| 2584 | ((void *)0)
| 0-52 | ||||||||||||||||||||||||||||||||||||||||||
| 2585 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2586 | ERR_put_error(20,(630),((1|64)),__FILE__,1966); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2587 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2588 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2589 | memcpy(sigalgs, psigs, salglen * sizeof(*sigalgs)); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2590 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2591 | if (client
| 11-41 | ||||||||||||||||||||||||||||||||||||||||||
| 2592 | CRYPTO_free(c->client_sigalgs, __FILE__, 1972); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2593 | c->client_sigalgs = sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2594 | c->client_sigalgslen = salglen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2595 | } executed 11 times by 1 test: else {end of blockExecuted by:
| 11 | ||||||||||||||||||||||||||||||||||||||||||
| 2596 | CRYPTO_free(c->conf_sigalgs, __FILE__, 1976); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2597 | c->conf_sigalgs = sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2598 | c->conf_sigalgslen = salglen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2599 | } executed 41 times by 1 test: end of blockExecuted by:
| 41 | ||||||||||||||||||||||||||||||||||||||||||
| 2600 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2601 | return executed 52 times by 1 test: 1;return 1;Executed by:
executed 52 times by 1 test: return 1;Executed by:
| 52 | ||||||||||||||||||||||||||||||||||||||||||
| 2602 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2603 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2604 | int tls1_set_sigalgs(CERT *c, const int *psig_nids, size_t salglen, int client) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2605 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2606 | uint16_t *sigalgs, *sptr; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2607 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2608 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2609 | if (salglen & 1
| 4-10 | ||||||||||||||||||||||||||||||||||||||||||
| 2610 | return executed 4 times by 1 test: 0;return 0;Executed by:
executed 4 times by 1 test: return 0;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 2611 | if ((
| 0-10 | ||||||||||||||||||||||||||||||||||||||||||
| 2612 | ((void *)0)
| 0-10 | ||||||||||||||||||||||||||||||||||||||||||
| 2613 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2614 | ERR_put_error(20,(632),((1|64)),__FILE__,1992); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2615 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2616 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2617 | for (i = 0, sptr = sigalgs; i < salglen
| 6-12 | ||||||||||||||||||||||||||||||||||||||||||
| 2618 | size_t j; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2619 | const SIGALG_LOOKUP *curr; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2620 | int md_id = *psig_nids++; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2621 | int sig_id = *psig_nids++; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2622 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2623 | for (j = 0, curr = sigalg_lookup_tbl; j < (sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0]))
| 4-172 | ||||||||||||||||||||||||||||||||||||||||||
| 2624 | j++, curr++) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2625 | if (curr->hash == md_id
| 8-138 | ||||||||||||||||||||||||||||||||||||||||||
| 2626 | *sptr++ = curr->sigalg; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2627 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 2628 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2629 | } executed 164 times by 1 test: end of blockExecuted by:
| 164 | ||||||||||||||||||||||||||||||||||||||||||
| 2630 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2631 | if (j == (sizeof(sigalg_lookup_tbl)/sizeof((sigalg_lookup_tbl)[0]))
| 4-8 | ||||||||||||||||||||||||||||||||||||||||||
| 2632 | goto executed 4 times by 1 test: err;goto err;Executed by:
executed 4 times by 1 test: goto err;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 2633 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 2634 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2635 | if (client
| 0-6 | ||||||||||||||||||||||||||||||||||||||||||
| 2636 | CRYPTO_free(c->client_sigalgs, __FILE__, 2014); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2637 | c->client_sigalgs = sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2638 | c->client_sigalgslen = salglen / 2; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2639 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2640 | CRYPTO_free(c->conf_sigalgs, __FILE__, 2018); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2641 | c->conf_sigalgs = sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2642 | c->conf_sigalgslen = salglen / 2; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2643 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||
| 2644 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2645 | return executed 6 times by 1 test: 1;return 1;Executed by:
executed 6 times by 1 test: return 1;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||||||||
| 2646 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2647 | err: | - | ||||||||||||||||||||||||||||||||||||||||||
| 2648 | CRYPTO_free(sigalgs, __FILE__, 2026); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2649 | return executed 4 times by 1 test: 0;return 0;Executed by:
executed 4 times by 1 test: return 0;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||
| 2650 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2651 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2652 | static int tls1_check_sig_alg(CERT *c, X509 *x, int default_nid) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2653 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2654 | int sig_nid; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2655 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2656 | if (default_nid == -1
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2657 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2658 | sig_nid = X509_get_signature_nid(x); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2659 | if (default_nid
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2660 | return never executed: sig_nid == default_nidreturn sig_nid == default_nid ? 1 : 0;
never executed: return sig_nid == default_nid ? 1 : 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2661 | for (i = 0; i < c->shared_sigalgslen
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2662 | if (sig_nid == c->shared_sigalgs[i]->sigandhash
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2663 | return executed 2 times by 1 test: 1;return 1;Executed by:
executed 2 times by 1 test: return 1;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2664 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2665 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2666 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2667 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2668 | static int ssl_check_ca_name(struct stack_st_X509_NAME *names, X509 *x) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2669 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2670 | X509_NAME *nm; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2671 | int i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2672 | nm = X509_get_issuer_name(x); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2673 | for (i = 0; i < sk_X509_NAME_num(names)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2674 | if (!X509_NAME_cmp(nm, sk_X509_NAME_value(names, i))
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2675 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2676 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2677 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2678 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2679 | int tls1_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, struct stack_st_X509 *chain, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2680 | int idx) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2681 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2682 | int i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2683 | int rv = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2684 | int check_flags = 0, strict_mode; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2685 | CERT_PKEY *cpk = | - | ||||||||||||||||||||||||||||||||||||||||||
| 2686 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2687 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2688 | CERT *c = s->cert; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2689 | uint32_t *pvalid; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2690 | unsigned int suiteb_flags = (s->cert->cert_flags & 0x30000); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2691 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2692 | if (idx != -1
| 0-14598 | ||||||||||||||||||||||||||||||||||||||||||
| 2693 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2694 | if (idx == -2
| 0-14598 | ||||||||||||||||||||||||||||||||||||||||||
| 2695 | cpk = c->key; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2696 | idx = (int)(cpk - c->pkeys); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2697 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2698 | cpk = c->pkeys + idx; executed 14598 times by 1 test: cpk = c->pkeys + idx;Executed by:
| 14598 | ||||||||||||||||||||||||||||||||||||||||||
| 2699 | pvalid = s->s3->tmp.valid_flags + idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2700 | x = cpk->x509; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2701 | pk = cpk->privatekey; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2702 | chain = cpk->chain; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2703 | strict_mode = c->cert_flags & (0x30000|0x00000001U); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2704 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2705 | if (!x
| 0-11614 | ||||||||||||||||||||||||||||||||||||||||||
| 2706 | goto executed 11614 times by 1 test: end;goto end;Executed by:
executed 11614 times by 1 test: goto end;Executed by:
| 11614 | ||||||||||||||||||||||||||||||||||||||||||
| 2707 | } executed 2984 times by 1 test: else {end of blockExecuted by:
| 2984 | ||||||||||||||||||||||||||||||||||||||||||
| 2708 | size_t certidx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2709 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2710 | if (!x
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2711 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2712 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2713 | if (ssl_cert_lookup_by_pkey(pk, &certidx) ==
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2714 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2715 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2716 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2717 | idx = certidx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2718 | pvalid = s->s3->tmp.valid_flags + idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2719 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2720 | if (c->cert_flags & (0x30000|0x00000001U)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2721 | check_flags = ((0x10|0x40)|0x20|0x80 | 0x200|0x400); never executed: check_flags = ((0x10|0x40)|0x20|0x80 | 0x200|0x400); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2722 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 2723 | check_flags = (0x10|0x40); never executed: check_flags = (0x10|0x40); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2724 | strict_mode = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2725 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2726 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2727 | if (suiteb_flags
| 4-2980 | ||||||||||||||||||||||||||||||||||||||||||
| 2728 | int ok; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2729 | if (check_flags
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||
| 2730 | check_flags |= 0x800; never executed: check_flags |= 0x800; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2731 | ok = X509_chain_check_suiteb( | - | ||||||||||||||||||||||||||||||||||||||||||
| 2732 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2733 | , x, chain, suiteb_flags); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2734 | if (ok == 0
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2735 | rv |= 0x800; executed 2 times by 1 test: rv |= 0x800;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2736 | else if (!check_flags
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2737 | goto executed 2 times by 1 test: end;goto end;Executed by:
executed 2 times by 1 test: goto end;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2738 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2739 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2740 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2741 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2742 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2743 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2744 | if (((
| 2-2839 | ||||||||||||||||||||||||||||||||||||||||||
| 2745 | int default_nid; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2746 | int rsign = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2747 | if (s->s3->tmp.peer_cert_sigalgs !=
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2748 | ((void *)0)
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2749 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2750 | || s->s3->tmp.peer_sigalgs !=
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2751 | ((void *)0)
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2752 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2753 | default_nid = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2754 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2755 | } executed 2 times by 1 test: else {end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2756 | switch (idx) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2757 | case never executed: 0:case 0:never executed: case 0: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2758 | rsign = 6; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2759 | default_nid = 65; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2760 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2761 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2762 | case never executed: 2:case 2:never executed: case 2: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2763 | rsign = 116; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2764 | default_nid = 113; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2765 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2766 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2767 | case never executed: 3:case 3:never executed: case 3: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2768 | rsign = 408; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2769 | default_nid = 416; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2770 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2771 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2772 | case never executed: 4:case 4:never executed: case 4: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2773 | rsign = 811; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2774 | default_nid = 807; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2775 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2776 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2777 | case never executed: 5:case 5:never executed: case 5: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2778 | rsign = 979; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2779 | default_nid = 985; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2780 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2781 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2782 | case never executed: 6:case 6:never executed: case 6: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2783 | rsign = 980; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2784 | default_nid = 986; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2785 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2786 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2787 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2788 | default_nid = -1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2789 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2790 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2791 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2792 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2793 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2794 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2795 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2796 | if (default_nid > 0
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2797 | size_t j; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2798 | const uint16_t *p = c->conf_sigalgs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2799 | for (j = 0; j < c->conf_sigalgslen
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2800 | const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(*p); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2801 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2802 | if (lu !=
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2803 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2804 | && lu->hash == 64
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2805 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2806 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2807 | if (j == c->conf_sigalgslen
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2808 | if (check_flags
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2809 | goto never executed: skip_sigs;goto skip_sigs;never executed: goto skip_sigs; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2810 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 2811 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2812 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2813 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2814 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2815 | if (!tls1_check_sig_alg(c, x, default_nid)
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2816 | if (!check_flags
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2817 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2818 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2819 | rv |= 0x10; executed 2 times by 1 test: rv |= 0x10;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2820 | rv |= 0x20; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2821 | for (i = 0; i < sk_X509_num(chain)
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2822 | if (!tls1_check_sig_alg(c, sk_X509_value(chain, i), default_nid)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2823 | if (check_flags
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2824 | rv &= ~0x20; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2825 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2826 | } else | - | ||||||||||||||||||||||||||||||||||||||||||
| 2827 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2828 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2829 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2830 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2831 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2832 | else if (check_flags
| 0-2980 | ||||||||||||||||||||||||||||||||||||||||||
| 2833 | rv |= 0x10 | 0x20; never executed: rv |= 0x10 | 0x20; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2834 | skip_sigs: code before this statement executed 2982 times by 1 test: skip_sigs:Executed by:
| 2982 | ||||||||||||||||||||||||||||||||||||||||||
| 2835 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2836 | if (tls1_check_cert_param(s, x, 1)
| 163-2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2837 | rv |= 0x40; executed 2819 times by 1 test: rv |= 0x40;Executed by:
| 2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2838 | else if (!check_flags
| 0-163 | ||||||||||||||||||||||||||||||||||||||||||
| 2839 | goto executed 163 times by 1 test: end;goto end;Executed by:
executed 163 times by 1 test: goto end;Executed by:
| 163 | ||||||||||||||||||||||||||||||||||||||||||
| 2840 | if (!s->server
| 0-2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2841 | rv |= 0x80; never executed: rv |= 0x80; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2842 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2843 | else if (strict_mode
| 2-2817 | ||||||||||||||||||||||||||||||||||||||||||
| 2844 | rv |= 0x80; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2845 | for (i = 0; i < sk_X509_num(chain)
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||
| 2846 | X509 *ca = sk_X509_value(chain, i); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2847 | if (!tls1_check_cert_param(s, ca, 0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2848 | if (check_flags
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2849 | rv &= ~0x80; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2850 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2851 | } else | - | ||||||||||||||||||||||||||||||||||||||||||
| 2852 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2853 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2854 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2855 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 2856 | if (!s->server
| 0-2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2857 | struct stack_st_X509_NAME *ca_dn; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2858 | int check_type = 0; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2859 | switch (EVP_PKEY_id(pk)) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2860 | case never executed: 6:case 6:never executed: case 6: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2861 | check_type = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2862 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2863 | case never executed: 116:case 116:never executed: case 116: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2864 | check_type = 2; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2865 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2866 | case never executed: 408:case 408:never executed: case 408: | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2867 | check_type = 64; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2868 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2869 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2870 | if (check_type
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2871 | const uint8_t *ctypes = s->s3->tmp.ctype; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2872 | size_t j; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2873 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2874 | for (j = 0; j < s->s3->tmp.ctype_len
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2875 | if (*
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2876 | rv |= 0x400; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2877 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2878 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2879 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2880 | if (!(rv & 0x400)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2881 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2882 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2883 | rv |= 0x400; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2884 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2885 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2886 | ca_dn = s->s3->tmp.peer_ca_names; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2887 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2888 | if (!sk_X509_NAME_num(ca_dn)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2889 | rv |= 0x200; never executed: rv |= 0x200; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2890 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2891 | if (!(rv & 0x200)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2892 | if (ssl_check_ca_name(ca_dn, x)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2893 | rv |= 0x200; never executed: rv |= 0x200; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2894 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2895 | if (!(rv & 0x200)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2896 | for (i = 0; i < sk_X509_num(chain)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2897 | X509 *xtmp = sk_X509_value(chain, i); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2898 | if (ssl_check_ca_name(ca_dn, xtmp)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2899 | rv |= 0x200; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2900 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2901 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2902 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2903 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2904 | if (!check_flags
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2905 | goto never executed: end;goto end;never executed: goto end; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2906 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 2907 | rv |= 0x200 | 0x400; executed 2819 times by 1 test: rv |= 0x200 | 0x400;Executed by:
| 2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2908 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2909 | if (!check_flags
| 0-2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2910 | rv |= 0x1; executed 2819 times by 1 test: rv |= 0x1;Executed by:
| 2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2911 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2912 | end: code before this statement executed 2819 times by 1 test: end:Executed by:
| 2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2913 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2914 | if (((
| 1530-13068 | ||||||||||||||||||||||||||||||||||||||||||
| 2915 | rv |= *pvalid & (0x100 | 0x2); executed 8964 times by 1 test: rv |= *pvalid & (0x100 | 0x2);Executed by:
| 8964 | ||||||||||||||||||||||||||||||||||||||||||
| 2916 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 2917 | rv |= 0x2 | 0x100; executed 5634 times by 1 test: rv |= 0x2 | 0x100;Executed by:
| 5634 | ||||||||||||||||||||||||||||||||||||||||||
| 2918 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2919 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2920 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2921 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2922 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2923 | if (!check_flags
| 0-14598 | ||||||||||||||||||||||||||||||||||||||||||
| 2924 | if (rv & 0x1
| 2819-11779 | ||||||||||||||||||||||||||||||||||||||||||
| 2925 | *pvalid = rv; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2926 | } executed 2819 times by 1 test: else {end of blockExecuted by:
| 2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2927 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2928 | *pvalid &= 0x100 | 0x2; | - | ||||||||||||||||||||||||||||||||||||||||||
| 2929 | return executed 11779 times by 1 test: 0;return 0;Executed by:
executed 11779 times by 1 test: return 0;Executed by:
| 11779 | ||||||||||||||||||||||||||||||||||||||||||
| 2930 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2931 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2932 | return executed 2819 times by 1 test: rv;return rv;Executed by:
executed 2819 times by 1 test: return rv;Executed by:
| 2819 | ||||||||||||||||||||||||||||||||||||||||||
| 2933 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 2934 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2935 | - | |||||||||||||||||||||||||||||||||||||||||||
| 2936 | void tls1_set_cert_validity(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2937 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 2938 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2939 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2940 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2941 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2942 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2943 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2944 | , 0); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2945 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2946 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2947 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2948 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2949 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2950 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2951 | , 1); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2952 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2953 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2954 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2955 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2956 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2957 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2958 | , 2); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2959 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2960 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2961 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2962 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2963 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2964 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2965 | , 3); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2966 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2967 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2968 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2969 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2970 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2971 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2972 | , 4); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2973 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2974 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2975 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2976 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2977 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2978 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2979 | , 5); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2980 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2981 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2982 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2983 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2984 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2985 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2986 | , 6); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2987 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2988 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2989 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2990 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2991 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2992 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2993 | , 7); | - | ||||||||||||||||||||||||||||||||||||||||||
| 2994 | tls1_check_chain(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 2995 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2996 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2997 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 2998 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 2999 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3000 | , 8); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3001 | } executed 1622 times by 1 test: end of blockExecuted by:
| 1622 | ||||||||||||||||||||||||||||||||||||||||||
| 3002 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3003 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3004 | int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, struct stack_st_X509 *chain) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3005 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3006 | return never executed: tls1_check_chain(s, x, pk, chain, -1);return tls1_check_chain(s, x, pk, chain, -1);never executed: return tls1_check_chain(s, x, pk, chain, -1); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3007 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3008 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3009 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3010 | DH *ssl_get_auto_dh(SSL *s) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3011 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3012 | int dh_secbits = 80; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3013 | if (s->cert->dh_tmp_auto == 2
| 0-9 | ||||||||||||||||||||||||||||||||||||||||||
| 3014 | return never executed: DH_get_1024_160();return DH_get_1024_160();never executed: return DH_get_1024_160(); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3015 | if (s->s3->tmp.new_cipher->algorithm_auth & (0x00000004U | 0x00000010U)
| 1-8 | ||||||||||||||||||||||||||||||||||||||||||
| 3016 | if (s->s3->tmp.new_cipher->strength_bits == 256
| 0-1 | ||||||||||||||||||||||||||||||||||||||||||
| 3017 | dh_secbits = 128; never executed: dh_secbits = 128; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3018 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 3019 | dh_secbits = 80; executed 1 time by 1 test: dh_secbits = 80;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 3020 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3021 | if (s->s3->tmp.cert ==
| 0-8 | ||||||||||||||||||||||||||||||||||||||||||
| 3022 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||||||||||||||||||||
| 3023 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3024 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3025 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3026 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3027 | dh_secbits = EVP_PKEY_security_bits(s->s3->tmp.cert->privatekey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3028 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 3029 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3030 | if (dh_secbits >= 128
| 0-9 | ||||||||||||||||||||||||||||||||||||||||||
| 3031 | DH *dhp = DH_new(); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3032 | BIGNUM *p, *g; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3033 | if (dhp ==
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3034 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3035 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3036 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3037 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3038 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3039 | g = BN_new(); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3040 | if (g ==
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3041 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3042 | || !BN_set_word(g, 2)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3043 | DH_free(dhp); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3044 | BN_free(g); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3045 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3046 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3047 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3048 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3049 | if (dh_secbits >= 192
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3050 | p = BN_get_rfc3526_prime_8192( never executed: p = BN_get_rfc3526_prime_8192( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3051 | ((void *)0) never executed: p = BN_get_rfc3526_prime_8192( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3052 | ); never executed: p = BN_get_rfc3526_prime_8192( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3053 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 3054 | p = BN_get_rfc3526_prime_3072( never executed: p = BN_get_rfc3526_prime_3072( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3055 | ((void *)0) never executed: p = BN_get_rfc3526_prime_3072( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3056 | ); never executed: p = BN_get_rfc3526_prime_3072( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3057 | if (p ==
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3058 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3059 | || !DH_set0_pqg(dhp, p,
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3060 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3061 | , g)
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3062 | DH_free(dhp); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3063 | BN_free(p); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3064 | BN_free(g); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3065 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3066 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3067 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3068 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3069 | return never executed: dhp;return dhp;never executed: return dhp; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3070 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3071 | if (dh_secbits >= 112
| 1-8 | ||||||||||||||||||||||||||||||||||||||||||
| 3072 | return executed 8 times by 1 test: DH_get_2048_224();return DH_get_2048_224();Executed by:
executed 8 times by 1 test: return DH_get_2048_224();Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 3073 | return executed 1 time by 1 test: DH_get_1024_160();return DH_get_1024_160();Executed by:
executed 1 time by 1 test: return DH_get_1024_160();Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 3074 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3075 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3076 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3077 | static int ssl_security_cert_key(SSL *s, SSL_CTX *ctx, X509 *x, int op) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3078 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3079 | int secbits = -1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3080 | EVP_PKEY *pkey = X509_get0_pubkey(x); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3081 | if (pkey
| 0-10371 | ||||||||||||||||||||||||||||||||||||||||||
| 3082 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3083 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3084 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3085 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3086 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3087 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3088 | secbits = EVP_PKEY_security_bits(pkey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3089 | } executed 10371 times by 1 test: end of blockExecuted by:
| 10371 | ||||||||||||||||||||||||||||||||||||||||||
| 3090 | if (s
| 2306-8065 | ||||||||||||||||||||||||||||||||||||||||||
| 3091 | return executed 2306 times by 1 test: ssl_security(s, op, secbits, 0, x);return ssl_security(s, op, secbits, 0, x);Executed by:
executed 2306 times by 1 test: return ssl_security(s, op, secbits, 0, x);Executed by:
| 2306 | ||||||||||||||||||||||||||||||||||||||||||
| 3092 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 3093 | return executed 8065 times by 1 test: ssl_ctx_security(ctx, op, secbits, 0, x);return ssl_ctx_security(ctx, op, secbits, 0, x);Executed by:
executed 8065 times by 1 test: return ssl_ctx_security(ctx, op, secbits, 0, x);Executed by:
| 8065 | ||||||||||||||||||||||||||||||||||||||||||
| 3094 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3095 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3096 | static int ssl_security_cert_sig(SSL *s, SSL_CTX *ctx, X509 *x, int op) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3097 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3098 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3099 | int secbits, nid, pknid; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3100 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3101 | if ((
| 7-10364 | ||||||||||||||||||||||||||||||||||||||||||
| 3102 | return executed 7 times by 1 test: 1;return 1;Executed by:
executed 7 times by 1 test: return 1;Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||
| 3103 | if (!X509_get_signature_info(x, &nid, &pknid, &secbits,
| 0-10364 | ||||||||||||||||||||||||||||||||||||||||||
| 3104 | ((void *)0)
| 0-10364 | ||||||||||||||||||||||||||||||||||||||||||
| 3105 | )
| 0-10364 | ||||||||||||||||||||||||||||||||||||||||||
| 3106 | secbits = -1; never executed: secbits = -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3107 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3108 | if (nid == 0
| 0-10364 | ||||||||||||||||||||||||||||||||||||||||||
| 3109 | nid = pknid; never executed: nid = pknid; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3110 | if (s
| 2299-8065 | ||||||||||||||||||||||||||||||||||||||||||
| 3111 | return executed 2299 times by 1 test: ssl_security(s, op, secbits, nid, x);return ssl_security(s, op, secbits, nid, x);Executed by:
executed 2299 times by 1 test: return ssl_security(s, op, secbits, nid, x);Executed by:
| 2299 | ||||||||||||||||||||||||||||||||||||||||||
| 3112 | else | - | ||||||||||||||||||||||||||||||||||||||||||
| 3113 | return executed 8065 times by 1 test: ssl_ctx_security(ctx, op, secbits, nid, x);return ssl_ctx_security(ctx, op, secbits, nid, x);Executed by:
executed 8065 times by 1 test: return ssl_ctx_security(ctx, op, secbits, nid, x);Executed by:
| 8065 | ||||||||||||||||||||||||||||||||||||||||||
| 3114 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3115 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3116 | int ssl_security_cert(SSL *s, SSL_CTX *ctx, X509 *x, int vfy, int is_ee) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3117 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3118 | if (vfy
| 0-10371 | ||||||||||||||||||||||||||||||||||||||||||
| 3119 | vfy = 0x1000; never executed: vfy = 0x1000; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3120 | if (is_ee
| 198-10173 | ||||||||||||||||||||||||||||||||||||||||||
| 3121 | if (!ssl_security_cert_key(s, ctx, x, (16 | (6 << 16)) | vfy)
| 0-10173 | ||||||||||||||||||||||||||||||||||||||||||
| 3122 | return never executed: 399;return 399;never executed: return 399; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3123 | } executed 10173 times by 1 test: else {end of blockExecuted by:
| 10173 | ||||||||||||||||||||||||||||||||||||||||||
| 3124 | if (!ssl_security_cert_key(s, ctx, x, (17 | (6 << 16)) | vfy)
| 0-198 | ||||||||||||||||||||||||||||||||||||||||||
| 3125 | return never executed: 397;return 397;never executed: return 397; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3126 | } executed 198 times by 1 test: end of blockExecuted by:
| 198 | ||||||||||||||||||||||||||||||||||||||||||
| 3127 | if (!ssl_security_cert_sig(s, ctx, x, (18 | (6 << 16)) | vfy)
| 0-10371 | ||||||||||||||||||||||||||||||||||||||||||
| 3128 | return never executed: 398;return 398;never executed: return 398; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3129 | return executed 10371 times by 1 test: 1;return 1;Executed by:
executed 10371 times by 1 test: return 1;Executed by:
| 10371 | ||||||||||||||||||||||||||||||||||||||||||
| 3130 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3131 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3132 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3133 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3134 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3135 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3136 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3137 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3138 | int ssl_security_cert_chain(SSL *s, struct stack_st_X509 *sk, X509 *x, int vfy) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3139 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3140 | int rv, start_idx, i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3141 | if (x ==
| 38-2104 | ||||||||||||||||||||||||||||||||||||||||||
| 3142 | ((void *)0)
| 38-2104 | ||||||||||||||||||||||||||||||||||||||||||
| 3143 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3144 | x = sk_X509_value(sk, 0); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3145 | start_idx = 1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3146 | } executed 2104 times by 1 test: elseend of blockExecuted by:
| 2104 | ||||||||||||||||||||||||||||||||||||||||||
| 3147 | start_idx = 0; executed 38 times by 1 test: start_idx = 0;Executed by:
| 38 | ||||||||||||||||||||||||||||||||||||||||||
| 3148 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3149 | rv = ssl_security_cert(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 3150 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3151 | , x, vfy, 1); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3152 | if (rv != 1
| 0-2142 | ||||||||||||||||||||||||||||||||||||||||||
| 3153 | return never executed: rv;return rv;never executed: return rv; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3154 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3155 | for (i = start_idx; i < sk_X509_num(sk)
| 162-2142 | ||||||||||||||||||||||||||||||||||||||||||
| 3156 | x = sk_X509_value(sk, i); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3157 | rv = ssl_security_cert(s, | - | ||||||||||||||||||||||||||||||||||||||||||
| 3158 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3159 | , x, vfy, 0); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3160 | if (rv != 1
| 0-162 | ||||||||||||||||||||||||||||||||||||||||||
| 3161 | return never executed: rv;return rv;never executed: return rv; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3162 | } executed 162 times by 1 test: end of blockExecuted by:
| 162 | ||||||||||||||||||||||||||||||||||||||||||
| 3163 | return executed 2142 times by 1 test: 1;return 1;Executed by:
executed 2142 times by 1 test: return 1;Executed by:
| 2142 | ||||||||||||||||||||||||||||||||||||||||||
| 3164 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3165 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3166 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3167 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3168 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3169 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3170 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3171 | static int tls12_get_cert_sigalg_idx(const SSL *s, const SIGALG_LOOKUP *lu) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3172 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3173 | int sig_idx = lu->sig_idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3174 | const SSL_CERT_LOOKUP *clu = ssl_cert_lookup_by_idx(sig_idx); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3175 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3176 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3177 | if (clu ==
| 0-7359 | ||||||||||||||||||||||||||||||||||||||||||
| 3178 | ((void *)0)
| 0-7359 | ||||||||||||||||||||||||||||||||||||||||||
| 3179 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3180 | || (
| 2761-4598 | ||||||||||||||||||||||||||||||||||||||||||
| 3181 | || (clu->nid == 912
| 1024-1737 | ||||||||||||||||||||||||||||||||||||||||||
| 3182 | && (
| 409-1328 | ||||||||||||||||||||||||||||||||||||||||||
| 3183 | return executed 5007 times by 1 test: -1;return -1;Executed by:
executed 5007 times by 1 test: return -1;Executed by:
| 5007 | ||||||||||||||||||||||||||||||||||||||||||
| 3184 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3185 | return executed 2352 times by 1 test: s->s3->tmp.valid_flags[sig_idx] & 0x1return s->s3->tmp.valid_flags[sig_idx] & 0x1 ? sig_idx : -1;Executed by:
executed 2352 times by 1 test: return s->s3->tmp.valid_flags[sig_idx] & 0x1 ? sig_idx : -1;Executed by:
| 1024-2352 | ||||||||||||||||||||||||||||||||||||||||||
| 3186 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3187 | static int has_usable_cert(SSL *s, const SIGALG_LOOKUP *sig, int idx) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3188 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3189 | const SIGALG_LOOKUP *lu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3190 | int mdnid, pknid; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3191 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3192 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3193 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3194 | if (idx == -1
| 1162-5204 | ||||||||||||||||||||||||||||||||||||||||||
| 3195 | idx = sig->sig_idx; executed 5204 times by 1 test: idx = sig->sig_idx;Executed by:
| 5204 | ||||||||||||||||||||||||||||||||||||||||||
| 3196 | if (!ssl_has_cert(s, idx)
| 2119-4247 | ||||||||||||||||||||||||||||||||||||||||||
| 3197 | return executed 4247 times by 1 test: 0;return 0;Executed by:
executed 4247 times by 1 test: return 0;Executed by:
| 4247 | ||||||||||||||||||||||||||||||||||||||||||
| 3198 | if (s->s3->tmp.peer_cert_sigalgs !=
| 229-1890 | ||||||||||||||||||||||||||||||||||||||||||
| 3199 | ((void *)0)
| 229-1890 | ||||||||||||||||||||||||||||||||||||||||||
| 3200 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3201 | for (i = 0; i < s->s3->tmp.peer_cert_sigalgslen
| 221-3861 | ||||||||||||||||||||||||||||||||||||||||||
| 3202 | lu = tls1_lookup_sigalg(s->s3->tmp.peer_cert_sigalgs[i]); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3203 | if (lu ==
| 1643-2218 | ||||||||||||||||||||||||||||||||||||||||||
| 3204 | ((void *)0)
| 1643-2218 | ||||||||||||||||||||||||||||||||||||||||||
| 3205 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3206 | || !X509_get_signature_info(s->cert->pkeys[idx].x509, &mdnid,
| 0-1643 | ||||||||||||||||||||||||||||||||||||||||||
| 3207 | &pknid,
| 0-1643 | ||||||||||||||||||||||||||||||||||||||||||
| 3208 | ((void *)0)
| 0-1643 | ||||||||||||||||||||||||||||||||||||||||||
| 3209 | ,
| 0-1643 | ||||||||||||||||||||||||||||||||||||||||||
| 3210 | ((void *)0)
| 0-1643 | ||||||||||||||||||||||||||||||||||||||||||
| 3211 | )
| 0-1643 | ||||||||||||||||||||||||||||||||||||||||||
| 3212 | continue; executed 2218 times by 1 test: continue;Executed by:
| 2218 | ||||||||||||||||||||||||||||||||||||||||||
| 3213 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3214 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3215 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3216 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3217 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3218 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3219 | if (mdnid == lu->hash
| 8-1345 | ||||||||||||||||||||||||||||||||||||||||||
| 3220 | return executed 8 times by 1 test: 1;return 1;Executed by:
executed 8 times by 1 test: return 1;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||||||||
| 3221 | } executed 1635 times by 1 test: end of blockExecuted by:
| 1635 | ||||||||||||||||||||||||||||||||||||||||||
| 3222 | return executed 221 times by 1 test: 0;return 0;Executed by:
executed 221 times by 1 test: return 0;Executed by:
| 221 | ||||||||||||||||||||||||||||||||||||||||||
| 3223 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3224 | return executed 1890 times by 1 test: 1;return 1;Executed by:
executed 1890 times by 1 test: return 1;Executed by:
| 1890 | ||||||||||||||||||||||||||||||||||||||||||
| 3225 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3226 | int tls_choose_sigalg(SSL *s, int fatalerrs) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3227 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3228 | const SIGALG_LOOKUP *lu = | - | ||||||||||||||||||||||||||||||||||||||||||
| 3229 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3230 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3231 | int sig_idx = -1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3232 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3233 | s->s3->tmp.cert = | - | ||||||||||||||||||||||||||||||||||||||||||
| 3234 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3235 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3236 | s->s3->tmp.sigalg = | - | ||||||||||||||||||||||||||||||||||||||||||
| 3237 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3238 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3239 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3240 | if ((!(s->method->ssl3_enc->enc_flags & 0x8)
| 0-2258 | ||||||||||||||||||||||||||||||||||||||||||
| 3241 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3242 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3243 | int curve = -1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3244 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3245 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3246 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3247 | for (i = 0; i < s->cert->shared_sigalgslen
| 47-5672 | ||||||||||||||||||||||||||||||||||||||||||
| 3248 | lu = s->cert->shared_sigalgs[i]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3249 | sig_idx = -1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3250 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3251 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3252 | if (lu->hash == 64
| 172-5500 | ||||||||||||||||||||||||||||||||||||||||||
| 3253 | || lu->hash == 675
| 49-5451 | ||||||||||||||||||||||||||||||||||||||||||
| 3254 | || lu->sig == 116
| 0-5451 | ||||||||||||||||||||||||||||||||||||||||||
| 3255 | || lu->sig == 6
| 247-5204 | ||||||||||||||||||||||||||||||||||||||||||
| 3256 | continue; executed 468 times by 1 test: continue;Executed by:
| 468 | ||||||||||||||||||||||||||||||||||||||||||
| 3257 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3258 | if (!tls1_lookup_md(lu,
| 0-5204 | ||||||||||||||||||||||||||||||||||||||||||
| 3259 | ((void *)0)
| 0-5204 | ||||||||||||||||||||||||||||||||||||||||||
| 3260 | )
| 0-5204 | ||||||||||||||||||||||||||||||||||||||||||
| 3261 | continue; executed 4250 times by 1 test: continue;Executed by:
| 4250 | ||||||||||||||||||||||||||||||||||||||||||
| 3262 | if (lu->sig == 408
| 340-614 | ||||||||||||||||||||||||||||||||||||||||||
| 3263 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3264 | if (curve == -1
| 65-275 | ||||||||||||||||||||||||||||||||||||||||||
| 3265 | EC_KEY *ec = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[3].privatekey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3266 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3267 | curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3268 | } executed 275 times by 1 test: end of blockExecuted by:
| 275 | ||||||||||||||||||||||||||||||||||||||||||
| 3269 | if (lu->curve != 0
| 0-340 | ||||||||||||||||||||||||||||||||||||||||||
| 3270 | continue; executed 96 times by 1 test: continue;Executed by:
| 96 | ||||||||||||||||||||||||||||||||||||||||||
| 3271 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3272 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3273 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3274 | } executed 244 times by 1 test: else if (lu->sig == 912end of blockExecuted by:
| 4-610 | ||||||||||||||||||||||||||||||||||||||||||
| 3275 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3276 | EVP_PKEY *pkey; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3277 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3278 | pkey = s->cert->pkeys[lu->sig_idx].privatekey; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3279 | if (!rsa_pss_check_min_key_size(EVP_PKEY_get0(pkey), lu)
| 0-610 | ||||||||||||||||||||||||||||||||||||||||||
| 3280 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3281 | } executed 610 times by 1 test: end of blockExecuted by:
| 610 | ||||||||||||||||||||||||||||||||||||||||||
| 3282 | break; executed 858 times by 1 test: break;Executed by:
| 858 | ||||||||||||||||||||||||||||||||||||||||||
| 3283 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3284 | if (i == s->cert->shared_sigalgslen
| 47-858 | ||||||||||||||||||||||||||||||||||||||||||
| 3285 | if (!fatalerrs
| 22-25 | ||||||||||||||||||||||||||||||||||||||||||
| 3286 | return executed 25 times by 1 test: 1;return 1;Executed by:
executed 25 times by 1 test: return 1;Executed by:
| 25 | ||||||||||||||||||||||||||||||||||||||||||
| 3287 | ossl_statem_fatal((s), (40), (513), (118), | - | ||||||||||||||||||||||||||||||||||||||||||
| 3288 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 3289 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 3290 | 2589 | - | ||||||||||||||||||||||||||||||||||||||||||
| 3291 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3292 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3293 | return executed 22 times by 1 test: 0;return 0;Executed by:
executed 22 times by 1 test: return 0;Executed by:
| 22 | ||||||||||||||||||||||||||||||||||||||||||
| 3294 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3295 | } executed 858 times by 1 test: else {end of blockExecuted by:
| 858 | ||||||||||||||||||||||||||||||||||||||||||
| 3296 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3297 | if (!(s->s3->tmp.new_cipher->algorithm_auth & (0x00000001U | 0x00000002U | 0x00000008U | 0x00000020U | 0x00000080U))
| 69-1467 | ||||||||||||||||||||||||||||||||||||||||||
| 3298 | return executed 69 times by 1 test: 1;return 1;Executed by:
executed 69 times by 1 test: return 1;Executed by:
| 69 | ||||||||||||||||||||||||||||||||||||||||||
| 3299 | if (!s->server
| 15-1427 | ||||||||||||||||||||||||||||||||||||||||||
| 3300 | return executed 15 times by 1 test: 1;return 1;Executed by:
executed 15 times by 1 test: return 1;Executed by:
| 15 | ||||||||||||||||||||||||||||||||||||||||||
| 3301 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3302 | if ((
| 441-1011 | ||||||||||||||||||||||||||||||||||||||||||
| 3303 | size_t i; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3304 | if (s->s3->tmp.peer_sigalgs !=
| 122-889 | ||||||||||||||||||||||||||||||||||||||||||
| 3305 | ((void *)0)
| 122-889 | ||||||||||||||||||||||||||||||||||||||||||
| 3306 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3307 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3308 | int curve; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3309 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3310 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3311 | if ((
| 2-887 | ||||||||||||||||||||||||||||||||||||||||||
| 3312 | EC_KEY *ec = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[3].privatekey); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3313 | curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3314 | } executed 2 times by 1 test: else {end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||
| 3315 | curve = -1; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3316 | } executed 887 times by 1 test: end of blockExecuted by:
| 887 | ||||||||||||||||||||||||||||||||||||||||||
| 3317 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3318 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3319 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3320 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3321 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3322 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3323 | for (i = 0; i < s->cert->shared_sigalgslen
| 68-7478 | ||||||||||||||||||||||||||||||||||||||||||
| 3324 | lu = s->cert->shared_sigalgs[i]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3325 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3326 | if (s->server
| 119-7359 | ||||||||||||||||||||||||||||||||||||||||||
| 3327 | if ((
| 1024-6335 | ||||||||||||||||||||||||||||||||||||||||||
| 3328 | continue; executed 6335 times by 1 test: continue;Executed by:
| 6335 | ||||||||||||||||||||||||||||||||||||||||||
| 3329 | } executed 1024 times by 1 test: else {end of blockExecuted by:
| 1024 | ||||||||||||||||||||||||||||||||||||||||||
| 3330 | int cc_idx = s->cert->key - s->cert->pkeys; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3331 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3332 | sig_idx = lu->sig_idx; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3333 | if (cc_idx != sig_idx
| 16-103 | ||||||||||||||||||||||||||||||||||||||||||
| 3334 | continue; executed 103 times by 1 test: continue;Executed by:
| 103 | ||||||||||||||||||||||||||||||||||||||||||
| 3335 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||
| 3336 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3337 | if (!has_usable_cert(s, lu, sig_idx)
| 218-822 | ||||||||||||||||||||||||||||||||||||||||||
| 3338 | continue; executed 218 times by 1 test: continue;Executed by:
| 218 | ||||||||||||||||||||||||||||||||||||||||||
| 3339 | if (lu->sig == 912
| 183-639 | ||||||||||||||||||||||||||||||||||||||||||
| 3340 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3341 | EVP_PKEY *pkey = s->cert->pkeys[sig_idx].privatekey; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3342 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3343 | if (!rsa_pss_check_min_key_size(EVP_PKEY_get0(pkey), lu)
| 0-639 | ||||||||||||||||||||||||||||||||||||||||||
| 3344 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3345 | } executed 639 times by 1 test: end of blockExecuted by:
| 639 | ||||||||||||||||||||||||||||||||||||||||||
| 3346 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3347 | if (curve == -1
| 1-819 | ||||||||||||||||||||||||||||||||||||||||||
| 3348 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3349 | break; executed 821 times by 1 test: break;Executed by:
| 821 | ||||||||||||||||||||||||||||||||||||||||||
| 3350 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||
| 3351 | if (i == s->cert->shared_sigalgslen
| 68-821 | ||||||||||||||||||||||||||||||||||||||||||
| 3352 | if (!fatalerrs
| 0-68 | ||||||||||||||||||||||||||||||||||||||||||
| 3353 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3354 | ossl_statem_fatal((s), (40), (513), (118), | - | ||||||||||||||||||||||||||||||||||||||||||
| 3355 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3356 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 3357 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 3358 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3359 | 2651 | - | ||||||||||||||||||||||||||||||||||||||||||
| 3360 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3361 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3362 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3363 | return executed 68 times by 1 test: 0;return 0;Executed by:
executed 68 times by 1 test: return 0;Executed by:
| 68 | ||||||||||||||||||||||||||||||||||||||||||
| 3364 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3365 | } executed 821 times by 1 test: else {end of blockExecuted by:
| 821 | ||||||||||||||||||||||||||||||||||||||||||
| 3366 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3367 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3368 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3369 | const uint16_t *sent_sigs; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3370 | size_t sent_sigslen; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3371 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3372 | if ((
| 0-122 | ||||||||||||||||||||||||||||||||||||||||||
| 3373 | ((void *)0)
| 0-122 | ||||||||||||||||||||||||||||||||||||||||||
| 3374 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3375 | if (!fatalerrs
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3376 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3377 | ossl_statem_fatal((s), (80), (513), ((4|64)), | - | ||||||||||||||||||||||||||||||||||||||||||
| 3378 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 3379 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 3380 | 2665 | - | ||||||||||||||||||||||||||||||||||||||||||
| 3381 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3382 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3383 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3384 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3385 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3386 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3387 | sent_sigslen = tls12_get_psigalgs(s, 1, &sent_sigs); | - | ||||||||||||||||||||||||||||||||||||||||||
| 3388 | for (i = 0; i < sent_sigslen
| 0-2138 | ||||||||||||||||||||||||||||||||||||||||||
| 3389 | if (lu->sigalg == *sent_sigs
| 122-2016 | ||||||||||||||||||||||||||||||||||||||||||
| 3390 | && has_usable_cert(s, lu, lu->sig_idx)
| 0-122 | ||||||||||||||||||||||||||||||||||||||||||
| 3391 | break; executed 122 times by 1 test: break;Executed by:
| 122 | ||||||||||||||||||||||||||||||||||||||||||
| 3392 | } executed 2016 times by 1 test: end of blockExecuted by:
| 2016 | ||||||||||||||||||||||||||||||||||||||||||
| 3393 | if (i == sent_sigslen
| 0-122 | ||||||||||||||||||||||||||||||||||||||||||
| 3394 | if (!fatalerrs
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3395 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3396 | ossl_statem_fatal((s), (47), (513), (370), | - | ||||||||||||||||||||||||||||||||||||||||||
| 3397 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3398 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 3399 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 3400 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3401 | 2681 | - | ||||||||||||||||||||||||||||||||||||||||||
| 3402 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3403 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3404 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3405 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3406 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3407 | } executed 122 times by 1 test: end of blockExecuted by:
| 122 | ||||||||||||||||||||||||||||||||||||||||||
| 3408 | } else { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3409 | if ((
| 0-441 | ||||||||||||||||||||||||||||||||||||||||||
| 3410 | ((void *)0)
| 0-441 | ||||||||||||||||||||||||||||||||||||||||||
| 3411 | ) { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3412 | if (!fatalerrs
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3413 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3414 | ossl_statem_fatal((s), (80), (513), ((4|64)), | - | ||||||||||||||||||||||||||||||||||||||||||
| 3415 | __FILE__ | - | ||||||||||||||||||||||||||||||||||||||||||
| 3416 | , | - | ||||||||||||||||||||||||||||||||||||||||||
| 3417 | 2690 | - | ||||||||||||||||||||||||||||||||||||||||||
| 3418 | ) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3419 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3420 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3421 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3422 | } executed 441 times by 1 test: end of blockExecuted by:
| 441 | ||||||||||||||||||||||||||||||||||||||||||
| 3423 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3424 | if (sig_idx == -1
| 821-1421 | ||||||||||||||||||||||||||||||||||||||||||
| 3425 | sig_idx = lu->sig_idx; executed 1421 times by 1 test: sig_idx = lu->sig_idx;Executed by:
| 1421 | ||||||||||||||||||||||||||||||||||||||||||
| 3426 | s->s3->tmp.cert = &s->cert->pkeys[sig_idx]; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3427 | s->cert->key = s->s3->tmp.cert; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3428 | s->s3->tmp.sigalg = lu; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3429 | return executed 2242 times by 1 test: 1;return 1;Executed by:
executed 2242 times by 1 test: return 1;Executed by:
| 2242 | ||||||||||||||||||||||||||||||||||||||||||
| 3430 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3431 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3432 | int SSL_CTX_set_tlsext_max_fragment_length(SSL_CTX *ctx, uint8_t mode) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3433 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3434 | if (mode != 0
| 10-1204 | ||||||||||||||||||||||||||||||||||||||||||
| 3435 | && !(((
| 0-10 | ||||||||||||||||||||||||||||||||||||||||||
| 3436 | ERR_put_error(20,(551),(232),__FILE__,2708) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3437 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3438 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3439 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3440 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3441 | ctx->ext.max_fragment_len_mode = mode; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3442 | return executed 1214 times by 1 test: 1;return 1;Executed by:
executed 1214 times by 1 test: return 1;Executed by:
| 1214 | ||||||||||||||||||||||||||||||||||||||||||
| 3443 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3444 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3445 | int SSL_set_tlsext_max_fragment_length(SSL *ssl, uint8_t mode) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3446 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3447 | if (mode != 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3448 | && !(((
| 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3449 | ERR_put_error(20,(550),(232),__FILE__,2721) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3450 | ; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3451 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3452 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3453 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3454 | ssl->ext.max_fragment_len_mode = mode; | - | ||||||||||||||||||||||||||||||||||||||||||
| 3455 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3456 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| 3457 | - | |||||||||||||||||||||||||||||||||||||||||||
| 3458 | uint8_t SSL_SESSION_get_max_fragment_length(const SSL_SESSION *session) | - | ||||||||||||||||||||||||||||||||||||||||||
| 3459 | { | - | ||||||||||||||||||||||||||||||||||||||||||
| 3460 | return never executed: session->ext.max_fragment_len_mode;return session->ext.max_fragment_len_mode;never executed: return session->ext.max_fragment_len_mode; | 0 | ||||||||||||||||||||||||||||||||||||||||||
| 3461 | } | - | ||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |