Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | int | - |
13 | ssh_ecdsa_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, | - |
14 | const u_char *data, size_t datalen, u_int compat) | - |
15 | { | - |
16 | ECDSA_SIG *sig = | - |
17 | ((void *)0) | - |
18 | ; | - |
19 | const BIGNUM *sig_r, *sig_s; | - |
20 | int hash_alg; | - |
21 | u_char digest[64]; | - |
22 | size_t len, dlen; | - |
23 | struct sshbuf *b = | - |
24 | ((void *)0) | - |
25 | , *bb = | - |
26 | ((void *)0) | - |
27 | ; | - |
28 | int ret = -1; | - |
29 | | - |
30 | if (lenp != TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
31 | ((void *)0)TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
32 | ) | - |
33 | *executed 64 times by 2 tests: *lenp = 0; lenp = 0;executed 64 times by 2 tests: *lenp = 0; | 64 |
34 | if (sigp != TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
35 | ((void *)0)TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
36 | ) | - |
37 | *executed 64 times by 2 tests: *sigp = ((void *)0) ; sigp = executed 64 times by 2 tests: *sigp = ((void *)0) ; | 64 |
38 | ((void *)0)executed 64 times by 2 tests: *sigp = ((void *)0) ; | 64 |
39 | ;executed 64 times by 2 tests: *sigp = ((void *)0) ; | 64 |
40 | | - |
41 | if (key == TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
42 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
43 | || key->ecdsa == TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
44 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
45 | || | - |
46 | sshkey_type_plain(key->type) != KEY_ECDSATRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
) | 0-64 |
47 | return never executed: return -10; -10;never executed: return -10; | 0 |
48 | | - |
49 | if ((TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
|| | 0-64 |
50 | (TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
dlen = ssh_digest_bytes(hash_alg)) == 0TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
) | 0-64 |
51 | return never executed: return -1; -1;never executed: return -1; | 0 |
52 | if ((TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
ret = ssh_digest_memory(hash_alg, data, datalen,TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
53 | digest, sizeof(digest))) != 0TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
) | 0-64 |
54 | goto never executed: goto out; out;never executed: goto out; | 0 |
55 | | - |
56 | if ((TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
sig = ECDSA_do_sign(digest, dlen, key->ecdsa)) == TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
57 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
58 | ) { | - |
59 | ret = -22; | - |
60 | goto never executed: goto out; out;never executed: goto out; | 0 |
61 | } | - |
62 | | - |
63 | if ((TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
bb = sshbuf_new()) == TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
64 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
65 | || (TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
b = sshbuf_new()) == TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
66 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
67 | ) { | - |
68 | ret = -2; | - |
69 | goto never executed: goto out; out;never executed: goto out; | 0 |
70 | } | - |
71 | ECDSA_SIG_get0(sig, &sig_r, &sig_s); | - |
72 | if ((TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
ret = sshbuf_put_bignum2(bb, sig_r)) != 0TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
|| | 0-64 |
73 | (TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
ret = sshbuf_put_bignum2(bb, sig_s)) != 0TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
) | 0-64 |
74 | goto never executed: goto out; out;never executed: goto out; | 0 |
75 | if ((TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
ret = sshbuf_put_cstring(b, sshkey_ssh_name_plain(key))) != 0TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
|| | 0-64 |
76 | (TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
ret = sshbuf_put_stringb(b, bb)) != 0TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
) | 0-64 |
77 | goto never executed: goto out; out;never executed: goto out; | 0 |
78 | len = sshbuf_len(b); | - |
79 | if (sigp != TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
80 | ((void *)0)TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
81 | ) { | - |
82 | if ((*TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
sigp = malloc(len)) == TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
83 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 64 times by 2 tests |
| 0-64 |
84 | ) { | - |
85 | ret = -2; | - |
86 | goto never executed: goto out; out;never executed: goto out; | 0 |
87 | } | - |
88 | memcpy(*sigp, sshbuf_ptr(b), len); | - |
89 | }executed 64 times by 2 tests: end of block | 64 |
90 | if (lenp != TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
91 | ((void *)0)TRUE | evaluated 64 times by 2 tests | FALSE | never evaluated |
| 0-64 |
92 | ) | - |
93 | *executed 64 times by 2 tests: *lenp = len; lenp = len;executed 64 times by 2 tests: *lenp = len; | 64 |
94 | ret = 0; | - |
95 | out:code before this statement executed 64 times by 2 tests: out: | 64 |
96 | explicit_bzero(digest, sizeof(digest)); | - |
97 | sshbuf_free(b); | - |
98 | sshbuf_free(bb); | - |
99 | ECDSA_SIG_free(sig); | - |
100 | returnexecuted 64 times by 2 tests: return ret; ret;executed 64 times by 2 tests: return ret; | 64 |
101 | } | - |
102 | | - |
103 | | - |
104 | int | - |
105 | ssh_ecdsa_verify(const struct sshkey *key, | - |
106 | const u_char *signature, size_t signaturelen, | - |
107 | const u_char *data, size_t datalen, u_int compat) | - |
108 | { | - |
109 | ECDSA_SIG *sig = | - |
110 | ((void *)0) | - |
111 | ; | - |
112 | BIGNUM *sig_r = | - |
113 | ((void *)0) | - |
114 | , *sig_s = | - |
115 | ((void *)0) | - |
116 | ; | - |
117 | int hash_alg; | - |
118 | u_char digest[64]; | - |
119 | size_t dlen; | - |
120 | int ret = -1; | - |
121 | struct sshbuf *b = | - |
122 | ((void *)0) | - |
123 | , *sigbuf = | - |
124 | ((void *)0) | - |
125 | ; | - |
126 | char *ktype = | - |
127 | ((void *)0) | - |
128 | ; | - |
129 | | - |
130 | if (key == TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
131 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
132 | || key->ecdsa == TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
133 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
134 | || | - |
135 | sshkey_type_plain(key->type) != KEY_ECDSATRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
|| | 0-12662 |
136 | signature == TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
137 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
138 | || signaturelen == 0TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
) | 0-12662 |
139 | return never executed: return -10; -10;never executed: return -10; | 0 |
140 | | - |
141 | if ((TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
|| | 0-12662 |
142 | (TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
dlen = ssh_digest_bytes(hash_alg)) == 0TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
) | 0-12662 |
143 | return never executed: return -1; -1;never executed: return -1; | 0 |
144 | | - |
145 | | - |
146 | if ((TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
b = sshbuf_from(signature, signaturelen)) == TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
147 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 12662 times by 2 tests |
| 0-12662 |
148 | ) | - |
149 | return never executed: return -2; -2;never executed: return -2; | 0 |
150 | if (sshbuf_get_cstring(b, &ktype, TRUE | evaluated 966 times by 1 test | FALSE | evaluated 11696 times by 2 tests |
| 966-11696 |
151 | ((void *)0)TRUE | evaluated 966 times by 1 test | FALSE | evaluated 11696 times by 2 tests |
| 966-11696 |
152 | ) != 0TRUE | evaluated 966 times by 1 test | FALSE | evaluated 11696 times by 2 tests |
|| | 966-11696 |
153 | sshbuf_froms(b, &sigbuf) != 0TRUE | evaluated 901 times by 1 test | FALSE | evaluated 10795 times by 2 tests |
) { | 901-10795 |
154 | ret = -4; | - |
155 | gotoexecuted 1867 times by 1 test: goto out; out;executed 1867 times by 1 test: goto out; | 1867 |
156 | } | - |
157 | if ( | - |
158 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
159 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
160 | ) && __builtin_constant_p (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
161 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
162 | ) && (__s1_len = __builtin_strlen (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
163 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
164 | ), __s2_len = __builtin_strlen (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
165 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
166 | ), (!((size_t)(const void *)((TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
167 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
168 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
169 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
170 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
171 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
172 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
173 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
174 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
175 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
176 | , TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
177 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
178 | ) : (__builtin_constant_p (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
179 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
180 | ) && ((size_t)(const void *)((TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
181 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
182 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
183 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
184 | ) == 1) && (__s1_len = __builtin_strlen (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
185 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
186 | ), __s1_len < 4) ? (__builtin_constant_p (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
187 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
188 | ) && ((size_t)(const void *)((TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
189 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
190 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
191 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
192 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
193 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
194 | , TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
195 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
196 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
197 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
198 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
199 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
200 | ))[0] - __s2[0]); if (__s1_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
201 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
202 | ))[1] - __s2[1]); if (__s1_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
203 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
204 | ))[2] - __s2[2]); if (__s1_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( sshkey_ssh_name_plain(key) ))[3] - __s2[3]); TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
205 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( sshkey_ssh_name_plain(key) ))[3] - __s2[3]); | 0-7314 |
206 | ))[3] - __s2[3]);TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( sshkey_ssh_name_plain(key) ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
207 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
208 | ) && ((size_t)(const void *)((TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
209 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
210 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
211 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
212 | ) == 1) && (__s2_len = __builtin_strlen (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
213 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
214 | ), __s2_len < 4) ? (__builtin_constant_p (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
215 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
216 | ) && ((size_t)(const void *)((TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
217 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
218 | ) + 1) - (size_t)(const void *)(TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
219 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
220 | ) == 1) ? __builtin_strcmp (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
221 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
222 | , TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
223 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
224 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
225 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
226 | ); int __result = (((const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
227 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
228 | ))[0] - __s2[0]); if (__s2_len > 0TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
229 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
230 | ))[1] - __s2[1]); if (__s2_len > 1TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
231 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
232 | ))[2] - __s2[2]); if (__s2_len > 2TRUE | never evaluated | FALSE | never evaluated |
&& __result == 0TRUE | never evaluated | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( ktype ))[3] - __s2[3]); TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
233 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( ktype ))[3] - __s2[3]); | 0-7314 |
234 | ))[3] - __s2[3]);TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( ktype ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : __builtin_strcmp (TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 0-7314 |
235 | sshkey_ssh_name_plain(key)TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
236 | , TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
237 | ktypeTRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
238 | )))); }) TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
| 3481-7314 |
239 | != 0TRUE | evaluated 3481 times by 1 test | FALSE | evaluated 7314 times by 2 tests |
) { | 3481-7314 |
240 | ret = -13; | - |
241 | gotoexecuted 3481 times by 1 test: goto out; out;executed 3481 times by 1 test: goto out; | 3481 |
242 | } | - |
243 | if (sshbuf_len(b) != 0TRUE | evaluated 6 times by 1 test | FALSE | evaluated 7308 times by 2 tests |
) { | 6-7308 |
244 | ret = -23; | - |
245 | gotoexecuted 6 times by 1 test: goto out; out;executed 6 times by 1 test: goto out; | 6 |
246 | } | - |
247 | | - |
248 | | - |
249 | if ((TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
sig = ECDSA_SIG_new()) == TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
| 0-7308 |
250 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
| 0-7308 |
251 | || | - |
252 | (TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
sig_r = BN_new()) == TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
| 0-7308 |
253 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
| 0-7308 |
254 | || | - |
255 | (TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
sig_s = BN_new()) == TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
| 0-7308 |
256 | ((void *)0)TRUE | never evaluated | FALSE | evaluated 7308 times by 2 tests |
| 0-7308 |
257 | ) { | - |
258 | ret = -2; | - |
259 | goto never executed: goto out; out;never executed: goto out; | 0 |
260 | } | - |
261 | if (sshbuf_get_bignum2(sigbuf, sig_r) != 0TRUE | evaluated 764 times by 1 test | FALSE | evaluated 6544 times by 2 tests |
|| | 764-6544 |
262 | sshbuf_get_bignum2(sigbuf, sig_s) != 0TRUE | evaluated 735 times by 1 test | FALSE | evaluated 5809 times by 2 tests |
) { | 735-5809 |
263 | ret = -4; | - |
264 | gotoexecuted 1499 times by 1 test: goto out; out;executed 1499 times by 1 test: goto out; | 1499 |
265 | } | - |
266 | if (!ECDSA_SIG_set0(sig, sig_r, sig_s)TRUE | never evaluated | FALSE | evaluated 5809 times by 2 tests |
) { | 0-5809 |
267 | ret = -22; | - |
268 | goto never executed: goto out; out;never executed: goto out; | 0 |
269 | } | - |
270 | sig_r = sig_s = | - |
271 | ((void *)0) | - |
272 | ; | - |
273 | | - |
274 | if (sshbuf_len(sigbuf) != 0TRUE | evaluated 3 times by 1 test | FALSE | evaluated 5806 times by 2 tests |
) { | 3-5806 |
275 | ret = -23; | - |
276 | gotoexecuted 3 times by 1 test: goto out; out;executed 3 times by 1 test: goto out; | 3 |
277 | } | - |
278 | if ((TRUE | never evaluated | FALSE | evaluated 5806 times by 2 tests |
ret = ssh_digest_memory(hash_alg, data, datalen,TRUE | never evaluated | FALSE | evaluated 5806 times by 2 tests |
| 0-5806 |
279 | digest, sizeof(digest))) != 0TRUE | never evaluated | FALSE | evaluated 5806 times by 2 tests |
) | 0-5806 |
280 | goto never executed: goto out; out;never executed: goto out; | 0 |
281 | | - |
282 | switch (ECDSA_do_verify(digest, dlen, sig, key->ecdsa)) { | - |
283 | caseexecuted 67 times by 2 tests: case 1: 1:executed 67 times by 2 tests: case 1: | 67 |
284 | ret = 0; | - |
285 | break;executed 67 times by 2 tests: break; | 67 |
286 | caseexecuted 5739 times by 1 test: case 0: 0:executed 5739 times by 1 test: case 0: | 5739 |
287 | ret = -21; | - |
288 | gotoexecuted 5739 times by 1 test: goto out; out;executed 5739 times by 1 test: goto out; | 5739 |
289 | default never executed: default: :never executed: default: | 0 |
290 | ret = -22; | - |
291 | goto never executed: goto out; out;never executed: goto out; | 0 |
292 | } | - |
293 | | - |
294 | out:code before this statement executed 67 times by 2 tests: out: | 67 |
295 | explicit_bzero(digest, sizeof(digest)); | - |
296 | sshbuf_free(sigbuf); | - |
297 | sshbuf_free(b); | - |
298 | ECDSA_SIG_free(sig); | - |
299 | BN_clear_free(sig_r); | - |
300 | BN_clear_free(sig_s); | - |
301 | free(ktype); | - |
302 | returnexecuted 12662 times by 2 tests: return ret; ret;executed 12662 times by 2 tests: return ret; | 12662 |
303 | } | - |
| | |