|
|
674526 |
diff
|
|
|
674526 |
index b410965..f1b873d 100644
|
|
|
674526 |
|
|
|
674526 |
|
|
|
674526 |
@@ -1084,9 +1084,7 @@ extern KbdintDevice sshpam_device;
|
|
|
674526 |
int
|
|
|
674526 |
mm_answer_pam_init_ctx(int sock, Buffer *m)
|
|
|
674526 |
{
|
|
|
674526 |
-
|
|
|
674526 |
debug3("%s", __func__);
|
|
|
674526 |
- authctxt->user = buffer_get_string(m, NULL);
|
|
|
674526 |
sshpam_ctxt = (sshpam_device.init_ctx)(authctxt);
|
|
|
674526 |
sshpam_authok = NULL;
|
|
|
674526 |
buffer_clear(m);
|
|
|
674526 |
@@ -1166,14 +1166,16 @@ mm_answer_pam_respond(int sock, Buffer *m)
|
|
|
674526 |
int
|
|
|
674526 |
mm_answer_pam_free_ctx(int sock, Buffer *m)
|
|
|
674526 |
{
|
|
|
674526 |
+ int r = sshpam_authok != NULL && sshpam_authok == sshpam_ctxt;
|
|
|
674526 |
|
|
|
674526 |
debug3("%s", __func__);
|
|
|
674526 |
(sshpam_device.free_ctx)(sshpam_ctxt);
|
|
|
674526 |
+ sshpam_ctxt = sshpam_authok = NULL;
|
|
|
674526 |
buffer_clear(m);
|
|
|
674526 |
mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m);
|
|
|
674526 |
auth_method = "keyboard-interactive";
|
|
|
674526 |
auth_submethod = "pam";
|
|
|
674526 |
- return (sshpam_authok == sshpam_ctxt);
|
|
|
674526 |
+ return r;
|
|
|
674526 |
}
|
|
|
674526 |
#endif
|
|
|
674526 |
|
|
|
674526 |
diff
|
|
|
674526 |
index e6217b3..eac421b 100644
|
|
|
674526 |
|
|
|
674526 |
|
|
|
674526 |
@@ -614,7 +614,6 @@ mm_sshpam_init_ctx(Authctxt *authctxt)
|
|
|
674526 |
|
|
|
674526 |
debug3("%s", __func__);
|
|
|
674526 |
buffer_init(&m);
|
|
|
674526 |
- buffer_put_cstring(&m, authctxt->user);
|
|
|
674526 |
mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m);
|
|
|
674526 |
debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__);
|
|
|
674526 |
mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_INIT_CTX, &m);
|