krb5 commit [krb5-1.11]: Add camellia_key_cleanup

Tom Yu tlyu at MIT.EDU
Fri Nov 30 14:24:05 EST 2012


https://github.com/krb5/krb5/commit/b36e59e85a85df3c3b04e12be44d92eb0e1000a1
commit b36e59e85a85df3c3b04e12be44d92eb0e1000a1
Author: Ben Kaduk <kaduk at mit.edu>
Date:   Wed Nov 21 21:57:40 2012 -0500

    Add camellia_key_cleanup
    
    Fix memory leak.
    
    (cherry picked from commit 6b37134d163beeeb136b4a59109c523e0bf83f3b)
    
    ticket: 7457
    version_fixed: 1.11
    status: resolved

 src/lib/crypto/builtin/enc_provider/camellia.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/lib/crypto/builtin/enc_provider/camellia.c b/src/lib/crypto/builtin/enc_provider/camellia.c
index 2faf811..7a0fbd9 100644
--- a/src/lib/crypto/builtin/enc_provider/camellia.c
+++ b/src/lib/crypto/builtin/enc_provider/camellia.c
@@ -318,6 +318,12 @@ camellia_init_state(const krb5_keyblock *key, krb5_keyusage usage,
     return 0;
 }
 
+static void
+camellia_key_cleanup(krb5_key key)
+{
+    zapfree(key->cache, sizeof(struct camellia_key_info_cache));
+}
+
 const struct krb5_enc_provider krb5int_enc_camellia128 = {
     16,
     16, 16,
@@ -326,6 +332,7 @@ const struct krb5_enc_provider krb5int_enc_camellia128 = {
     krb5int_camellia_cbc_mac,
     camellia_init_state,
     krb5int_default_free_state,
+    camellia_key_cleanup
 };
 
 const struct krb5_enc_provider krb5int_enc_camellia256 = {
@@ -335,5 +342,6 @@ const struct krb5_enc_provider krb5int_enc_camellia256 = {
     krb5int_camellia_decrypt,
     krb5int_camellia_cbc_mac,
     camellia_init_state,
-    krb5int_default_free_state
+    krb5int_default_free_state,
+    camellia_key_cleanup
 };


More information about the cvs-krb5 mailing list