From f2614ac7c404ff2b32746812c1c892ed59e3a999 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 11 Jan 1996 04:06:02 +0000 Subject: [PATCH] scc.h (KRB5_SCC_DEFAULT_VNO): Remove KRB5_SCC_DEFAULT_VNO; now set in init_ctx.c. scc_maybe.c (krb5_scc_open_file): scc_gennew.c (krb5_scc_generate_new): Use context->scc_default_format to determine the credentials ccache type. scc_read.c (krb5_scc_read_keyblock): If reading in a version 3 credentials cache, ignore the second enctype stored in the ccache; just read it into a dummy variable. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7302 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/stdio/ChangeLog | 14 ++++++++++++++ src/lib/krb5/ccache/stdio/scc.h | 4 ---- src/lib/krb5/ccache/stdio/scc_gennew.c | 6 +++--- src/lib/krb5/ccache/stdio/scc_maybe.c | 8 +++----- src/lib/krb5/ccache/stdio/scc_read.c | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/lib/krb5/ccache/stdio/ChangeLog b/src/lib/krb5/ccache/stdio/ChangeLog index d86d0fc4d..5a3939e7b 100644 --- a/src/lib/krb5/ccache/stdio/ChangeLog +++ b/src/lib/krb5/ccache/stdio/ChangeLog @@ -1,3 +1,17 @@ +Wed Jan 10 22:44:43 1996 Theodore Y. Ts'o + + * scc.h (KRB5_SCC_DEFAULT_VNO): Remove KRB5_SCC_DEFAULT_VNO; now + set in init_ctx.c. + + * scc_maybe.c (krb5_scc_open_file): + * scc_gennew.c (krb5_scc_generate_new): Use + context->scc_default_format to determine the credentials + cache type. + + * scc_read.c (krb5_scc_read_keyblock): If reading in a version 3 + credentials cache, ignore the second enctype stored in the + ccache; just read it into a dummy variable. + Thu Dec 21 18:33:39 1995 Theodore Y. Ts'o * scc_maybe.c (krb5_scc_open_file): In the case of diff --git a/src/lib/krb5/ccache/stdio/scc.h b/src/lib/krb5/ccache/stdio/scc.h index 6212adc14..aaa75b80a 100644 --- a/src/lib/krb5/ccache/stdio/scc.h +++ b/src/lib/krb5/ccache/stdio/scc.h @@ -42,8 +42,6 @@ * what KRB5_SCC_DEFAULT_FVNO is set to, it will create version 1 or * version 2 SCC caches. * - * KRB5_SCC_DEFAULT_FVNO should be set to version 2, unless there is - * some overriding compatibility reasons not to do so. */ #define KRB5_SCC_FVNO_1 0x0501 /* krb v5, scc v1 */ @@ -51,8 +49,6 @@ #define KRB5_SCC_FVNO_3 0x0503 /* krb v5, scc v3 */ #define KRB5_SCC_FVNO_4 0x0504 /* krb v5, scc v4 */ -#define KRB5_SCC_DEFAULT_FVNO KRB5_SCC_FVNO_3 - #define SCC_OPEN_AND_ERASE 1 #define SCC_OPEN_RDWR 2 #define SCC_OPEN_RDONLY 3 diff --git a/src/lib/krb5/ccache/stdio/scc_gennew.c b/src/lib/krb5/ccache/stdio/scc_gennew.c index 316a00ff9..9839df6e0 100644 --- a/src/lib/krb5/ccache/stdio/scc_gennew.c +++ b/src/lib/krb5/ccache/stdio/scc_gennew.c @@ -97,8 +97,8 @@ krb5_scc_generate_new (context, id) } else { unsigned char scc_fvno[2]; - scc_fvno[0] = (unsigned char) (KRB5_SCC_DEFAULT_FVNO >> 8); - scc_fvno[1] = (unsigned char) (KRB5_SCC_DEFAULT_FVNO & 0xFF); + scc_fvno[0] = (unsigned char) ((context->scc_default_format >> 8) & 0xFF); + scc_fvno[1] = (unsigned char) (context->scc_default_format & 0xFF); if (!fwrite((char *)scc_fvno, sizeof(scc_fvno), 1, f)) { retcode = krb5_scc_interpret(context, errno); @@ -107,7 +107,7 @@ krb5_scc_generate_new (context, id) goto err_out; } /* For version 4 we save a length for the rest of the header */ - if (KRB5_SCC_DEFAULT_FVNO == KRB5_SCC_FVNO_4) { + if (context->scc_default_format == KRB5_SCC_FVNO_4) { unsigned char scc_flen[2]; scc_flen[0] = 0; scc_flen[1] = 0; diff --git a/src/lib/krb5/ccache/stdio/scc_maybe.c b/src/lib/krb5/ccache/stdio/scc_maybe.c index ef6261745..2e09b3da6 100644 --- a/src/lib/krb5/ccache/stdio/scc_maybe.c +++ b/src/lib/krb5/ccache/stdio/scc_maybe.c @@ -29,8 +29,6 @@ #include "scc.h" #include "k5-int.h" -int krb5_scc_default_format = KRB5_SCC_DEFAULT_FVNO; - krb5_error_code krb5_scc_close_file (context, id) krb5_context context; @@ -151,9 +149,9 @@ krb5_scc_open_file (context, id, mode) /* write the version number */ int errsave; - fvno_bytes[0] = krb5_scc_default_format >> 8; - fvno_bytes[1] = krb5_scc_default_format & 0xFF; - data->version = krb5_scc_default_format; + fvno_bytes[0] = (context->scc_default_format >> 8) & 0xFF; + fvno_bytes[1] = context->scc_default_format & 0xFF; + data->version = context->scc_default_format; if (!fwrite((char *)fvno_bytes, sizeof(fvno_bytes), 1, f)) { errsave = errno; (void) krb5_unlock_file(context, fileno(f)); diff --git a/src/lib/krb5/ccache/stdio/scc_read.c b/src/lib/krb5/ccache/stdio/scc_read.c index de297949d..6c50794cf 100644 --- a/src/lib/krb5/ccache/stdio/scc_read.c +++ b/src/lib/krb5/ccache/stdio/scc_read.c @@ -202,7 +202,7 @@ krb5_scc_read_keyblock(context, id, keyblock) if (data->version == KRB5_SCC_FVNO_3) { /* This works because the old etype is the same as the new enctype. */ kret = krb5_scc_read_ui_2(context, id, &ui2); - keyblock->enctype = ui2; + /* keyblock->enctype = ui2; */ CHECK(kret); } -- 2.26.2