From 22f0fba7c342919401c1b8039ac9d830245cea76 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 25 Mar 1995 03:30:07 +0000 Subject: [PATCH] Fix stupid bug from the last change git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5242 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/fetch_mkey.c | 2 +- src/lib/kdb/store_mkey.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/kdb/fetch_mkey.c b/src/lib/kdb/fetch_mkey.c index c8feb08a2..1249ef4c7 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_keytype keytype; + krb5_octet keytype; char defkeyfile[MAXPATHLEN+1]; krb5_data *realm = krb5_princ_realm(context, mname); FILE *kf; diff --git a/src/lib/kdb/store_mkey.c b/src/lib/kdb/store_mkey.c index 377ebba9f..742a6ebce 100644 --- a/src/lib/kdb/store_mkey.c +++ b/src/lib/kdb/store_mkey.c @@ -54,6 +54,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) { FILE *kf; krb5_error_code retval = 0; + krb5_octet keytype; char defkeyfile[MAXPATHLEN+1]; krb5_data *realm = krb5_princ_realm(context, mname); #if defined(unix) || defined(__unix__) @@ -83,7 +84,8 @@ krb5_db_store_mkey(context, keyfile, mname, key) #endif return errno; } - if ((fwrite((krb5_pointer) &key->keytype, + keytype = key->keytype; + if ((fwrite((krb5_pointer) &keytype, 1, 1, kf) != 1) || (fwrite((krb5_pointer) &key->length, sizeof(key->length), 1, kf) != 1) || -- 2.26.2