]> git.saurik.com Git - apple/security.git/blobdiff - SecureTransport/sslContext.cpp
Security-176.tar.gz
[apple/security.git] / SecureTransport / sslContext.cpp
index 835f65508c0ad7cf98f77ce35050fc520ddca520..5d3be3c72ac62154d1625a0d935ef666f816ede5 100644 (file)
@@ -238,10 +238,16 @@ SSLDisposeContext                         (SSLContext                     *ctx)
         * are all raw keys, and all Apple CSPs dispose of raw keys in the same
         * way.
         */
-       sslFreeKey(ctx->signingKeyCsp, &ctx->signingPubKey, NULL);
-       sslFreeKey(ctx->encryptKeyCsp, &ctx->encryptPubKey, NULL);
+       sslFreeKey(ctx->cspHand, &ctx->signingPubKey, NULL);
+       sslFreeKey(ctx->cspHand, &ctx->encryptPubKey, NULL);
        sslFreeKey(ctx->peerPubKeyCsp, &ctx->peerPubKey, NULL);
        
+       if(ctx->signingPrivKeyRef) {
+               CFRelease(ctx->signingPrivKeyRef);
+       }
+       if(ctx->encryptPrivKeyRef) {
+               CFRelease(ctx->encryptPrivKeyRef);
+       }
        sslFreeTrustedRoots(ctx);
        
        detachFromAll(ctx);
@@ -894,14 +900,7 @@ SSLSetCertificate                  (SSLContextRef          ctx,
                certRefs,
                &ctx->localCert,
                &ctx->signingPubKey,
-               &ctx->signingPrivKey,
-               &ctx->signingKeyCsp
-               #if ST_KC_KEYS_NEED_REF
-               ,
-               &ctx->signingKeyRef
-               #else
-               );
-               #endif
+               &ctx->signingPrivKeyRef);
 }
 
 OSStatus
@@ -925,8 +924,7 @@ SSLSetEncryptionCertificate (SSLContextRef          ctx,
                certRefs,
                &ctx->encryptCert,
                &ctx->encryptPubKey,
-               &ctx->encryptPrivKey,
-               &ctx->encryptKeyCsp);
+               &ctx->encryptPrivKeyRef);
 }
 
 OSStatus