krb5 commit: Clean up cksum handling in CMAC token functions

Greg Hudson ghudson at MIT.EDU
Fri Mar 29 11:41:35 EDT 2013


https://github.com/krb5/krb5/commit/fd557fc3de99f63b37ae78a0f43968c162524baa
commit fd557fc3de99f63b37ae78a0f43968c162524baa
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Mar 29 01:57:31 2013 -0400

    Clean up cksum handling in CMAC token functions
    
    In krb5int_dk_cmac_encrypt, cksum wasn't used.  In
    krb5int_dk_cmac_decrypt, cksum needs to be initialized since we clean
    it up.

 src/lib/crypto/krb/enc_dk_cmac.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/lib/crypto/krb/enc_dk_cmac.c b/src/lib/crypto/krb/enc_dk_cmac.c
index 508f9f8..e27c862 100644
--- a/src/lib/crypto/krb/enc_dk_cmac.c
+++ b/src/lib/crypto/krb/enc_dk_cmac.c
@@ -89,7 +89,6 @@ krb5int_dk_cmac_encrypt(const struct krb5_keytypes *ktp, krb5_key key,
     const struct krb5_enc_provider *enc = ktp->enc;
     krb5_error_code ret;
     krb5_crypto_iov *header, *trailer, *padding;
-    krb5_data cksum = empty_data();
     krb5_key ke = NULL, ki = NULL;
 
     /* E(Confounder | Plaintext | Pad) | Checksum */
@@ -129,7 +128,6 @@ krb5int_dk_cmac_encrypt(const struct krb5_keytypes *ktp, krb5_key key,
 cleanup:
     krb5_k_free_key(NULL, ke);
     krb5_k_free_key(NULL, ki);
-    zapfree(cksum.data, cksum.length);
     return ret;
 }
 
@@ -141,7 +139,7 @@ krb5int_dk_cmac_decrypt(const struct krb5_keytypes *ktp, krb5_key key,
     const struct krb5_enc_provider *enc = ktp->enc;
     krb5_error_code ret;
     krb5_crypto_iov *header, *trailer;
-    krb5_data cksum;
+    krb5_data cksum = empty_data();
     krb5_key ke = NULL, ki = NULL;
 
     /* E(Confounder | Plaintext | Pad) | Checksum */


More information about the cvs-krb5 mailing list