switch to ET errors.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21574 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -151,7 +151,8 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(!config->enable_v4) {
|
if(!config->enable_v4) {
|
||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"Rejected version 4 request from %s", from);
|
"Rejected version 4 request from %s", from);
|
||||||
make_err_reply(context, reply, KDC_GEN_ERR, "function not enabled");
|
make_err_reply(context, reply, KRB4ET_KDC_GEN_ERR,
|
||||||
|
"Function not enabled");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +161,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(pvno != 4){
|
if(pvno != 4){
|
||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"Protocol version mismatch (krb4) (%d)", pvno);
|
"Protocol version mismatch (krb4) (%d)", pvno);
|
||||||
make_err_reply(context, reply, KDC_PKT_VER, "protocol mismatch");
|
make_err_reply(context, reply, KRB4ET_KDC_PKT_VER, "protocol mismatch");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
RCHECK(krb5_ret_int8(sp, &msg_type), out);
|
RCHECK(krb5_ret_int8(sp, &msg_type), out);
|
||||||
@@ -196,7 +197,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(ret) {
|
if(ret) {
|
||||||
kdc_log(context, config, 0, "Client not found in database: %s: %s",
|
kdc_log(context, config, 0, "Client not found in database: %s: %s",
|
||||||
client_name, krb5_get_err_text(context, ret));
|
client_name, krb5_get_err_text(context, ret));
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN,
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN,
|
||||||
"principal unknown");
|
"principal unknown");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -205,7 +206,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(ret){
|
if(ret){
|
||||||
kdc_log(context, config, 0, "Server not found in database: %s: %s",
|
kdc_log(context, config, 0, "Server not found in database: %s: %s",
|
||||||
server_name, krb5_get_err_text(context, ret));
|
server_name, krb5_get_err_text(context, ret));
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN,
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN,
|
||||||
"principal unknown");
|
"principal unknown");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -216,7 +217,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
TRUE);
|
TRUE);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* good error code? */
|
/* good error code? */
|
||||||
make_err_reply(context, reply, KERB_ERR_NAME_EXP,
|
make_err_reply(context, reply, KRB4ET_KDC_NAME_EXP,
|
||||||
"operation not allowed");
|
"operation not allowed");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -227,7 +228,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"Per principal Kerberos 4 flag not turned on for %s",
|
"Per principal Kerberos 4 flag not turned on for %s",
|
||||||
client_name);
|
client_name);
|
||||||
make_err_reply(context, reply, KERB_ERR_NULL_KEY,
|
make_err_reply(context, reply, KRB4ET_KDC_NULL_KEY,
|
||||||
"allow kerberos4 flag required");
|
"allow kerberos4 flag required");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -244,7 +245,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
"Pre-authentication required for v4-request: "
|
"Pre-authentication required for v4-request: "
|
||||||
"%s for %s",
|
"%s for %s",
|
||||||
client_name, server_name);
|
client_name, server_name);
|
||||||
make_err_reply(context, reply, KERB_ERR_NULL_KEY,
|
make_err_reply(context, reply, KRB4ET_KDC_NULL_KEY,
|
||||||
"preauth required");
|
"preauth required");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -252,7 +253,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
ret = _kdc_get_des_key(context, client, FALSE, FALSE, &ckey);
|
ret = _kdc_get_des_key(context, client, FALSE, FALSE, &ckey);
|
||||||
if(ret){
|
if(ret){
|
||||||
kdc_log(context, config, 0, "no suitable DES key for client");
|
kdc_log(context, config, 0, "no suitable DES key for client");
|
||||||
make_err_reply(context, reply, KDC_NULL_KEY,
|
make_err_reply(context, reply, KRB4ET_KDC_NULL_KEY,
|
||||||
"no suitable DES key for client");
|
"no suitable DES key for client");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -265,7 +266,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(ret){
|
if(ret){
|
||||||
kdc_log(context, config, 0, "No version-4 salted key in database -- %s.%s@%s",
|
kdc_log(context, config, 0, "No version-4 salted key in database -- %s.%s@%s",
|
||||||
name, inst, realm);
|
name, inst, realm);
|
||||||
make_err_reply(context, reply, KDC_NULL_KEY,
|
make_err_reply(context, reply, KRB4ET_KDC_NULL_KEY,
|
||||||
"No version-4 salted key in database");
|
"No version-4 salted key in database");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -275,7 +276,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(ret){
|
if(ret){
|
||||||
kdc_log(context, config, 0, "no suitable DES key for server");
|
kdc_log(context, config, 0, "no suitable DES key for server");
|
||||||
/* XXX */
|
/* XXX */
|
||||||
make_err_reply(context, reply, KDC_NULL_KEY,
|
make_err_reply(context, reply, KRB4ET_KDC_NULL_KEY,
|
||||||
"no suitable DES key for server");
|
"no suitable DES key for server");
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
@@ -400,7 +401,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
"tgs-req (krb4) with old kvno %d (current %d) for "
|
"tgs-req (krb4) with old kvno %d (current %d) for "
|
||||||
"krbtgt.%s@%s", kvno, tgt->entry.kvno % 256,
|
"krbtgt.%s@%s", kvno, tgt->entry.kvno % 256,
|
||||||
realm, config->v4_realm);
|
realm, config->v4_realm);
|
||||||
make_err_reply(context, reply, KDC_AUTH_EXP,
|
make_err_reply(context, reply, KRB4ET_KDC_AUTH_EXP,
|
||||||
"old krbtgt kvno used");
|
"old krbtgt kvno used");
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -410,7 +411,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"no suitable DES key for krbtgt (krb4)");
|
"no suitable DES key for krbtgt (krb4)");
|
||||||
/* XXX */
|
/* XXX */
|
||||||
make_err_reply(context, reply, KDC_NULL_KEY,
|
make_err_reply(context, reply, KRB4ET_KDC_NULL_KEY,
|
||||||
"no suitable DES key for krbtgt");
|
"no suitable DES key for krbtgt");
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -456,7 +457,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(strcmp(ad.prealm, realm)){
|
if(strcmp(ad.prealm, realm)){
|
||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"Can't hop realms (krb4) %s -> %s", realm, ad.prealm);
|
"Can't hop realms (krb4) %s -> %s", realm, ad.prealm);
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN,
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN,
|
||||||
"Can't hop realms");
|
"Can't hop realms");
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -465,7 +466,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"krb4 Cross-realm %s -> %s disabled",
|
"krb4 Cross-realm %s -> %s disabled",
|
||||||
realm, config->v4_realm);
|
realm, config->v4_realm);
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN,
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN,
|
||||||
"Can't hop realms");
|
"Can't hop realms");
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -473,7 +474,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
if(strcmp(sname, "changepw") == 0){
|
if(strcmp(sname, "changepw") == 0){
|
||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"Bad request for changepw ticket (krb4)");
|
"Bad request for changepw ticket (krb4)");
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN,
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN,
|
||||||
"Can't authorize password change based on TGT");
|
"Can't authorize password change based on TGT");
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -485,7 +486,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
s = kdc_log_msg(context, config, 0,
|
s = kdc_log_msg(context, config, 0,
|
||||||
"Client not found in database: (krb4) %s: %s",
|
"Client not found in database: (krb4) %s: %s",
|
||||||
client_name, krb5_get_err_text(context, ret));
|
client_name, krb5_get_err_text(context, ret));
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN, s);
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN, s);
|
||||||
free(s);
|
free(s);
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -494,7 +495,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
s = kdc_log_msg(context, config, 0,
|
s = kdc_log_msg(context, config, 0,
|
||||||
"Local client not found in database: (krb4) "
|
"Local client not found in database: (krb4) "
|
||||||
"%s", client_name);
|
"%s", client_name);
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN, s);
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN, s);
|
||||||
free(s);
|
free(s);
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -506,7 +507,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
s = kdc_log_msg(context, config, 0,
|
s = kdc_log_msg(context, config, 0,
|
||||||
"Server not found in database (krb4): %s: %s",
|
"Server not found in database (krb4): %s: %s",
|
||||||
server_name, krb5_get_err_text(context, ret));
|
server_name, krb5_get_err_text(context, ret));
|
||||||
make_err_reply(context, reply, KERB_ERR_PRINCIPAL_UNKNOWN, s);
|
make_err_reply(context, reply, KRB4ET_KDC_PR_UNKNOWN, s);
|
||||||
free(s);
|
free(s);
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -517,7 +518,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
FALSE);
|
FALSE);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* good error code? */
|
/* good error code? */
|
||||||
make_err_reply(context, reply, KERB_ERR_NAME_EXP,
|
make_err_reply(context, reply, KRB4ET_KDC_NAME_EXP,
|
||||||
"operation not allowed");
|
"operation not allowed");
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -527,7 +528,7 @@ _kdc_do_version4(krb5_context context,
|
|||||||
kdc_log(context, config, 0,
|
kdc_log(context, config, 0,
|
||||||
"no suitable DES key for server (krb4)");
|
"no suitable DES key for server (krb4)");
|
||||||
/* XXX */
|
/* XXX */
|
||||||
make_err_reply(context, reply, KDC_NULL_KEY,
|
make_err_reply(context, reply, KRB4ET_KDC_NULL_KEY,
|
||||||
"no suitable DES key for server");
|
"no suitable DES key for server");
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
@@ -787,7 +788,7 @@ _kdc_get_des_key(krb5_context context,
|
|||||||
else if(is_server && server_key)
|
else if(is_server && server_key)
|
||||||
*ret_key = server_key;
|
*ret_key = server_key;
|
||||||
else
|
else
|
||||||
return KERB_ERR_NULL_KEY;
|
return KRB4ET_KDC_NULL_KEY;
|
||||||
} else {
|
} else {
|
||||||
if(v4_key)
|
if(v4_key)
|
||||||
*ret_key = v4_key;
|
*ret_key = v4_key;
|
||||||
@@ -798,11 +799,11 @@ _kdc_get_des_key(krb5_context context,
|
|||||||
else if(is_server && server_key)
|
else if(is_server && server_key)
|
||||||
*ret_key = server_key;
|
*ret_key = server_key;
|
||||||
else
|
else
|
||||||
return KERB_ERR_NULL_KEY;
|
return KRB4ET_KDC_NULL_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((*ret_key)->key.keyvalue.length == 0)
|
if((*ret_key)->key.keyvalue.length == 0)
|
||||||
return KERB_ERR_NULL_KEY;
|
return KRB4ET_KDC_NULL_KEY;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user