svn rev #24367: branches/nss/src/lib/crypto/nss/ hash_provider/

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Sep 27 23:40:46 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24367
Commit By: ghudson
Log Message:
Clean up hash and digest contexts in the back end to avoid refcount
leaks.



Changed Files:
U   branches/nss/src/lib/crypto/nss/hash_provider/hash_gen.c
U   branches/nss/src/lib/crypto/nss/hmac.c
Modified: branches/nss/src/lib/crypto/nss/hash_provider/hash_gen.c
===================================================================
--- branches/nss/src/lib/crypto/nss/hash_provider/hash_gen.c	2010-09-28 00:02:03 UTC (rev 24366)
+++ branches/nss/src/lib/crypto/nss/hash_provider/hash_gen.c	2010-09-28 03:40:46 UTC (rev 24367)
@@ -61,6 +61,7 @@
 
     HASH_End(ctx, (unsigned char *)output->data,
              &output->length, output->length);
+    HASH_Destroy(ctx);
 
     return 0;
 }

Modified: branches/nss/src/lib/crypto/nss/hmac.c
===================================================================
--- branches/nss/src/lib/crypto/nss/hmac.c	2010-09-28 00:02:03 UTC (rev 24366)
+++ branches/nss/src/lib/crypto/nss/hmac.c	2010-09-28 03:40:46 UTC (rev 24367)
@@ -151,10 +151,9 @@
     }
     rv = PK11_DigestFinal(ctx, (unsigned char *) output->data, &output->length,
                           output->length);
-    ctx = NULL;
     if (rv != SECSuccess)
         goto fail;
-
+    PK11_DestroyContext(ctx, PR_TRUE);
     return 0;
 fail:
     ret = k5_nss_map_last_error();




More information about the cvs-krb5 mailing list