From 7380b50b9ff627ec87860f3a48e2f7008aff28a5 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 25 Mar 1995 03:55:21 +0000 Subject: [PATCH] Oops. The ketype field was 2 bytes, not 1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5243 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/fetch_mkey.c | 4 ++-- src/lib/kdb/store_mkey.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/kdb/fetch_mkey.c b/src/lib/kdb/fetch_mkey.c index 1249ef4c7..cae97569f 100644 --- a/src/lib/kdb/fetch_mkey.c +++ b/src/lib/kdb/fetch_mkey.c @@ -93,7 +93,7 @@ krb5_db_fetch_mkey(context, mname, eblock, fromkeyboard, twice, salt, key) } else { /* from somewhere else */ - krb5_octet keytype; + krb5_ui_2 keytype; char defkeyfile[MAXPATHLEN+1]; krb5_data *realm = krb5_princ_realm(context, mname); FILE *kf; @@ -113,7 +113,7 @@ krb5_db_fetch_mkey(context, mname, eblock, fromkeyboard, twice, salt, key) if (!(kf = fopen(defkeyfile, "r"))) #endif return KRB5_KDB_CANTREAD_STORED; - if (fread((krb5_pointer) &keytype, 1, 1, kf) != 1) { + if (fread((krb5_pointer) &keytype, 2, 1, kf) != 1) { retval = KRB5_KDB_CANTREAD_STORED; goto errout; } diff --git a/src/lib/kdb/store_mkey.c b/src/lib/kdb/store_mkey.c index 742a6ebce..d739e2626 100644 --- a/src/lib/kdb/store_mkey.c +++ b/src/lib/kdb/store_mkey.c @@ -54,7 +54,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) { FILE *kf; krb5_error_code retval = 0; - krb5_octet keytype; + krb5_ui_2 keytype; char defkeyfile[MAXPATHLEN+1]; krb5_data *realm = krb5_princ_realm(context, mname); #if defined(unix) || defined(__unix__) @@ -86,7 +86,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) } keytype = key->keytype; if ((fwrite((krb5_pointer) &keytype, - 1, 1, kf) != 1) || + 2, 1, kf) != 1) || (fwrite((krb5_pointer) &key->length, sizeof(key->length), 1, kf) != 1) || (fwrite((krb5_pointer) key->contents, -- 2.26.2