return(ENOMEM);
}
- if (local_dec_rep->etype > max_cryptosystem ||
- local_dec_rep->etype < 0 ||
- !csarray[local_dec_rep->etype])
+ if (!valid_etype(local_dec_rep->etype))
return KRB5KDC_ERR_ETYPE_NOSUPP;
/* put together an eblock for this encryption */
krb5_data scratch;
krb5_error_code retval;
- if (ticket->etype > max_cryptosystem ||
- ticket->etype < 0 ||
- !csarray[ticket->etype])
+ if (!valid_etype(ticket->etype))
return KRB5KDC_ERR_ETYPE_NOSUPP;
/* put together an eblock for this encryption */
/* array of pointers into encryption systems */
extern krb5_cs_table_entry *csarray[];
+extern int max_cryptosystem; /* max entry in array */
/*
Takes KDC rep parts in *rep and *encpart, and formats it into *enc_rep,
krb5_encrypt_block eblock;
krb5_error_code retval;
+ if (!valid_etype(dec_rep->etype))
+ return KRB5KDC_ERR_ETYPE_NOSUPP;
+
switch (type) {
case KRB5_AS_REP:
case KRB5_TGS_REP:
/* encrypt the encrypted part */
- if (dec_ticket->etype > max_cryptosystem ||
- dec_ticket->etype < 0 ||
- !csarray[dec_ticket->etype])
+ if (!valid_etype(dec_ticket->etype))
return KRB5KDC_ERR_ETYPE_NOSUPP;
/* start by encoding the to-be-encrypted part. */