OpenCoverage

monitor_wrap.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssh/src/monitor_wrap.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22extern struct monitor *pmonitor;-
23extern struct sshbuf *loginmsg;-
24extern ServerOptions options;-
25-
26void-
27mm_log_handler(LogLevel level, const char *msg, void *ctx)-
28{-
29 struct sshbuf *log_msg;-
30 struct monitor *mon = (struct monitor *)ctx;-
31 int r;-
32 size_t len;-
33-
34 if (mon->m_log_sendfd == -1
mon->m_log_sendfd == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
35 fatal("%s: no log channel", __func__);
never executed: fatal("%s: no log channel", __func__);
0
36-
37 if ((
(log_msg = ssh...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
log_msg = sshbuf_new()) ==
(log_msg = ssh...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
38 ((void *)0)
(log_msg = ssh...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
39 )-
40 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
41-
42 if ((
(r = sshbuf_pu..._msg, 0)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(log_msg, 0)) != 0
(r = sshbuf_pu..._msg, 0)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
43 (
(r = sshbuf_pu..., level)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(log_msg, level)) != 0
(r = sshbuf_pu..., level)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
44 (
(r = sshbuf_pu...sg, msg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(log_msg, msg)) != 0
(r = sshbuf_pu...sg, msg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
45 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
46 if ((
(len = sshbuf_...(log_msg)) < 4Description
TRUEnever evaluated
FALSEnever evaluated
len = sshbuf_len(log_msg)) < 4
(len = sshbuf_...(log_msg)) < 4Description
TRUEnever evaluated
FALSEnever evaluated
|| len > 0xffffffff
len > 0xffffffffDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
47 fatal("%s: bad length %zu", __func__, len);
never executed: fatal("%s: bad length %zu", __func__, len);
0
48 do { const u_int32_t __v = (len - 4); ((u_char *)(sshbuf_mutable_ptr(log_msg)))[0] = (__v >> 24) & 0xff; ((u_char *)(sshbuf_mutable_ptr(log_msg)))[1] = (__v >> 16) & 0xff; ((u_char *)(sshbuf_mutable_ptr(log_msg)))[2] = (__v >> 8) & 0xff; ((u_char *)(sshbuf_mutable_ptr(log_msg)))[3] = __v & 0xff; } while (0);-
49 if (atomicio((ssize_t (*)(int, void *, size_t))write, mon->m_log_sendfd,
atomicio((ssiz...), len) != lenDescription
TRUEnever evaluated
FALSEnever evaluated
0
50 sshbuf_mutable_ptr(log_msg), len) != len
atomicio((ssiz...), len) != lenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
51 fatal("%s: write: %s", __func__, strerror(
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
52 (*__errno_location ())
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
53 ));
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
54 sshbuf_free(log_msg);-
55}
never executed: end of block
0
56-
57int-
58mm_is_monitor(void)-
59{-
60-
61-
62-
63-
64 return
never executed: return (pmonitor && pmonitor->m_pid > 0);
(pmonitor
pmonitorDescription
TRUEnever evaluated
FALSEnever evaluated
&& pmonitor->m_pid > 0
pmonitor->m_pid > 0Description
TRUEnever evaluated
FALSEnever evaluated
);
never executed: return (pmonitor && pmonitor->m_pid > 0);
0
65}-
66-
67void-
68mm_request_send(int sock, enum monitor_reqtype type, struct sshbuf *m)-
69{-
70 size_t mlen = sshbuf_len(m);-
71 u_char buf[5];-
72-
73 debug3("%s entering: type %d", __func__, type);-
74-
75 if (mlen >= 0xffffffff
mlen >= 0xffffffffDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
76 fatal("%s: bad length %zu", __func__, mlen);
never executed: fatal("%s: bad length %zu", __func__, mlen);
0
77 do { const u_int32_t __v = (mlen + 1); ((u_char *)(buf))[0] = (__v >> 24) & 0xff; ((u_char *)(buf))[1] = (__v >> 16) & 0xff; ((u_char *)(buf))[2] = (__v >> 8) & 0xff; ((u_char *)(buf))[3] = __v & 0xff; } while (0);-
78 buf[4] = (u_char) type;-
79 if (atomicio((ssize_t (*)(int, void *, size_t))write, sock, buf, sizeof(buf)) != sizeof(buf)
atomicio((ssiz...!= sizeof(buf)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
80 fatal("%s: write: %s", __func__, strerror(
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
81 (*__errno_location ())
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
82 ));
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
83 if (atomicio((ssize_t (*)(int, void *, size_t))write, sock, sshbuf_mutable_ptr(m), mlen) != mlen
atomicio((ssiz... mlen) != mlenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
84 fatal("%s: write: %s", __func__, strerror(
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
85 (*__errno_location ())
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
86 ));
never executed: fatal("%s: write: %s", __func__, strerror( (*__errno_location ()) ));
0
87}
never executed: end of block
0
88-
89void-
90mm_request_receive(int sock, struct sshbuf *m)-
91{-
92 u_char buf[4], *p = -
93 ((void *)0)-
94 ;-
95 u_int msg_len;-
96 int r;-
97-
98 debug3("%s entering", __func__);-
99-
100 if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)
atomicio(read,...!= sizeof(buf)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
101 if (-
102 (*
(*__errno_location ()) == 32Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) == 32Description
TRUEnever evaluated
FALSEnever evaluated
0
103 ==
(*__errno_location ()) == 32Description
TRUEnever evaluated
FALSEnever evaluated
0
104 32
(*__errno_location ()) == 32Description
TRUEnever evaluated
FALSEnever evaluated
0
105 )-
106 cleanup_exit(255);
never executed: cleanup_exit(255);
0
107 fatal("%s: read: %s", __func__, strerror(-
108 (*__errno_location ())-
109 ));-
110 }
never executed: end of block
0
111 msg_len = (((u_int32_t)(((const u_char *)(buf))[0]) << 24) | ((u_int32_t)(((const u_char *)(buf))[1]) << 16) | ((u_int32_t)(((const u_char *)(buf))[2]) << 8) | (u_int32_t)(((const u_char *)(buf))[3]));-
112 if (msg_len > 256 * 1024
msg_len > 256 * 1024Description
TRUEnever evaluated
FALSEnever evaluated
)
0
113 fatal("%s: read: bad msg_len %d", __func__, msg_len);
never executed: fatal("%s: read: bad msg_len %d", __func__, msg_len);
0
114 sshbuf_reset(m);-
115 if ((
(r = sshbuf_re...len, &p)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_reserve(m, msg_len, &p)) != 0
(r = sshbuf_re...len, &p)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
116 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
117 if (atomicio(read, sock, p, msg_len) != msg_len
atomicio(read,...en) != msg_lenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
118 fatal("%s: read: %s", __func__, strerror(
never executed: fatal("%s: read: %s", __func__, strerror( (*__errno_location ()) ));
0
119 (*__errno_location ())
never executed: fatal("%s: read: %s", __func__, strerror( (*__errno_location ()) ));
0
120 ));
never executed: fatal("%s: read: %s", __func__, strerror( (*__errno_location ()) ));
0
121}
never executed: end of block
0
122-
123void-
124mm_request_receive_expect(int sock, enum monitor_reqtype type, struct sshbuf *m)-
125{-
126 u_char rtype;-
127 int r;-
128-
129 debug3("%s entering: type %d", __func__, type);-
130-
131 mm_request_receive(sock, m);-
132 if ((
(r = sshbuf_ge... &rtype)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u8(m, &rtype)) != 0
(r = sshbuf_ge... &rtype)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
133 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
134 if (rtype != type
rtype != typeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
135 fatal("%s: read: rtype %d != type %d", __func__,
never executed: fatal("%s: read: rtype %d != type %d", __func__, rtype, type);
0
136 rtype, type);
never executed: fatal("%s: read: rtype %d != type %d", __func__, rtype, type);
0
137}
never executed: end of block
0
138-
139-
140DH *-
141mm_choose_dh(int min, int nbits, int max)-
142{-
143 BIGNUM *p, *g;-
144 int r;-
145 u_char success = 0;-
146 struct sshbuf *m;-
147-
148 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
149 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
150 )-
151 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
152 if ((
(r = sshbuf_pu...(m, min)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, min)) != 0
(r = sshbuf_pu...(m, min)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
153 (
(r = sshbuf_pu..., nbits)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, nbits)) != 0
(r = sshbuf_pu..., nbits)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
154 (
(r = sshbuf_pu...(m, max)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, max)) != 0
(r = sshbuf_pu...(m, max)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
155 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
156-
157 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_MODULI, m);-
158-
159 debug3("%s: waiting for MONITOR_ANS_MODULI", __func__);-
160 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_MODULI, m);-
161-
162 if ((
(r = sshbuf_ge...success)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u8(m, &success)) != 0
(r = sshbuf_ge...success)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
163 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
164 if (success == 0
success == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
165 fatal("%s: MONITOR_ANS_MODULI failed", __func__);
never executed: fatal("%s: MONITOR_ANS_MODULI failed", __func__);
0
166-
167 if ((
(p = BN_new()) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
p = BN_new()) ==
(p = BN_new()) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
168 ((void *)0)
(p = BN_new()) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
169 )-
170 fatal("%s: BN_new failed", __func__);
never executed: fatal("%s: BN_new failed", __func__);
0
171 if ((
(g = BN_new()) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
g = BN_new()) ==
(g = BN_new()) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
172 ((void *)0)
(g = BN_new()) == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
173 )-
174 fatal("%s: BN_new failed", __func__);
never executed: fatal("%s: BN_new failed", __func__);
0
175 if ((
(r = sshbuf_ge...m2(m, p)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_bignum2(m, p)) != 0
(r = sshbuf_ge...m2(m, p)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
176 (
(r = sshbuf_ge...m2(m, g)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_bignum2(m, g)) != 0
(r = sshbuf_ge...m2(m, g)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
177 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
178-
179 debug3("%s: remaining %zu", __func__, sshbuf_len(m));-
180 sshbuf_free(m);-
181-
182 return
never executed: return (dh_new_group(g, p));
(dh_new_group(g, p));
never executed: return (dh_new_group(g, p));
0
183}-
184-
185-
186int-
187mm_sshkey_sign(struct sshkey *key, u_char **sigp, size_t *lenp,-
188 const u_char *data, size_t datalen, const char *hostkey_alg, u_int compat)-
189{-
190 struct kex *kex = *pmonitor->m_pkex;-
191 struct sshbuf *m;-
192 u_int ndx = kex->host_key_index(key, 0, active_state);-
193 int r;-
194-
195 debug3("%s entering", __func__);-
196-
197 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
198 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
199 )-
200 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
201 if ((
(r = sshbuf_pu...(m, ndx)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, ndx)) != 0
(r = sshbuf_pu...(m, ndx)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
202 (
(r = sshbuf_pu...datalen)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_string(m, data, datalen)) != 0
(r = sshbuf_pu...datalen)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
203 (
(r = sshbuf_pu...key_alg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, hostkey_alg)) != 0
(r = sshbuf_pu...key_alg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
204 (
(r = sshbuf_pu... compat)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, compat)) != 0
(r = sshbuf_pu... compat)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
205 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
206-
207 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SIGN, m);-
208-
209 debug3("%s: waiting for MONITOR_ANS_SIGN", __func__);-
210 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SIGN, m);-
211 if ((
(r = sshbuf_ge...p, lenp)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_string(m, sigp, lenp)) != 0
(r = sshbuf_ge...p, lenp)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
212 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
213 sshbuf_free(m);-
214-
215 return
never executed: return (0);
(0);
never executed: return (0);
0
216}-
217-
218struct passwd *-
219mm_getpwnamallow(const char *username)-
220{-
221 struct ssh *ssh = active_state;-
222 struct sshbuf *m;-
223 struct passwd *pw;-
224 size_t len;-
225 u_int i;-
226 ServerOptions *newopts;-
227 int r;-
228 u_char ok;-
229 const u_char *p;-
230-
231 debug3("%s entering", __func__);-
232-
233 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
234 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
235 )-
236 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
237 if ((
(r = sshbuf_pu...sername)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, username)) != 0
(r = sshbuf_pu...sername)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
238 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
239-
240 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PWNAM, m);-
241-
242 debug3("%s: waiting for MONITOR_ANS_PWNAM", __func__);-
243 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PWNAM, m);-
244-
245 if ((
(r = sshbuf_ge...(m, &ok)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u8(m, &ok)) != 0
(r = sshbuf_ge...(m, &ok)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
246 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
247 if (ok == 0
ok == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
248 pw = -
249 ((void *)0)-
250 ;-
251 goto
never executed: goto out;
out;
never executed: goto out;
0
252 }-
253-
254-
255 pw = xcalloc(sizeof(*pw), 1);-
256 if ((
(r = sshbuf_ge...p, &len)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_string_direct(m, &p, &len)) != 0
(r = sshbuf_ge...p, &len)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
257 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
258 if (len != sizeof(*pw)
len != sizeof(*pw)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
259 fatal("%s: struct passwd size mismatch", __func__);
never executed: fatal("%s: struct passwd size mismatch", __func__);
0
260 memcpy(pw, p, sizeof(*pw));-
261-
262 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &pw->pw_name,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
263 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
264 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
265 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &pw->pw_passwd,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
266 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
267 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
268-
269 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &pw->pw_gecos,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
270 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
271 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
272-
273-
274-
275-
276 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &pw->pw_dir,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
277 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
278 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
279 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &pw->pw_shell,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
280 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
281 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
282 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
283-
284out:
code before this statement never executed: out:
0
285-
286 if ((
(r = sshbuf_ge...p, &len)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_string_direct(m, &p, &len)) != 0
(r = sshbuf_ge...p, &len)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
287 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
288 if (len != sizeof(*newopts)
len != sizeof(*newopts)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
289 fatal("%s: option block size mismatch", __func__);
never executed: fatal("%s: option block size mismatch", __func__);
0
290 newopts = xcalloc(sizeof(*newopts), 1);-
291 memcpy(newopts, p, sizeof(*newopts));-
292 do { do { if (newopts->banner !=
newopts->banner != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
293((
newopts->banner != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->banner != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->banner != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
294) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->banner,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
295((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
296))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->trusted_user_ca_keys !=
newopts->trust...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
297((
newopts->trust...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->trust...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->trust...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
298) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->trusted_user_ca_keys,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
299((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
300))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->revoked_keys_file !=
newopts->revok...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
301((
newopts->revok...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->revok...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->revok...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
302) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->revoked_keys_file,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
303((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
304))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->authorized_keys_command !=
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
305((
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
306) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->authorized_keys_command,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
307((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
308))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->authorized_keys_command_user !=
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
309((
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
310) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->authorized_keys_command_user,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
311((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
312))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->authorized_principals_file !=
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
313((
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
314) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->authorized_principals_file,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
315((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
316))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->authorized_principals_command !=
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
317((
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
318) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->authorized_principals_command,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
319((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
320))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->authorized_principals_command_user !=
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
321((
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->autho...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
322) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->authorized_principals_command_user,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
323((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
324))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->hostbased_key_types !=
newopts->hostb...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
325((
newopts->hostb...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->hostb...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->hostb...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
326) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->hostbased_key_types,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
327((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
328))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->pubkey_key_types !=
newopts->pubke...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
329((
newopts->pubke...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->pubke...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->pubke...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
330) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->pubkey_key_types,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
331((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
332))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->ca_sign_algorithms !=
newopts->ca_si...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
333((
newopts->ca_si...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->ca_si...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->ca_si...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
334) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->ca_sign_algorithms,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
335((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
336))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->routing_domain !=
newopts->routi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
337((
newopts->routi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->routi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->routi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
338) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->routing_domain,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
339((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
340))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { if (newopts->permit_user_env_whitelist !=
newopts->permi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
341((
newopts->permi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
newopts->permi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
newopts->permi...!= ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
342) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->permit_user_env_whitelist,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
343((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
344))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->authorized_keys_files = newopts->num_authkeys_files == 0
newopts->num_a...eys_files == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
345((void *)0) -
346: xcalloc(newopts->num_authkeys_files, sizeof(*newopts->authorized_keys_files)); for (i = 0; i < newopts->num_authkeys_files
i < newopts->n...authkeys_filesDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->authorized_keys_files[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
347((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
348))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->allow_users = newopts->num_allow_users == 0
newopts->num_allow_users == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
349((void *)0) -
350: xcalloc(newopts->num_allow_users, sizeof(*newopts->allow_users)); for (i = 0; i < newopts->num_allow_users
i < newopts->num_allow_usersDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->allow_users[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
351((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
352))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->deny_users = newopts->num_deny_users == 0
newopts->num_deny_users == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
353((void *)0) -
354: xcalloc(newopts->num_deny_users, sizeof(*newopts->deny_users)); for (i = 0; i < newopts->num_deny_users
i < newopts->num_deny_usersDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->deny_users[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
355((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
356))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->allow_groups = newopts->num_allow_groups == 0
newopts->num_allow_groups == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
357((void *)0) -
358: xcalloc(newopts->num_allow_groups, sizeof(*newopts->allow_groups)); for (i = 0; i < newopts->num_allow_groups
i < newopts->num_allow_groupsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->allow_groups[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
359((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
360))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->deny_groups = newopts->num_deny_groups == 0
newopts->num_deny_groups == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
361((void *)0) -
362: xcalloc(newopts->num_deny_groups, sizeof(*newopts->deny_groups)); for (i = 0; i < newopts->num_deny_groups
i < newopts->num_deny_groupsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->deny_groups[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
363((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
364))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->accept_env = newopts->num_accept_env == 0
newopts->num_accept_env == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
365((void *)0) -
366: xcalloc(newopts->num_accept_env, sizeof(*newopts->accept_env)); for (i = 0; i < newopts->num_accept_env
i < newopts->num_accept_envDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->accept_env[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
367((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
368))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->auth_methods = newopts->num_auth_methods == 0
newopts->num_auth_methods == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
369((void *)0) -
370: xcalloc(newopts->num_auth_methods, sizeof(*newopts->auth_methods)); for (i = 0; i < newopts->num_auth_methods
i < newopts->num_auth_methodsDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->auth_methods[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
371((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
372))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->permitted_opens = newopts->num_permitted_opens == 0
newopts->num_p...ted_opens == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
373((void *)0) -
374: xcalloc(newopts->num_permitted_opens, sizeof(*newopts->permitted_opens)); for (i = 0; i < newopts->num_permitted_opens
i < newopts->n...ermitted_opensDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->permitted_opens[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
375((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
376))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); do { newopts->permitted_listens = newopts->num_permitted_listens == 0
newopts->num_p...d_listens == 0Description
TRUEnever evaluated
FALSEnever evaluated
?
0
377((void *)0) -
378: xcalloc(newopts->num_permitted_listens, sizeof(*newopts->permitted_listens)); for (i = 0; i < newopts->num_permitted_listens
i < newopts->n...mitted_listensDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) { if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &newopts->permitted_listens[i],
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
379((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
380))
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
!= 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
}
never executed: end of block
} while (0); } while (0);
0
381-
382-
383-
384 copy_set_server_options(&options, newopts, 1);-
385 log_change_level(options.log_level);-
386 process_permitopen(ssh, &options);-
387 free(newopts);-
388-
389 sshbuf_free(m);-
390-
391 return
never executed: return (pw);
(pw);
never executed: return (pw);
0
392}-
393-
394char *-
395mm_auth2_read_banner(void)-
396{-
397 struct sshbuf *m;-
398 char *banner;-
399 int r;-
400-
401 debug3("%s entering", __func__);-
402-
403 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
404 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
405 )-
406 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
407 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, m);-
408 sshbuf_reset(m);-
409-
410 mm_request_receive_expect(pmonitor->m_recvfd,-
411 MONITOR_ANS_AUTH2_READ_BANNER, m);-
412 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &banner,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
413 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
414 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
415 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
416 sshbuf_free(m);-
417-
418-
419 if (strlen(banner) == 0
strlen(banner) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
420 free(banner);-
421 banner = -
422 ((void *)0)-
423 ;-
424 }
never executed: end of block
0
425 return
never executed: return (banner);
(banner);
never executed: return (banner);
0
426}-
427-
428-
429-
430void-
431mm_inform_authserv(char *service, char *style)-
432{-
433 struct sshbuf *m;-
434 int r;-
435-
436 debug3("%s entering", __func__);-
437-
438 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
439 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
440 )-
441 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
442 if ((
(r = sshbuf_pu...service)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, service)) != 0
(r = sshbuf_pu...service)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
443 (
(r = sshbuf_pu...le : "")) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, style ? style : "")) != 0
(r = sshbuf_pu...le : "")) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
444 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
445-
446 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, m);-
447-
448 sshbuf_free(m);-
449}
never executed: end of block
0
450-
451-
452int-
453mm_auth_password(struct ssh *ssh, char *password)-
454{-
455 struct sshbuf *m;-
456 int r, authenticated = 0;-
457-
458-
459-
460-
461 debug3("%s entering", __func__);-
462-
463 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
464 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
465 )-
466 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
467 if ((
(r = sshbuf_pu...assword)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, password)) != 0
(r = sshbuf_pu...assword)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
468 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
469 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHPASSWORD, m);-
470-
471 debug3("%s: waiting for MONITOR_ANS_AUTHPASSWORD", __func__);-
472 mm_request_receive_expect(pmonitor->m_recvfd,-
473 MONITOR_ANS_AUTHPASSWORD, m);-
474-
475 if ((
(r = sshbuf_ge...ticated)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &authenticated)) != 0
(r = sshbuf_ge...ticated)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
476 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
477 sshbuf_free(m);-
478-
479 debug3("%s: user %sauthenticated",-
480 __func__, authenticated ? "" : "not ");-
481 return
never executed: return (authenticated);
(authenticated);
never executed: return (authenticated);
0
482}-
483-
484int-
485mm_user_key_allowed(struct ssh *ssh, struct passwd *pw, struct sshkey *key,-
486 int pubkey_auth_attempt, struct sshauthopt **authoptp)-
487{-
488 return
never executed: return (mm_key_allowed(MM_USERKEY, ((void *)0) , ((void *)0) , key, pubkey_auth_attempt, authoptp));
(mm_key_allowed(MM_USERKEY,
never executed: return (mm_key_allowed(MM_USERKEY, ((void *)0) , ((void *)0) , key, pubkey_auth_attempt, authoptp));
0
489 ((void *)0)
never executed: return (mm_key_allowed(MM_USERKEY, ((void *)0) , ((void *)0) , key, pubkey_auth_attempt, authoptp));
0
490 ,
never executed: return (mm_key_allowed(MM_USERKEY, ((void *)0) , ((void *)0) , key, pubkey_auth_attempt, authoptp));
0
491 ((void *)0)
never executed: return (mm_key_allowed(MM_USERKEY, ((void *)0) , ((void *)0) , key, pubkey_auth_attempt, authoptp));
0
492 , key,
never executed: return (mm_key_allowed(MM_USERKEY, ((void *)0) , ((void *)0) , key, pubkey_auth_attempt, authoptp));
0
493 pubkey_auth_attempt, authoptp));
never executed: return (mm_key_allowed(MM_USERKEY, ((void *)0) , ((void *)0) , key, pubkey_auth_attempt, authoptp));
0
494}-
495-
496int-
497mm_hostbased_key_allowed(struct passwd *pw, const char *user, const char *host,-
498 struct sshkey *key)-
499{-
500 return
never executed: return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, ((void *)0) ));
(mm_key_allowed(MM_HOSTKEY, user, host, key, 0,
never executed: return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, ((void *)0) ));
0
501 ((void *)0)
never executed: return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, ((void *)0) ));
0
502 ));
never executed: return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, ((void *)0) ));
0
503}-
504-
505int-
506mm_key_allowed(enum mm_keytype type, const char *user, const char *host,-
507 struct sshkey *key, int pubkey_auth_attempt, struct sshauthopt **authoptp)-
508{-
509 struct sshbuf *m;-
510 int r, allowed = 0;-
511 struct sshauthopt *opts = -
512 ((void *)0)-
513 ;-
514-
515 debug3("%s entering", __func__);-
516-
517 if (authoptp !=
authoptp != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
518 ((void *)0)
authoptp != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
519 )-
520 *
never executed: *authoptp = ((void *)0) ;
authoptp =
never executed: *authoptp = ((void *)0) ;
0
521 ((void *)0)
never executed: *authoptp = ((void *)0) ;
0
522 ;
never executed: *authoptp = ((void *)0) ;
0
523-
524 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
525 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
526 )-
527 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
528 if ((
(r = sshbuf_pu...m, type)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, type)) != 0
(r = sshbuf_pu...m, type)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
529 (
(r = sshbuf_pu...er : "")) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, user ? user : "")) != 0
(r = sshbuf_pu...er : "")) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
530 (
(r = sshbuf_pu...st : "")) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, host ? host : "")) != 0
(r = sshbuf_pu...st : "")) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
531 (
(r = sshkey_puts(key, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshkey_puts(key, m)) != 0
(r = sshkey_puts(key, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
532 (
(r = sshbuf_pu...attempt)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_u32(m, pubkey_auth_attempt)) != 0
(r = sshbuf_pu...attempt)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
533 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
534-
535 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, m);-
536-
537 debug3("%s: waiting for MONITOR_ANS_KEYALLOWED", __func__);-
538 mm_request_receive_expect(pmonitor->m_recvfd,-
539 MONITOR_ANS_KEYALLOWED, m);-
540-
541 if ((
(r = sshbuf_ge...allowed)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &allowed)) != 0
(r = sshbuf_ge...allowed)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
542 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
543 if (allowed
allowedDescription
TRUEnever evaluated
FALSEnever evaluated
&& type == MM_USERKEY
type == MM_USERKEYDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
544 if ((
(r = sshauthop..., &opts)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshauthopt_deserialise(m, &opts)) != 0
(r = sshauthop..., &opts)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
545 fatal("%s: sshauthopt_deserialise: %s",
never executed: fatal("%s: sshauthopt_deserialise: %s", __func__, ssh_err(r));
0
546 __func__, ssh_err(r));
never executed: fatal("%s: sshauthopt_deserialise: %s", __func__, ssh_err(r));
0
547 }
never executed: end of block
0
548 sshbuf_free(m);-
549-
550 if (authoptp !=
authoptp != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
551 ((void *)0)
authoptp != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
552 ) {-
553 *authoptp = opts;-
554 opts = -
555 ((void *)0)-
556 ;-
557 }
never executed: end of block
0
558 sshauthopt_free(opts);-
559-
560 return
never executed: return allowed;
allowed;
never executed: return allowed;
0
561}-
562-
563-
564-
565-
566-
567-
568-
569int-
570mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,-
571 const u_char *data, size_t datalen, const char *sigalg, u_int compat)-
572{-
573 struct sshbuf *m;-
574 u_int encoded_ret = 0;-
575 int r;-
576-
577 debug3("%s entering", __func__);-
578-
579-
580 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
581 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
582 )-
583 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
584 if ((
(r = sshkey_puts(key, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshkey_puts(key, m)) != 0
(r = sshkey_puts(key, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
585 (
(r = sshbuf_pu... siglen)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_string(m, sig, siglen)) != 0
(r = sshbuf_pu... siglen)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
586 (
(r = sshbuf_pu...datalen)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_string(m, data, datalen)) != 0
(r = sshbuf_pu...datalen)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
587 (
(r = sshbuf_pu... sigalg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, sigalg ==
(r = sshbuf_pu... sigalg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
588 ((void *)0)
(r = sshbuf_pu... sigalg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
589 ? "" : sigalg)) != 0
(r = sshbuf_pu... sigalg)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
590 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
591-
592 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, m);-
593-
594 debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __func__);-
595 mm_request_receive_expect(pmonitor->m_recvfd,-
596 MONITOR_ANS_KEYVERIFY, m);-
597-
598 if ((
(r = sshbuf_ge...ded_ret)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &encoded_ret)) != 0
(r = sshbuf_ge...ded_ret)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
599 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
600-
601 sshbuf_free(m);-
602-
603 if (encoded_ret != 0
encoded_ret != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
604 return
never executed: return -21;
-21;
never executed: return -21;
0
605 return
never executed: return 0;
0;
never executed: return 0;
0
606}-
607-
608void-
609mm_send_keystate(struct monitor *monitor)-
610{-
611 struct ssh *ssh = active_state;-
612 struct sshbuf *m;-
613 int r;-
614-
615 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
616 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
617 )-
618 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
619 if ((
(r = ssh_packe...(ssh, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = ssh_packet_get_state(ssh, m)) != 0
(r = ssh_packe...(ssh, m)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
620 fatal("%s: get_state failed: %s",
never executed: fatal("%s: get_state failed: %s", __func__, ssh_err(r));
0
621 __func__, ssh_err(r));
never executed: fatal("%s: get_state failed: %s", __func__, ssh_err(r));
0
622 mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, m);-
623 debug3("%s: Finished sending state", __func__);-
624 sshbuf_free(m);-
625}
never executed: end of block
0
626-
627int-
628mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)-
629{-
630 struct sshbuf *m;-
631 char *p, *msg;-
632 int success = 0, tmp1 = -1, tmp2 = -1, r;-
633-
634-
635 if ((
(tmp1 = dup(pm...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
tmp1 = dup(pmonitor->m_recvfd)) == -1
(tmp1 = dup(pm...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
||
0
636 (
(tmp2 = dup(pm...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
tmp2 = dup(pmonitor->m_recvfd)) == -1
(tmp2 = dup(pm...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
637 error("%s: cannot allocate fds for pty", __func__);-
638 if (tmp1 > 0
tmp1 > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
639 close(tmp1);
never executed: close(tmp1);
0
640 if (tmp2 > 0
tmp2 > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
641 close(tmp2);
never executed: close(tmp2);
0
642 return
never executed: return 0;
0;
never executed: return 0;
0
643 }-
644 close(tmp1);-
645 close(tmp2);-
646-
647 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
648 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
649 )-
650 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
651 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTY, m);-
652-
653 debug3("%s: waiting for MONITOR_ANS_PTY", __func__);-
654 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PTY, m);-
655-
656 if ((
(r = sshbuf_ge...success)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &success)) != 0
(r = sshbuf_ge...success)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
657 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
658 if (success == 0
success == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
659 debug3("%s: pty alloc failed", __func__);-
660 sshbuf_free(m);-
661 return
never executed: return (0);
(0);
never executed: return (0);
0
662 }-
663 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &p,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
664 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
665 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0
666 (
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &msg,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
667 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
668 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
669 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
670 sshbuf_free(m);-
671-
672 strlcpy(namebuf, p, namebuflen);-
673 free(p);-
674-
675 if ((
(r = sshbuf_pu...en(msg))) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put(loginmsg, msg, strlen(msg))) != 0
(r = sshbuf_pu...en(msg))) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
676 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
677 free(msg);-
678-
679 if ((*
(*ptyfd = mm_r...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
ptyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1
(*ptyfd = mm_r...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
||
0
680 (*
(*ttyfd = mm_r...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
ttyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1
(*ttyfd = mm_r...recvfd)) == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
681 fatal("%s: receive fds failed", __func__);
never executed: fatal("%s: receive fds failed", __func__);
0
682-
683-
684 return
never executed: return (1);
(1);
never executed: return (1);
0
685}-
686-
687void-
688mm_session_pty_cleanup2(Session *s)-
689{-
690 struct sshbuf *m;-
691 int r;-
692-
693 if (s->ttyfd == -1
s->ttyfd == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
694 return;
never executed: return;
0
695 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
696 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
697 )-
698 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
699 if ((
(r = sshbuf_pu... s->tty)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, s->tty)) != 0
(r = sshbuf_pu... s->tty)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
700 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
701 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTYCLEANUP, m);-
702 sshbuf_free(m);-
703-
704-
705 if (s->ptymaster != -1
s->ptymaster != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& close(s->ptymaster) < 0
close(s->ptymaster) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
706 error("close(s->ptymaster/%d): %s",
never executed: error("close(s->ptymaster/%d): %s", s->ptymaster, strerror( (*__errno_location ()) ));
0
707 s->ptymaster, strerror(
never executed: error("close(s->ptymaster/%d): %s", s->ptymaster, strerror( (*__errno_location ()) ));
0
708 (*__errno_location ())
never executed: error("close(s->ptymaster/%d): %s", s->ptymaster, strerror( (*__errno_location ()) ));
0
709 ));
never executed: error("close(s->ptymaster/%d): %s", s->ptymaster, strerror( (*__errno_location ()) ));
0
710-
711-
712 s->ttyfd = -1;-
713}
never executed: end of block
0
714void-
715mm_terminate(void)-
716{-
717 struct sshbuf *m;-
718-
719 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
720 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
721 )-
722 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
723 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_TERM, m);-
724 sshbuf_free(m);-
725}
never executed: end of block
0
726-
727static void-
728mm_chall_setup(char **name, char **infotxt, u_int *numprompts,-
729 char ***prompts, u_int **echo_on)-
730{-
731 *name = xstrdup("");-
732 *infotxt = xstrdup("");-
733 *numprompts = 1;-
734 *prompts = xcalloc(*numprompts, sizeof(char *));-
735 *echo_on = xcalloc(*numprompts, sizeof(u_int));-
736 (*echo_on)[0] = 0;-
737}
never executed: end of block
0
738-
739int-
740mm_bsdauth_query(void *ctx, char **name, char **infotxt,-
741 u_int *numprompts, char ***prompts, u_int **echo_on)-
742{-
743 struct sshbuf *m;-
744 u_int success;-
745 char *challenge;-
746 int r;-
747-
748 debug3("%s: entering", __func__);-
749-
750 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
751 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
752 )-
753 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
754 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, m);-
755-
756 mm_request_receive_expect(pmonitor->m_recvfd,-
757 MONITOR_ANS_BSDAUTHQUERY, m);-
758 if ((
(r = sshbuf_ge...success)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &success)) != 0
(r = sshbuf_ge...success)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
759 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
760 if (success == 0
success == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
761 debug3("%s: no challenge", __func__);-
762 sshbuf_free(m);-
763 return
never executed: return (-1);
(-1);
never executed: return (-1);
0
764 }-
765-
766-
767 if ((
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_cstring(m, &challenge,
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
768 ((void *)0)
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
769 )) != 0
(r = sshbuf_ge...d *)0) )) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
770 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
771 sshbuf_free(m);-
772-
773 mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);-
774 (*prompts)[0] = challenge;-
775-
776 debug3("%s: received challenge: %s", __func__, challenge);-
777-
778 return
never executed: return (0);
(0);
never executed: return (0);
0
779}-
780-
781int-
782mm_bsdauth_respond(void *ctx, u_int numresponses, char **responses)-
783{-
784 struct sshbuf *m;-
785 int r, authok;-
786-
787 debug3("%s: entering", __func__);-
788 if (numresponses != 1
numresponses != 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
789 return
never executed: return (-1);
(-1);
never executed: return (-1);
0
790-
791 if ((
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
m = sshbuf_new()) ==
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
792 ((void *)0)
(m = sshbuf_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
793 )-
794 fatal("%s: sshbuf_new failed", __func__);
never executed: fatal("%s: sshbuf_new failed", __func__);
0
795 if ((
(r = sshbuf_pu...nses[0])) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_put_cstring(m, responses[0])) != 0
(r = sshbuf_pu...nses[0])) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
796 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
797 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHRESPOND, m);-
798-
799 mm_request_receive_expect(pmonitor->m_recvfd,-
800 MONITOR_ANS_BSDAUTHRESPOND, m);-
801-
802 if ((
(r = sshbuf_ge...&authok)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
r = sshbuf_get_u32(m, &authok)) != 0
(r = sshbuf_ge...&authok)) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
803 fatal("%s: buffer error: %s", __func__, ssh_err(r));
never executed: fatal("%s: buffer error: %s", __func__, ssh_err(r));
0
804 sshbuf_free(m);-
805-
806 return
never executed: return ((authok == 0) ? -1 : 0);
((
(authok == 0)Description
TRUEnever evaluated
FALSEnever evaluated
authok == 0)
(authok == 0)Description
TRUEnever evaluated
FALSEnever evaluated
? -1 : 0);
never executed: return ((authok == 0) ? -1 : 0);
0
807}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2