Oops. The ketype field was 2 bytes, not 1
authorTheodore Tso <tytso@mit.edu>
Sat, 25 Mar 1995 03:55:21 +0000 (03:55 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 25 Mar 1995 03:55:21 +0000 (03:55 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5243 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/fetch_mkey.c
src/lib/kdb/store_mkey.c

index 1249ef4c7f0ab043c6130f9fdea0200a48d4be36..cae97569f48bf4da8e12ea329db9906405f44e44 100644 (file)
@@ -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;
        }
index 742a6ebce30ce38bfd96053327abf2dbc13206d2..d739e2626bb73ce88a88db08dd324cc0b400be6d 100644 (file)
@@ -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,