/*
* lib/krb4/g_ad_tkt.c
*
- * Copyright 1986, 1987, 1988, 2000 by the Massachusetts Institute of
- * Technology. All Rights Reserved.
+ * Copyright 1986, 1987, 1988, 2000, 2001 by the Massachusetts
+ * Institute of Technology. All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
/* Check byte order (little-endian == 1) */
msg_byte_order = t_switch & 1;
t_switch &= ~1;
+ /*
+ * Skip over some stuff (3 strings and various integers -- see
+ * cr_auth_repl.c for details). Maybe we should actually verify
+ * these?
+ */
+ for (i = 0; i < 3; i++) {
+ len = krb_strnlen((char *)ptr, RPKT_REMAIN) + 1;
+ if (len <= 0)
+ return INTK_PROT;
+ ptr += len;
+ }
switch (t_switch) {
case AUTH_MSG_KDC_REPLY:
+ if (RPKT_REMAIN < 4 + 1 + 4 + 1)
+ return INTK_PROT;
+ ptr += 4 + 1 + 4 + 1;
break;
case AUTH_MSG_ERR_REPLY:
if (RPKT_REMAIN < 4)
default:
return INTK_PROT;
}
- /*
- * Skip over some stuff (3 strings and various integers -- see
- * cr_auth_repl.c for details). Maybe we should actually verify
- * these?
- */
- for (i = 0; i < 3; i++) {
- len = krb_strnlen((char *)ptr, RPKT_REMAIN) + 1;
- if (len <= 0)
- return INTK_PROT;
- ptr += len;
- }
- if (RPKT_REMAIN < 4 + 1 + 4 + 1)
- return INTK_PROT;
- ptr += 4 + 1 + 4 + 1;
/* Extract the ciphertext */
if (RPKT_REMAIN < 2)
/*
* lib/krb4/g_in_tkt.c
*
- * Copyright 1986, 1987, 1988, 2000 by the Massachusetts Institute of
- * Technology. All Rights Reserved.
+ * Copyright 1986, 1987, 1988, 2000, 2001 by the Massachusetts
+ * Institute of Technology. All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
key_proc_type, KTEXT *));
#endif
+static int
+krb_mk_in_tkt_preauth(char *, char *, char *, char *, char *,
+ int, char *, int, KTEXT, int *);
+
+static int
+krb_parse_in_tkt(char *, char *, char *, char *, char *,
+ int, KTEXT, int);
+
/*
* decrypt_tkt(): Given user, instance, realm, passwd, key_proc
* and the cipher text sent from the KDC, decrypt the cipher text
* string sinstance service's instance
*/
-int
+static int
krb_mk_in_tkt_preauth(user, instance, realm, service, sinstance, life,
preauth_p, preauth_len, cip, byteorder)
char *user;
/* Check byte order */
msg_byte_order = t_switch & 1;
t_switch &= ~1;
- switch (t_switch) {
- case AUTH_MSG_KDC_REPLY:
- break;
- case AUTH_MSG_ERR_REPLY:
- if (RPKT_REMAIN < 4)
- return INTK_PROT;
- KRB4_GET32(rep_err_code, p, msg_byte_order);
- return rep_err_code;
- default:
- return INTK_PROT;
- }
/* EXTRACT INFORMATION FROM RETURN PACKET */
return INTK_PROT;
p += len;
}
- if (RPKT_REMAIN < 4 + 1 + 4 + 1)
- return INTK_PROT;
- p += 4 + 1 + 4 + 1;
+ switch (t_switch) {
+ case AUTH_MSG_KDC_REPLY:
+ if (RPKT_REMAIN < 4 + 1 + 4 + 1)
+ return INTK_PROT;
+ p += 4 + 1 + 4 + 1;
+ break;
+ case AUTH_MSG_ERR_REPLY:
+ if (RPKT_REMAIN < 4)
+ return INTK_PROT;
+ KRB4_GET32(rep_err_code, p, msg_byte_order);
+ return rep_err_code;
+ default:
+ return INTK_PROT;
+ }
/* Extract the ciphertext */
if (RPKT_REMAIN < 2)
return INTK_OK;
}
-int
+static int
krb_parse_in_tkt(user, instance, realm, service, sinstance, life, cip,
byteorder)
char *user;