speling (from Tomas Olsson)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11531 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -51,7 +51,7 @@ RCSID("$Id$");
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
make_you_loose_packet(int code, krb5_data *reply)
|
make_you_lose_packet(int code, krb5_data *reply)
|
||||||
{
|
{
|
||||||
krb5_data_alloc(reply, KADM_VERSIZE + 4);
|
krb5_data_alloc(reply, KADM_VERSIZE + 4);
|
||||||
memcpy(reply->data, KADM_ULOSE, KADM_VERSIZE);
|
memcpy(reply->data, KADM_ULOSE, KADM_VERSIZE);
|
||||||
@@ -814,7 +814,7 @@ decode_packet(krb5_context context,
|
|||||||
|
|
||||||
if(message.length < KADM_VERSIZE + 4
|
if(message.length < KADM_VERSIZE + 4
|
||||||
|| strncmp(msg, KADM_VERSTR, KADM_VERSIZE) != 0) {
|
|| strncmp(msg, KADM_VERSTR, KADM_VERSIZE) != 0) {
|
||||||
make_you_loose_packet (KADM_BAD_VER, reply);
|
make_you_lose_packet (KADM_BAD_VER, reply);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -826,7 +826,7 @@ decode_packet(krb5_context context,
|
|||||||
if(rlen > message.length - KADM_VERSIZE - 4
|
if(rlen > message.length - KADM_VERSIZE - 4
|
||||||
|| authent.length > MAX_KTXT_LEN) {
|
|| authent.length > MAX_KTXT_LEN) {
|
||||||
krb5_warnx(context, "received bad rlen (%lu)", (unsigned long)rlen);
|
krb5_warnx(context, "received bad rlen (%lu)", (unsigned long)rlen);
|
||||||
make_you_loose_packet (KADM_LENGTH_ERROR, reply);
|
make_you_lose_packet (KADM_LENGTH_ERROR, reply);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -841,7 +841,7 @@ decode_packet(krb5_context context,
|
|||||||
"changepw", "kerberos", NULL);
|
"changepw", "kerberos", NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
krb5_warn (context, ret, "krb5_make_principal");
|
krb5_warn (context, ret, "krb5_make_principal");
|
||||||
make_you_loose_packet (KADM_NOMEM, reply);
|
make_you_lose_packet (KADM_NOMEM, reply);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ret = krb5_kt_get_entry (context, keytab, principal, 0,
|
ret = krb5_kt_get_entry (context, keytab, principal, 0,
|
||||||
@@ -849,7 +849,7 @@ decode_packet(krb5_context context,
|
|||||||
krb5_kt_close (context, keytab);
|
krb5_kt_close (context, keytab);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
krb5_free_principal(context, principal);
|
krb5_free_principal(context, principal);
|
||||||
make_you_loose_packet (KADM_NO_AUTH, reply);
|
make_you_lose_packet (KADM_NO_AUTH, reply);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ret = krb5_copy_keyblock (context, &entry.keyblock,& key);
|
ret = krb5_copy_keyblock (context, &entry.keyblock,& key);
|
||||||
@@ -857,10 +857,10 @@ decode_packet(krb5_context context,
|
|||||||
krb5_free_principal(context, principal);
|
krb5_free_principal(context, principal);
|
||||||
if(ret) {
|
if(ret) {
|
||||||
if(ret == KRB5_KT_NOTFOUND)
|
if(ret == KRB5_KT_NOTFOUND)
|
||||||
make_you_loose_packet(KADM_NO_AUTH, reply);
|
make_you_lose_packet(KADM_NO_AUTH, reply);
|
||||||
else
|
else
|
||||||
/* XXX */
|
/* XXX */
|
||||||
make_you_loose_packet(KADM_NO_AUTH, reply);
|
make_you_lose_packet(KADM_NO_AUTH, reply);
|
||||||
krb5_warn(context, ret, "krb5_kt_read_service_key");
|
krb5_warn(context, ret, "krb5_kt_read_service_key");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -876,7 +876,7 @@ decode_packet(krb5_context context,
|
|||||||
client_addr->sin_addr.s_addr, &ad, NULL);
|
client_addr->sin_addr.s_addr, &ad, NULL);
|
||||||
|
|
||||||
if(ret) {
|
if(ret) {
|
||||||
make_you_loose_packet(ERROR_TABLE_BASE_krb + ret, reply);
|
make_you_lose_packet(ERROR_TABLE_BASE_krb + ret, reply);
|
||||||
krb5_warnx(context, "krb_rd_req: %d", ret);
|
krb5_warnx(context, "krb_rd_req: %d", ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -885,7 +885,7 @@ decode_packet(krb5_context context,
|
|||||||
&client);
|
&client);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
krb5_warnx (context, "krb5_425_conv_principal: %d", ret);
|
krb5_warnx (context, "krb5_425_conv_principal: %d", ret);
|
||||||
make_you_loose_packet (KADM_NOMEM, reply);
|
make_you_lose_packet (KADM_NOMEM, reply);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,21 +899,21 @@ decode_packet(krb5_context context,
|
|||||||
&kadm_handle);
|
&kadm_handle);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
krb5_warn (context, ret, "kadm5_init_with_password_ctx");
|
krb5_warn (context, ret, "kadm5_init_with_password_ctx");
|
||||||
make_you_loose_packet (KADM_NOMEM, reply);
|
make_you_lose_packet (KADM_NOMEM, reply);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
checksum = des_quad_cksum((void *)(msg + off), NULL, rlen, 0, &ad.session);
|
checksum = des_quad_cksum((void *)(msg + off), NULL, rlen, 0, &ad.session);
|
||||||
if(checksum != ad.checksum) {
|
if(checksum != ad.checksum) {
|
||||||
krb5_warnx(context, "decode_packet: bad checksum");
|
krb5_warnx(context, "decode_packet: bad checksum");
|
||||||
make_you_loose_packet (KADM_BAD_CHK, reply);
|
make_you_lose_packet (KADM_BAD_CHK, reply);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
des_set_key(&ad.session, schedule);
|
des_set_key(&ad.session, schedule);
|
||||||
ret = krb_rd_priv(msg + off, rlen, schedule, &ad.session,
|
ret = krb_rd_priv(msg + off, rlen, schedule, &ad.session,
|
||||||
client_addr, admin_addr, &msg_dat);
|
client_addr, admin_addr, &msg_dat);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
make_you_loose_packet (ERROR_TABLE_BASE_krb + ret, reply);
|
make_you_lose_packet (ERROR_TABLE_BASE_krb + ret, reply);
|
||||||
krb5_warnx(context, "krb_rd_priv: %d", ret);
|
krb5_warnx(context, "krb_rd_priv: %d", ret);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -932,7 +932,7 @@ decode_packet(krb5_context context,
|
|||||||
schedule, &ad.session,
|
schedule, &ad.session,
|
||||||
admin_addr, client_addr);
|
admin_addr, client_addr);
|
||||||
if((ssize_t)reply->length < 0) {
|
if((ssize_t)reply->length < 0) {
|
||||||
make_you_loose_packet(KADM_NO_ENCRYPT, reply);
|
make_you_lose_packet(KADM_NO_ENCRYPT, reply);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user