OpenCoverage

sshbuf-getput-crypto.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssh/src/sshbuf-getput-crypto.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10int-
11sshbuf_get_bignum2(struct sshbuf *buf, BIGNUM *v)-
12{-
13 const u_char *d;-
14 size_t len;-
15 int r;-
16-
17 if ((
(r = sshbuf_ge...d, &len)) != 0Description
TRUEevaluated 1242461 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_get_bignum2_bytes_direct(buf, &d, &len)) != 0
(r = sshbuf_ge...d, &len)) != 0Description
TRUEevaluated 1242461 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
FALSEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
64784-1242461
18 return
executed 1242461 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
r;
executed 1242461 times by 2 tests: return r;
Executed by:
  • test_sshbuf
  • test_sshkey
1242461
19 if (v !=
v != ((void *)0)Description
TRUEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-64784
20 ((void *)0)
v != ((void *)0)Description
TRUEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-64784
21 && BN_bin2bn(d, len, v) ==
BN_bin2bn(d, l...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-64784
22 ((void *)0)
BN_bin2bn(d, l...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 64784 times by 6 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0-64784
23 )-
24 return
never executed: return -2;
-2;
never executed: return -2;
0
25 return
executed 64784 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 64784 times by 6 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
64784
26}-
27-
28int-
29sshbuf_get_bignum1(struct sshbuf *buf, BIGNUM *v)-
30{-
31 const u_char *d = sshbuf_ptr(buf);-
32 u_int16_t len_bits;-
33 size_t len_bytes;-
34-
35-
36 if (sshbuf_len(buf) < 2
sshbuf_len(buf) < 2Description
TRUEnever evaluated
FALSEevaluated 1239382 times by 1 test
Evaluated by:
  • test_sshbuf
)
0-1239382
37 return
never executed: return -3;
-3;
never executed: return -3;
0
38 len_bits = (((u_int16_t)(((const u_char *)(d))[0]) << 8) | (u_int16_t)(((const u_char *)(d))[1]));-
39 len_bytes = (len_bits + 7) >> 3;-
40 if (len_bytes > (16384 / 8)
len_bytes > (16384 / 8)Description
TRUEevaluated 1239378 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 4 times by 1 test
Evaluated by:
  • test_sshbuf
)
4-1239378
41 return
executed 1239378 times by 1 test: return -7;
Executed by:
  • test_sshbuf
-7;
executed 1239378 times by 1 test: return -7;
Executed by:
  • test_sshbuf
1239378
42 if (sshbuf_len(buf) < 2 + len_bytes
sshbuf_len(buf... 2 + len_bytesDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
)
2
43 return
executed 2 times by 1 test: return -3;
Executed by:
  • test_sshbuf
-3;
executed 2 times by 1 test: return -3;
Executed by:
  • test_sshbuf
2
44 if (v !=
v != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEnever evaluated
0-2
45 ((void *)0)
v != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEnever evaluated
0-2
46 && BN_bin2bn(d + 2, len_bytes, v) ==
BN_bin2bn(d + ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
0-2
47 ((void *)0)
BN_bin2bn(d + ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
0-2
48 )-
49 return
never executed: return -2;
-2;
never executed: return -2;
0
50 if (sshbuf_consume(buf, 2 + len_bytes) != 0
sshbuf_consume...en_bytes) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
) {
0-2
51 ;-
52 ;-
53 return
never executed: return -1;
-1;
never executed: return -1;
0
54 }-
55 return
executed 2 times by 1 test: return 0;
Executed by:
  • test_sshbuf
0;
executed 2 times by 1 test: return 0;
Executed by:
  • test_sshbuf
2
56}-
57-
58-
59static int-
60get_ec(const u_char *d, size_t len, EC_POINT *v, const EC_GROUP *g)-
61{-
62-
63 if (len == 0
len == 0Description
TRUEnever evaluated
FALSEevaluated 6788 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
|| len > ((528 * 2 / 8) + 1)
len > ((528 * 2 / 8) + 1)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 6785 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
0-6788
64 return
executed 3 times by 1 test: return -8;
Executed by:
  • test_sshkey
-8;
executed 3 times by 1 test: return -8;
Executed by:
  • test_sshkey
3
65-
66 if (*
*d != POINT_CO...N_UNCOMPRESSEDDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 6758 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
d != POINT_CONVERSION_UNCOMPRESSED
*d != POINT_CO...N_UNCOMPRESSEDDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 6758 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
27-6758
67 return
executed 27 times by 1 test: return -4;
Executed by:
  • test_sshkey
-4;
executed 27 times by 1 test: return -4;
Executed by:
  • test_sshkey
27
68 if (v !=
v != ((void *)0)Description
TRUEevaluated 6758 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-6758
69 ((void *)0)
v != ((void *)0)Description
TRUEevaluated 6758 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
0-6758
70 && EC_POINT_oct2point(g, v, d, len,
EC_POINT_oct2p...id *)0) ) != 1Description
TRUEevaluated 1739 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 5019 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1739-5019
71 ((void *)0)
EC_POINT_oct2p...id *)0) ) != 1Description
TRUEevaluated 1739 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 5019 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
1739-5019
72 ) != 1
EC_POINT_oct2p...id *)0) ) != 1Description
TRUEevaluated 1739 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 5019 times by 5 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
)
1739-5019
73 return
executed 1739 times by 1 test: return -4;
Executed by:
  • test_sshkey
-4;
executed 1739 times by 1 test: return -4;
Executed by:
  • test_sshkey
1739
74 return
executed 5019 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 5019 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshbuf
  • test_sshkey
5019
75}-
76-
77int-
78sshbuf_get_ec(struct sshbuf *buf, EC_POINT *v, const EC_GROUP *g)-
79{-
80 const u_char *d;-
81 size_t len;-
82 int r;-
83-
84 if ((
(r = sshbuf_pe...&d, &len)) < 0Description
TRUEevaluated 235 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 6786 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
r = sshbuf_peek_string_direct(buf, &d, &len)) < 0
(r = sshbuf_pe...&d, &len)) < 0Description
TRUEevaluated 235 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 6786 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
)
235-6786
85 return
executed 235 times by 1 test: return r;
Executed by:
  • test_sshkey
r;
executed 235 times by 1 test: return r;
Executed by:
  • test_sshkey
235
86 if ((
(r = get_ec(d,...n, v, g)) != 0Description
TRUEevaluated 1769 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 5017 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
r = get_ec(d, len, v, g)) != 0
(r = get_ec(d,...n, v, g)) != 0Description
TRUEevaluated 1769 times by 1 test
Evaluated by:
  • test_sshkey
FALSEevaluated 5017 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
)
1769-5017
87 return
executed 1769 times by 1 test: return r;
Executed by:
  • test_sshkey
r;
executed 1769 times by 1 test: return r;
Executed by:
  • test_sshkey
1769
88-
89 if (sshbuf_get_string_direct(buf,
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 5017 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
0-5017
90 ((void *)0)
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 5017 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
0-5017
91 ,
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 5017 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
0-5017
92 ((void *)0)
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 5017 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
0-5017
93 ) != 0
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 5017 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
) {
0-5017
94-
95 ;-
96 ;-
97 return
never executed: return -1;
-1;
never executed: return -1;
0
98 }-
99 return
executed 5017 times by 4 tests: return 0;
Executed by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
0;
executed 5017 times by 4 tests: return 0;
Executed by:
  • ssh-keygen
  • test_hostkeys
  • test_kex
  • test_sshkey
5017
100}-
101-
102int-
103sshbuf_get_eckey(struct sshbuf *buf, EC_KEY *v)-
104{-
105 EC_POINT *pt = EC_POINT_new(EC_KEY_get0_group(v));-
106 int r;-
107 const u_char *d;-
108 size_t len;-
109-
110 if (pt ==
pt == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1239379 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
0-1239379
111 ((void *)0)
pt == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1239379 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
0-1239379
112 ) {-
113 ;-
114 return
never executed: return -2;
-2;
never executed: return -2;
0
115 }-
116 if ((
(r = sshbuf_pe...&d, &len)) < 0Description
TRUEevaluated 1239377 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
r = sshbuf_peek_string_direct(buf, &d, &len)) < 0
(r = sshbuf_pe...&d, &len)) < 0Description
TRUEevaluated 1239377 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
) {
2-1239377
117 EC_POINT_free(pt);-
118 return
executed 1239377 times by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 1239377 times by 1 test: return r;
Executed by:
  • test_sshbuf
1239377
119 }-
120 if ((
(r = get_ec(d,...roup(v))) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
r = get_ec(d, len, pt, EC_KEY_get0_group(v))) != 0
(r = get_ec(d,...roup(v))) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
) {
0-2
121 EC_POINT_free(pt);-
122 return
never executed: return r;
r;
never executed: return r;
0
123 }-
124 if (EC_KEY_set_public_key(v, pt) != 1
EC_KEY_set_pub...ey(v, pt) != 1Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
) {
0-2
125 EC_POINT_free(pt);-
126 return
never executed: return -2;
-2;
never executed: return -2;
0
127 }-
128 EC_POINT_free(pt);-
129-
130 if (sshbuf_get_string_direct(buf,
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
0-2
131 ((void *)0)
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
0-2
132 ,
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
0-2
133 ((void *)0)
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
0-2
134 ) != 0
sshbuf_get_str...id *)0) ) != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • test_sshbuf
  • test_sshkey
) {
0-2
135-
136 ;-
137 ;-
138 return
never executed: return -1;
-1;
never executed: return -1;
0
139 }-
140 return
executed 2 times by 2 tests: return 0;
Executed by:
  • test_sshbuf
  • test_sshkey
0;
executed 2 times by 2 tests: return 0;
Executed by:
  • test_sshbuf
  • test_sshkey
2
141}-
142-
143-
144int-
145sshbuf_put_bignum2(struct sshbuf *buf, const BIGNUM *v)-
146{-
147 u_char d[(16384 / 8) + 1];-
148 int len = -
149 ((BN_num_bits(-
150 v-
151 )+7)/8)-
152 , prepend = 0, r;-
153-
154 if (len < 0
len < 0Description
TRUEnever evaluated
FALSEevaluated 1778 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
|| len > (16384 / 8)
len > (16384 / 8)Description
TRUEnever evaluated
FALSEevaluated 1778 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
0-1778
155 return
never executed: return -10;
-10;
never executed: return -10;
0
156 *d = '\0';-
157 if (BN_bn2bin(v, d + 1) != len
BN_bn2bin(v, d + 1) != lenDescription
TRUEnever evaluated
FALSEevaluated 1778 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
0-1778
158 return
never executed: return -1;
-1;
never executed: return -1;
0
159-
160 if (len > 0
len > 0Description
TRUEevaluated 1778 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEnever evaluated
&& (
(d[1] & 0x80) != 0Description
TRUEevaluated 957 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 821 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
d[1] & 0x80) != 0
(d[1] & 0x80) != 0Description
TRUEevaluated 957 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
FALSEevaluated 821 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
)
0-1778
161 prepend = 1;
executed 957 times by 5 tests: prepend = 1;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
957
162 if ((
(r = sshbuf_pu... prepend)) < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1776 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
r = sshbuf_put_string(buf, d + 1 - prepend, len + prepend)) < 0
(r = sshbuf_pu... prepend)) < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 1776 times by 5 tests
Evaluated by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
2-1776
163 explicit_bzero(d, sizeof(d));-
164 return
executed 2 times by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 2 times by 1 test: return r;
Executed by:
  • test_sshbuf
2
165 }-
166 explicit_bzero(d, sizeof(d));-
167 return
executed 1776 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
0;
executed 1776 times by 5 tests: return 0;
Executed by:
  • ssh-keygen
  • sshd
  • test_kex
  • test_sshbuf
  • test_sshkey
1776
168}-
169-
170int-
171sshbuf_put_bignum1(struct sshbuf *buf, const BIGNUM *v)-
172{-
173 int r, len_bits = BN_num_bits(v);-
174 size_t len_bytes = (len_bits + 7) / 8;-
175 u_char d[(16384 / 8)], *dp;-
176-
177 if (len_bits < 0
len_bits < 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • test_sshbuf
|| len_bytes > (16384 / 8)
len_bytes > (16384 / 8)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • test_sshbuf
)
0-4
178 return
never executed: return -10;
-10;
never executed: return -10;
0
179 if (BN_bn2bin(v, d) != (int)len_bytes
BN_bn2bin(v, d...(int)len_bytesDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • test_sshbuf
)
0-4
180 return
never executed: return -1;
-1;
never executed: return -1;
0
181 if ((
(r = sshbuf_re...+ 2, &dp)) < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
r = sshbuf_reserve(buf, len_bytes + 2, &dp)) < 0
(r = sshbuf_re...+ 2, &dp)) < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
) {
2
182 explicit_bzero(d, sizeof(d));-
183 return
executed 2 times by 1 test: return r;
Executed by:
  • test_sshbuf
r;
executed 2 times by 1 test: return r;
Executed by:
  • test_sshbuf
2
184 }-
185 do { const u_int16_t __v = (len_bits); ((u_char *)(dp))[0] = (__v >> 8) & 0xff; ((u_char *)(dp))[1] = __v & 0xff; } while (0);-
186 if (len_bytes != 0
len_bytes != 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • test_sshbuf
FALSEnever evaluated
)
0-2
187 memcpy(dp + 2, d, len_bytes);
executed 2 times by 1 test: memcpy(dp + 2, d, len_bytes);
Executed by:
  • test_sshbuf
2
188 explicit_bzero(d, sizeof(d));-
189 return
executed 2 times by 1 test: return 0;
Executed by:
  • test_sshbuf
0;
executed 2 times by 1 test: return 0;
Executed by:
  • test_sshbuf
2
190}-
191-
192-
193int-
194sshbuf_put_ec(struct sshbuf *buf, const EC_POINT *v, const EC_GROUP *g)-
195{-
196 u_char d[((528 * 2 / 8) + 1)];-
197 BN_CTX *bn_ctx;-
198 size_t len;-
199 int ret;-
200-
201 if ((
(bn_ctx = BN_C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
bn_ctx = BN_CTX_new()) ==
(bn_ctx = BN_C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
0-412
202 ((void *)0)
(bn_ctx = BN_C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
0-412
203 )-
204 return
never executed: return -2;
-2;
never executed: return -2;
0
205 if ((
(len = EC_POIN... * 2 / 8) + 1)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
len = EC_POINT_point2oct(g, v, POINT_CONVERSION_UNCOMPRESSED,
(len = EC_POIN... * 2 / 8) + 1)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
0-412
206
(len = EC_POIN... * 2 / 8) + 1)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
0-412
207 ((void *)0)
(len = EC_POIN... * 2 / 8) + 1)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
0-412
208 , 0, bn_ctx)) > ((528 * 2 / 8) + 1)
(len = EC_POIN... * 2 / 8) + 1)Description
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
0-412
209 BN_CTX_free(bn_ctx);-
210 return
never executed: return -10;
-10;
never executed: return -10;
0
211 }-
212 if (EC_POINT_point2oct(g, v, POINT_CONVERSION_UNCOMPRESSED,
EC_POINT_point...bn_ctx) != lenDescription
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
0-412
213 d, len, bn_ctx) != len
EC_POINT_point...bn_ctx) != lenDescription
TRUEnever evaluated
FALSEevaluated 412 times by 4 tests
Evaluated by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
) {
0-412
214 BN_CTX_free(bn_ctx);-
215 return
never executed: return -1;
-1;
never executed: return -1;
0
216 }-
217 BN_CTX_free(bn_ctx);-
218 ret = sshbuf_put_string(buf, d, len);-
219 explicit_bzero(d, len);-
220 return
executed 412 times by 4 tests: return ret;
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
ret;
executed 412 times by 4 tests: return ret;
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
412
221}-
222-
223int-
224sshbuf_put_eckey(struct sshbuf *buf, const EC_KEY *v)-
225{-
226 return
executed 52 times by 4 tests: return sshbuf_put_ec(buf, EC_KEY_get0_public_key(v), EC_KEY_get0_group(v));
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
sshbuf_put_ec(buf, EC_KEY_get0_public_key(v),
executed 52 times by 4 tests: return sshbuf_put_ec(buf, EC_KEY_get0_public_key(v), EC_KEY_get0_group(v));
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
52
227 EC_KEY_get0_group(v));
executed 52 times by 4 tests: return sshbuf_put_ec(buf, EC_KEY_get0_public_key(v), EC_KEY_get0_group(v));
Executed by:
  • ssh-keygen
  • test_kex
  • test_sshbuf
  • test_sshkey
52
228}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2