version 1.40.2.3, 2003/04/03 22:35:16 |
version 1.41, 2002/06/19 00:27:55 |
|
|
|
|
if (kdata[0] == 4) { /* KRB_PROT_VERSION */ |
if (kdata[0] == 4) { /* KRB_PROT_VERSION */ |
#ifdef KRB4 |
#ifdef KRB4 |
KTEXT_ST tkt, reply; |
KTEXT_ST tkt; |
|
|
tkt.length = dlen; |
tkt.length = dlen; |
if (tkt.length < MAX_KTXT_LEN) |
if (tkt.length < MAX_KTXT_LEN) |
memcpy(tkt.dat, kdata, tkt.length); |
memcpy(tkt.dat, kdata, tkt.length); |
|
|
if (PRIVSEP(auth_krb4(authctxt, &tkt, |
if (auth_krb4(authctxt, &tkt, &client_user)) { |
&client_user, &reply))) { |
|
authenticated = 1; |
authenticated = 1; |
snprintf(info, sizeof(info), |
snprintf(info, sizeof(info), |
" tktuser %.100s", |
" tktuser %.100s", |
client_user); |
client_user); |
|
|
packet_start( |
|
SSH_SMSG_AUTH_KERBEROS_RESPONSE); |
|
packet_put_string((char *) |
|
reply.dat, reply.length); |
|
packet_send(); |
|
packet_write_wait(); |
|
|
|
xfree(client_user); |
xfree(client_user); |
} |
} |
#endif /* KRB4 */ |
#endif /* KRB4 */ |
} else { |
} else { |
#ifdef KRB5 |
#ifdef KRB5 |
krb5_data tkt, reply; |
krb5_data tkt; |
tkt.length = dlen; |
tkt.length = dlen; |
tkt.data = kdata; |
tkt.data = kdata; |
|
|
if (PRIVSEP(auth_krb5(authctxt, &tkt, |
if (auth_krb5(authctxt, &tkt, &client_user)) { |
&client_user, &reply))) { |
|
authenticated = 1; |
authenticated = 1; |
snprintf(info, sizeof(info), |
snprintf(info, sizeof(info), |
" tktuser %.100s", |
" tktuser %.100s", |
client_user); |
client_user); |
|
|
/* Send response to client */ |
|
packet_start( |
|
SSH_SMSG_AUTH_KERBEROS_RESPONSE); |
|
packet_put_string((char *) |
|
reply.data, reply.length); |
|
packet_send(); |
|
packet_write_wait(); |
|
|
|
if (reply.length) |
|
xfree(reply.data); |
|
xfree(client_user); |
xfree(client_user); |
} |
} |
#endif /* KRB5 */ |
#endif /* KRB5 */ |
|
|
debug("rcvd SSH_CMSG_AUTH_TIS_RESPONSE"); |
debug("rcvd SSH_CMSG_AUTH_TIS_RESPONSE"); |
if (options.challenge_response_authentication == 1) { |
if (options.challenge_response_authentication == 1) { |
char *response = packet_get_string(&dlen); |
char *response = packet_get_string(&dlen); |
|
debug("got response '%s'", response); |
packet_check_eom(); |
packet_check_eom(); |
authenticated = verify_response(authctxt, response); |
authenticated = verify_response(authctxt, response); |
memset(response, 'r', dlen); |
memset(response, 'r', dlen); |