]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_apple_csp/lib/desContext.cpp
Security-59306.61.1.tar.gz
[apple/security.git] / OSX / libsecurity_apple_csp / lib / desContext.cpp
index 2e93686a9a78c9375a1933c92690f0e7f1c056ec..22531e0968e50e9777a3e7a559bebd395a51a04b 100644 (file)
@@ -25,7 +25,7 @@
 #include <security_utilities/globalizer.h>
 #include <security_utilities/threading.h>
 
-#define DESDebug(args...)      secdebug("desContext", ## args)
+#define DESDebug(args...)      secinfo("desContext", ## args)
 
 /*
  * DES encrypt/decrypt.
@@ -65,6 +65,7 @@ void DESContext::init(
     if (DesInst != NULL)
     {
         CCCryptorRelease(DesInst);
+        DesInst = NULL;
     }
     
     (void) CCCryptorCreateWithMode(0, kCCModeECB, kCCAlgorithmDES, ccDefaultPadding, NULL, keyData, kCCKeySizeDES, NULL, 0, 0, 0, &DesInst);
@@ -152,6 +153,7 @@ void DES3Context::init(
 
     if (DesInst != NULL) {
         CCCryptorRelease(DesInst);
+        DesInst = NULL;
     }
     
     (void) CCCryptorCreateWithMode(0, kCCModeECB, kCCAlgorithm3DES, ccDefaultPadding, NULL, keyData, kCCKeySize3DES, NULL, 0, 0, 0, &DesInst);