/* XXX maybe caller should specify type expected? */
+ if (!krb5_is_kdc_rep(enc_rep))
+ return KRB5KRB_AP_ERR_MSG_TYPE;
retval = decode_krb5_as_rep(enc_rep, &local_dec_rep);
switch (retval) {
case ISODE_50_LOCAL_ERR_BADMSGTYPE:
break;
case KRB5_ERROR:
default:
- if (decode_krb5_error(&tgsrep.response, &err_reply)) {
+ if (!krb5_is_krb_error(&tgsrep.response)) {
+ retval = KRB5KRB_AP_ERR_MSG_TYPE;
+ } else
+ retval = decode_krb5_error(&tgsrep.response, &err_reply);
+ if (retval) {
cleanup();
return retval; /* neither proper reply nor error! */
}
krb5_timestamp currenttime;
krb5_ui_2 computed_direction;
+ if (!krb5_is_krb_priv(inbuf))
+ return KRB5KRB_AP_ERR_MSG_TYPE;
/* decode private message */
if (retval = decode_krb5_priv(inbuf, &privmsg)) {
return retval;
krb5_error_code retval;
krb5_ap_req *request;
+ if (!krb5_is_ap_req(inbuf))
+ return KRB5KRB_AP_ERR_MSG_TYPE;
if (retval = decode_krb5_ap_req(inbuf, &request)) {
switch (retval) {
case ISODE_50_LOCAL_ERR_BADMSGTYPE:
krb5_data *scratch;
krb5_timestamp currenttime;
+ if (!krb5_is_krb_safe(inbuf))
+ return KRB5KRB_AP_ERR_MSG_TYPE;
+
if (retval = decode_krb5_safe(inbuf, &message))
return retval;