OpenCoverage

s3_msg.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/ssl/s3_msg.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2int ssl3_do_change_cipher_spec(SSL *s)-
3{-
4 int i;-
5-
6 if (s->server
s->serverDescription
TRUEevaluated 1217 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1252 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
1217-1252
7 i = (0x020|0x001);
executed 1217 times by 1 test: i = (0x020|0x001);
Executed by:
  • libssl.so.1.1
1217
8 else-
9 i = (0x010|0x001);
executed 1252 times by 1 test: i = (0x010|0x001);
Executed by:
  • libssl.so.1.1
1252
10-
11 if (s->s3->tmp.key_block ==
s->s3->tmp.key...== ((void *)0)Description
TRUEevaluated 1210 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1259 times by 1 test
Evaluated by:
  • libssl.so.1.1
1210-1259
12 ((void *)0)
s->s3->tmp.key...== ((void *)0)Description
TRUEevaluated 1210 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1259 times by 1 test
Evaluated by:
  • libssl.so.1.1
1210-1259
13 ) {-
14 if (s->session ==
s->session == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1210 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-1210
15 ((void *)0)
s->session == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1210 times by 1 test
Evaluated by:
  • libssl.so.1.1
0-1210
16 || s->session->master_key_length == 0
s->session->ma...ey_length == 0Description
TRUEnever evaluated
FALSEevaluated 1210 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
0-1210
17-
18 ERR_put_error(20,(292),(133),__FILE__,24);-
19 return
never executed: return 0;
0;
never executed: return 0;
0
20 }-
21-
22 s->session->cipher = s->s3->tmp.new_cipher;-
23 if (!s->method->ssl3_enc->setup_key_block(s)
!s->method->ss...p_key_block(s)Description
TRUEnever evaluated
FALSEevaluated 1210 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-1210
24 return
never executed: return 0;
0;
never executed: return 0;
0
25 }
executed 1210 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
1210
26-
27 if (!s->method->ssl3_enc->change_cipher_state(s, i)
!s->method->ss...er_state(s, i)Description
TRUEnever evaluated
FALSEevaluated 2469 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-2469
28 return
never executed: return 0;
0;
never executed: return 0;
0
29-
30 return
executed 2469 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
1;
executed 2469 times by 1 test: return 1;
Executed by:
  • libssl.so.1.1
2469
31}-
32-
33int ssl3_send_alert(SSL *s, int level, int desc)-
34{-
35-
36 if (((!(s->method->ssl3_enc->enc_flags & 0x8)
!(s->method->s...c_flags & 0x8)Description
TRUEevaluated 6138 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 239 times by 1 test
Evaluated by:
  • libssl.so.1.1
&& (
(s)->method->version >= 0x0304Description
TRUEevaluated 2394 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 3744 times by 1 test
Evaluated by:
  • libssl.so.1.1
s)->method->version >= 0x0304
(s)->method->version >= 0x0304Description
TRUEevaluated 2394 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 3744 times by 1 test
Evaluated by:
  • libssl.so.1.1
&& (
(s)->method->v...ion != 0x10000Description
TRUEevaluated 1249 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1145 times by 1 test
Evaluated by:
  • libssl.so.1.1
s)->method->version != 0x10000
(s)->method->v...ion != 0x10000Description
TRUEevaluated 1249 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1145 times by 1 test
Evaluated by:
  • libssl.so.1.1
) || (
(s)->early_dat...ATA_CONNECTINGDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
s)->early_data_state == SSL_EARLY_DATA_CONNECTING
(s)->early_dat...ATA_CONNECTINGDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| (
(s)->early_dat..._CONNECT_RETRYDescription
TRUEnever evaluated
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
s)->early_data_state == SSL_EARLY_DATA_CONNECT_RETRY
(s)->early_dat..._CONNECT_RETRYDescription
TRUEnever evaluated
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| (
(s)->early_dat...Y_DATA_WRITINGDescription
TRUEnever evaluated
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
s)->early_data_state == SSL_EARLY_DATA_WRITING
(s)->early_dat...Y_DATA_WRITINGDescription
TRUEnever evaluated
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| (
(s)->early_dat...TA_WRITE_RETRYDescription
TRUEnever evaluated
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
s)->early_data_state == SSL_EARLY_DATA_WRITE_RETRY
(s)->early_dat...TA_WRITE_RETRYDescription
TRUEnever evaluated
FALSEevaluated 5125 times by 1 test
Evaluated by:
  • libssl.so.1.1
|| (
(s)->hello_ret...SL_HRR_PENDINGDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 5035 times by 1 test
Evaluated by:
  • libssl.so.1.1
s)->hello_retry_request == SSL_HRR_PENDING
(s)->hello_ret...SL_HRR_PENDINGDescription
TRUEevaluated 90 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 5035 times by 1 test
Evaluated by:
  • libssl.so.1.1
))
0-6138
37 desc = tls13_alert_code(desc);
executed 1342 times by 1 test: desc = tls13_alert_code(desc);
Executed by:
  • libssl.so.1.1
1342
38 else-
39 desc = s->method->ssl3_enc->alert_value(desc);
executed 5035 times by 1 test: desc = s->method->ssl3_enc->alert_value(desc);
Executed by:
  • libssl.so.1.1
5035
40 if (s->version == 0x0300
s->version == 0x0300Description
TRUEevaluated 376 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 6001 times by 1 test
Evaluated by:
  • libssl.so.1.1
&& desc == 70
desc == 70Description
TRUEevaluated 375 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libssl.so.1.1
)
1-6001
41 desc = 40;
executed 375 times by 1 test: desc = 40;
Executed by:
  • libssl.so.1.1
375
42-
43 if (desc < 0
desc < 0Description
TRUEnever evaluated
FALSEevaluated 6377 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-6377
44 return
never executed: return -1;
-1;
never executed: return -1;
0
45-
46 if ((
(level == 2)Description
TRUEevaluated 3787 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2590 times by 1 test
Evaluated by:
  • libssl.so.1.1
level == 2)
(level == 2)Description
TRUEevaluated 3787 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 2590 times by 1 test
Evaluated by:
  • libssl.so.1.1
&& (
(s->session != ((void *)0) )Description
TRUEevaluated 3044 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 743 times by 1 test
Evaluated by:
  • libssl.so.1.1
s->session !=
(s->session != ((void *)0) )Description
TRUEevaluated 3044 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 743 times by 1 test
Evaluated by:
  • libssl.so.1.1
743-3787
47 ((void *)0)
(s->session != ((void *)0) )Description
TRUEevaluated 3044 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 743 times by 1 test
Evaluated by:
  • libssl.so.1.1
743-3044
48 )
(s->session != ((void *)0) )Description
TRUEevaluated 3044 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 743 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
743-3044
49 SSL_CTX_remove_session(s->session_ctx, s->session);
executed 3044 times by 1 test: SSL_CTX_remove_session(s->session_ctx, s->session);
Executed by:
  • libssl.so.1.1
3044
50-
51 s->s3->alert_dispatch = 1;-
52 s->s3->send_alert[0] = level;-
53 s->s3->send_alert[1] = desc;-
54 if (!RECORD_LAYER_write_pending(&s->rlayer)
!RECORD_LAYER_...ng(&s->rlayer)Description
TRUEevaluated 6377 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEnever evaluated
) {
0-6377
55-
56 return
executed 6377 times by 1 test: return s->method->ssl_dispatch_alert(s);
Executed by:
  • libssl.so.1.1
s->method->ssl_dispatch_alert(s);
executed 6377 times by 1 test: return s->method->ssl_dispatch_alert(s);
Executed by:
  • libssl.so.1.1
6377
57 }-
58-
59-
60-
61-
62 return
never executed: return -1;
-1;
never executed: return -1;
0
63}-
64-
65int ssl3_dispatch_alert(SSL *s)-
66{-
67 int i, j;-
68 size_t alertlen;-
69 void (*cb) (const SSL *ssl, int type, int val) = -
70 ((void *)0)-
71 ;-
72 size_t written;-
73-
74 s->s3->alert_dispatch = 0;-
75 alertlen = 2;-
76 i = do_ssl3_write(s, 21, &s->s3->send_alert[0], &alertlen, 1, 0,-
77 &written);-
78 if (i <= 0
i <= 0Description
TRUEevaluated 88 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 6050 times by 1 test
Evaluated by:
  • libssl.so.1.1
) {
88-6050
79 s->s3->alert_dispatch = 1;-
80 }
executed 88 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
else {
88
81-
82-
83-
84-
85 (void)(int)BIO_ctrl(s->wbio,11,0,-
86 ((void *)0)-
87 );-
88-
89 if (s->msg_callback
s->msg_callbackDescription
TRUEnever evaluated
FALSEevaluated 6050 times by 1 test
Evaluated by:
  • libssl.so.1.1
)
0-6050
90 s->msg_callback(1, s->version, 21, s->s3->send_alert,
never executed: s->msg_callback(1, s->version, 21, s->s3->send_alert, 2, s, s->msg_callback_arg);
0
91 2, s, s->msg_callback_arg);
never executed: s->msg_callback(1, s->version, 21, s->s3->send_alert, 2, s, s->msg_callback_arg);
0
92-
93 if (s->info_callback !=
s->info_callba...!= ((void *)0)Description
TRUEevaluated 1923 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4127 times by 1 test
Evaluated by:
  • libssl.so.1.1
1923-4127
94 ((void *)0)
s->info_callba...!= ((void *)0)Description
TRUEevaluated 1923 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4127 times by 1 test
Evaluated by:
  • libssl.so.1.1
1923-4127
95 )-
96 cb = s->info_callback;
executed 1923 times by 1 test: cb = s->info_callback;
Executed by:
  • libssl.so.1.1
1923
97 else if (s->ctx->info_callback !=
s->ctx->info_c...!= ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4123 times by 1 test
Evaluated by:
  • libssl.so.1.1
4-4123
98 ((void *)0)
s->ctx->info_c...!= ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4123 times by 1 test
Evaluated by:
  • libssl.so.1.1
4-4123
99 )-
100 cb = s->ctx->info_callback;
executed 4 times by 1 test: cb = s->ctx->info_callback;
Executed by:
  • libssl.so.1.1
4
101-
102 if (cb !=
cb != ((void *)0)Description
TRUEevaluated 1927 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4123 times by 1 test
Evaluated by:
  • libssl.so.1.1
1927-4123
103 ((void *)0)
cb != ((void *)0)Description
TRUEevaluated 1927 times by 1 test
Evaluated by:
  • libssl.so.1.1
FALSEevaluated 4123 times by 1 test
Evaluated by:
  • libssl.so.1.1
1927-4123
104 ) {-
105 j = (s->s3->send_alert[0] << 8) | s->s3->send_alert[1];-
106 cb(s, (0x4000|0x08), j);-
107 }
executed 1927 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
1927
108 }
executed 6050 times by 1 test: end of block
Executed by:
  • libssl.so.1.1
6050
109 return
executed 6138 times by 1 test: return i;
Executed by:
  • libssl.so.1.1
i;
executed 6138 times by 1 test: return i;
Executed by:
  • libssl.so.1.1
6138
110}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2