+Mon Sep 11 21:05:40 1995 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * fcc_maybe.c (krb5_fcc_open_file): use THREEPARAMOPEN instead of
+ just open.
+
+Wed Sep 06 14:20:57 1995 Chris Provenzano (proven@mit.edu)
+
+ * file_read.c, file_write.c : s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g
+
Wed Sept 6 12:00:00 EDT 1995 James Mattly (mattly@fusion.com)
* fcc_retrv.c: for _MACINTOSH, defined register to null for compiler
* fcc_maybe.c: included <stdio.h>
+Tue Sep 05 22:58:52 1995
+
+ * fcc.h : Add another KRB5_FCC_FVNO but don't up the default.
+ * fcc_gennew.c, fcc_maybe.c : New version saves a length after
+ version for whatever we want to put into the ccache before
+ the first credential (like a time skew)
+ * fcc_read.c, fcc_write.c : Remove krb5_enctype references, and
+ replace with krb5_keytype where appropriate
+
Tue Aug 29 13:36:00 EDT 1995 Paul Park (pjpark@mit.edu)
* fcc_reslv.c - Set magic number in successfully resolved ccache.
#define KRB5_FCC_FVNO_1 0x0501 /* krb5 v5, fcc v1 */
#define KRB5_FCC_FVNO_2 0x0502 /* krb5 v5, fcc v2 */
#define KRB5_FCC_FVNO_3 0x0503 /* krb5 v5, fcc v3 */
+#define KRB5_FCC_FVNO_4 0x0504 /* krb5 v5, fcc v4 */
#define KRB5_FCC_DEFAULT_FVNO KRB5_FCC_FVNO_3
goto err_out;
} else {
krb5_int16 fcc_fvno = htons(KRB5_FCC_DEFAULT_FVNO);
+ krb5_int16 fcc_flen = 0;
int errsave, cnt;
/* Ignore user's umask, set mode = 0600 */
retcode = (cnt == -1) ? krb5_fcc_interpret(context, errsave) : KRB5_CC_IO;
goto err_out;
}
+ /* For version 4 we save a length for the rest of the header */
+ if (KRB5_FCC_DEFAULT_FVNO == KRB5_FCC_FVNO_4) {
+ if ((cnt = write(ret, (char *)&fcc_flen, sizeof(fcc_flen)))
+ != sizeof(fcc_flen)) {
+ errsave = errno;
+ (void) close(ret);
+ (void) unlink(((krb5_fcc_data *) lid->data)->filename);
+ retcode = (cnt == -1) ? krb5_fcc_interpret(context, errsave) : KRB5_CC_IO;
+ goto err_out;
+ }
+ }
if (close(ret) == -1) {
errsave = errno;
(void) unlink(((krb5_fcc_data *) lid->data)->filename);
(void) close(fd);
return KRB5_CCACHE_BADVNO;
}
- if ((fcc_fvno != htons(KRB5_FCC_FVNO_3)) &&
+ if ((fcc_fvno != htons(KRB5_FCC_FVNO_4)) &&
+ (fcc_fvno != htons(KRB5_FCC_FVNO_3)) &&
(fcc_fvno != htons(KRB5_FCC_FVNO_2)) &&
(fcc_fvno != htons(KRB5_FCC_FVNO_1))) {
(void) fcc_lock_file(data, fd, UNLOCK_IT);
(void) close(fd);
return KRB5_CCACHE_BADVNO;
}
- data->version = ntohs(fcc_fvno);
- }
- data->fd = fd;
- return 0;
+ if (fcc_fvno == htons(KRB5_FCC_FVNO_4)) {
+ krb5_ui_2 fcc_flen;
+ char buf[1024];
+
+ if (read(fd, (char *)&fcc_flen, sizeof(fcc_flen))
+ != sizeof(fcc_flen)) {
+ (void) fcc_lock_file(data, fd, UNLOCK_IT);
+ (void) close(fd);
+ return KRB5_CCACHE_BADVNO;
+ }
+ /* Skip past the header info for now */
+ if (fcc_flen = htons(fcc_flen)) {
+ if (read(fd, buf, fcc_flen) != fcc_flen) {
+ (void) fcc_lock_file(data, fd, UNLOCK_IT);
+ (void) close(fd);
+ return KRB5_CCACHE_BADVNO;
+ }
+ }
+ }
+ data->version = ntohs(fcc_fvno);
+ }
+ data->fd = fd;
+ return 0;
}
keyblock->contents = 0;
kret = krb5_fcc_read_ui_2(context, id, &ui2);
- keyblock->keytype = ui2;
+ keyblock->enctype = ui2;
CHECK(kret);
- if ((data->version == KRB5_FCC_FVNO_1) ||
- (data->version == KRB5_FCC_FVNO_2))
- keyblock->etype = ETYPE_UNKNOWN;
- else {
+ if (data->version == KRB5_FCC_FVNO_3) {
kret = krb5_fcc_read_ui_2(context, id, &ui2);
- keyblock->etype = ui2;
+ keyblock->enctype = ui2;
CHECK(kret);
}
krb5_fcc_data *data = (krb5_fcc_data *)id->data;
krb5_error_code ret;
- ret = krb5_fcc_store_ui_2(context, id, keyblock->keytype);
+ ret = krb5_fcc_store_ui_2(context, id, keyblock->enctype);
CHECK(ret);
- if ((data->version != KRB5_FCC_FVNO_1) &&
- (data->version != KRB5_FCC_FVNO_2)) {
- ret = krb5_fcc_store_ui_2(context, id, keyblock->etype);
+ if (data->version == KRB5_FCC_FVNO_3) {
+ ret = krb5_fcc_store_ui_2(context, id, keyblock->enctype);
CHECK(ret);
}
ret = krb5_fcc_store_int32(context, id, keyblock->length);