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
+Wed Jan 10 22:44:43 1996 Theodore Y. Ts'o <tytso@dcl>
+
+ * 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 <tytso@dcl>
* scc_maybe.c (krb5_scc_open_file): In the case of
* 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 */
#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
} 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);
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;
#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;
/* 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));
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);
}