|
Lines 162-167
Link Here
|
| 162 |
int mm_answer_gss_setup_ctx(int, Buffer *); |
162 |
int mm_answer_gss_setup_ctx(int, Buffer *); |
| 163 |
int mm_answer_gss_accept_ctx(int, Buffer *); |
163 |
int mm_answer_gss_accept_ctx(int, Buffer *); |
| 164 |
int mm_answer_gss_userok(int, Buffer *); |
164 |
int mm_answer_gss_userok(int, Buffer *); |
|
|
165 |
int mm_answer_gss_localname(int, Buffer *); |
| 165 |
int mm_answer_gss_checkmic(int, Buffer *); |
166 |
int mm_answer_gss_checkmic(int, Buffer *); |
| 166 |
#endif |
167 |
#endif |
| 167 |
|
168 |
|
|
Lines 202-213
Link Here
|
| 202 |
struct mon_table mon_dispatch_proto20[] = { |
203 |
struct mon_table mon_dispatch_proto20[] = { |
| 203 |
{MONITOR_REQ_MODULI, MON_ONCE, mm_answer_moduli}, |
204 |
{MONITOR_REQ_MODULI, MON_ONCE, mm_answer_moduli}, |
| 204 |
{MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, |
205 |
{MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, |
| 205 |
{MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, |
206 |
{MONITOR_REQ_PWNAM, MON_AUTH, mm_answer_pwnamallow}, |
| 206 |
{MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, |
207 |
{MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, |
| 207 |
{MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, |
208 |
{MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, |
| 208 |
{MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, |
209 |
{MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, |
| 209 |
#ifdef USE_PAM |
210 |
#ifdef USE_PAM |
| 210 |
{MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start}, |
211 |
{MONITOR_REQ_PAM_START, MON_ISAUTH, mm_answer_pam_start}, |
| 211 |
{MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account}, |
212 |
{MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account}, |
| 212 |
{MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx}, |
213 |
{MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx}, |
| 213 |
{MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, |
214 |
{MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query}, |
|
Lines 231-236
Link Here
|
| 231 |
{MONITOR_REQ_GSSSETUP, MON_ISAUTH, mm_answer_gss_setup_ctx}, |
232 |
{MONITOR_REQ_GSSSETUP, MON_ISAUTH, mm_answer_gss_setup_ctx}, |
| 232 |
{MONITOR_REQ_GSSSTEP, MON_ISAUTH, mm_answer_gss_accept_ctx}, |
233 |
{MONITOR_REQ_GSSSTEP, MON_ISAUTH, mm_answer_gss_accept_ctx}, |
| 233 |
{MONITOR_REQ_GSSUSEROK, MON_AUTH, mm_answer_gss_userok}, |
234 |
{MONITOR_REQ_GSSUSEROK, MON_AUTH, mm_answer_gss_userok}, |
|
|
235 |
{MONITOR_REQ_GSSLOCALNAME, MON_ISAUTH, mm_answer_gss_localname}, |
| 234 |
{MONITOR_REQ_GSSCHECKMIC, MON_ISAUTH, mm_answer_gss_checkmic}, |
236 |
{MONITOR_REQ_GSSCHECKMIC, MON_ISAUTH, mm_answer_gss_checkmic}, |
| 235 |
#endif |
237 |
#endif |
| 236 |
{0, 0, NULL} |
238 |
{0, 0, NULL} |
|
Lines 609-621
Link Here
|
| 609 |
|
611 |
|
| 610 |
debug3("%s", __func__); |
612 |
debug3("%s", __func__); |
| 611 |
|
613 |
|
| 612 |
if (authctxt->attempt++ != 0) |
|
|
| 613 |
fatal("%s: multiple attempts for getpwnam", __func__); |
| 614 |
|
| 615 |
username = buffer_get_string(m, NULL); |
614 |
username = buffer_get_string(m, NULL); |
| 616 |
|
615 |
|
| 617 |
pwent = getpwnamallow(username); |
616 |
pwent = getpwnamallow(username); |
| 618 |
|
617 |
|
|
|
618 |
if (authctxt->user) xfree(authctxt->user); |
| 619 |
authctxt->user = xstrdup(username); |
619 |
authctxt->user = xstrdup(username); |
| 620 |
setproctitle("%s [priv]", pwent ? username : "unknown"); |
620 |
setproctitle("%s [priv]", pwent ? username : "unknown"); |
| 621 |
xfree(username); |
621 |
xfree(username); |
|
Lines 1950-1954
Link Here
|
| 1950 |
|
1950 |
|
| 1951 |
/* Monitor loop will terminate if authenticated */ |
1951 |
/* Monitor loop will terminate if authenticated */ |
| 1952 |
return (authenticated); |
1952 |
return (authenticated); |
|
|
1953 |
} |
| 1954 |
|
| 1955 |
int |
| 1956 |
mm_answer_gss_localname(int socket, Buffer *m) { |
| 1957 |
char *name; |
| 1958 |
|
| 1959 |
ssh_gssapi_localname(&name); |
| 1960 |
|
| 1961 |
buffer_clear(m); |
| 1962 |
if (name) { |
| 1963 |
buffer_put_cstring(m, name); |
| 1964 |
debug3("%s: sending result %s", __func__, name); |
| 1965 |
xfree(name); |
| 1966 |
} else { |
| 1967 |
buffer_put_cstring(m, ""); |
| 1968 |
debug3("%s: sending result \"\"", __func__); |
| 1969 |
} |
| 1970 |
|
| 1971 |
mm_request_send(socket, MONITOR_ANS_GSSLOCALNAME, m); |
| 1972 |
|
| 1973 |
return(0); |
| 1953 |
} |
1974 |
} |
| 1954 |
#endif /* GSSAPI */ |
1975 |
#endif /* GSSAPI */ |