svn rev #24384: branches/nss/src/lib/crypto/nss/enc_provider/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Sep 29 23:40:17 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24384
Commit By: ghudson
Log Message:
Follow-up to r24365: call both PK11_Finalize and PK11_DestroyContext
to clean up crypto contexts.



Changed Files:
U   branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c
Modified: branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c
===================================================================
--- branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c	2010-09-29 23:05:12 UTC (rev 24383)
+++ branches/nss/src/lib/crypto/nss/enc_provider/enc_gen.c	2010-09-30 03:40:17 UTC (rev 24384)
@@ -233,8 +233,10 @@
         memcpy(ivec->data, lastptr, blocksize);
     }
 done:
-    if (ctx)
+    if (ctx) {
+        PK11_Finalize(ctx);
         PK11_DestroyContext(ctx, PR_TRUE);
+    }
     if (param)
         SECITEM_FreeItem(param, PR_TRUE);
     return ret;
@@ -261,8 +263,10 @@
     struct stream_state *sstate = (struct stream_state *) state->data;
 
     /* Clean up the OpenSSL context if it was initialized. */
-    if (sstate && sstate->loopback == sstate)
+    if (sstate && sstate->loopback == sstate) {
+        PK11_Finalize(sstate->ctx);
         PK11_DestroyContext(sstate->ctx, PR_TRUE);
+    }
     free(sstate);
     return 0;
 }
@@ -321,8 +325,10 @@
         }
     }
 done:
-    if (!state && ctx)
+    if (!state && ctx) {
+        PK11_Finalize(ctx);
         PK11_DestroyContext(ctx, PR_TRUE);
+    }
     return ret;
 }
 
@@ -510,8 +516,10 @@
     }
 
 done:
-    if (ctx)
+    if (ctx) {
+        PK11_Finalize(ctx);
         PK11_DestroyContext(ctx, PR_TRUE);
+    }
     if (param)
         SECITEM_FreeItem(param, PR_TRUE);
     return ret;
@@ -624,6 +632,7 @@
         ret = k5_nss_map_last_error();
         goto done;
     }
+    PK11_Finalize(ctx);
     PK11_DestroyContext(ctx, PR_TRUE);
     ctx = NULL;
 
@@ -645,8 +654,10 @@
     if (slot)
         PK11_FreeSlot(slot);
 #ifdef FAKE_FIPS
-    if (ctx)
+    if (ctx) {
+        PK11_Finalize(ctx);
         PK11_DestroyContext(ctx, PR_TRUE);
+    }
     if (wrapping_key)
         PK11_FreeSymKey(wrapping_key);
 #endif




More information about the cvs-krb5 mailing list