In krb5_k_make_checksum, check for a null key passed with a keyed
authorGreg Hudson <ghudson@mit.edu>
Tue, 20 Oct 2009 13:47:40 +0000 (13:47 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 20 Oct 2009 13:47:40 +0000 (13:47 +0000)
checksum instead of just crashing.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22952 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/krb/make_checksum.c

index dd34df3770dc0698e49495a0d2a8e532e9c77b8d..01e374b14a06e44c59e9adb1024a6da5d15acc3b 100644 (file)
@@ -68,7 +68,7 @@ krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype,
        /* check if key is compatible */
        if (ctp->keyed_etype) {
            ktp1 = find_enctype(ctp->keyed_etype);
-           ktp2 = find_enctype(key->keyblock.enctype);
+           ktp2 = key ? find_enctype(key->keyblock.enctype) : NULL;
            if (ktp1 == NULL || ktp2 == NULL || ktp1->enc != ktp2->enc) {
                ret = KRB5_BAD_ENCTYPE;
                goto cleanup;