]> git.saurik.com Git - apple/security.git/blobdiff - cdsa/cdsa_client/keyclient.cpp
Security-163.tar.gz
[apple/security.git] / cdsa / cdsa_client / keyclient.cpp
index f98f7375bdded78fe896fc3ad2742263664ac7eb..5627ce718da68234e791270924f58dbcfd81fc82 100644 (file)
@@ -20,6 +20,8 @@
 // keyclient
 //
 #include <Security/keyclient.h>
+#include <Security/cssmdata.h>
+
 
 using namespace CssmClient;
 
@@ -29,8 +31,10 @@ KeyImpl::KeyImpl(const CSP &csp) : ObjectImpl(csp), CssmKey()
        mActive=false;
 }
 
-KeyImpl::KeyImpl(const CSP &csp, CSSM_KEY &key) : ObjectImpl(csp), CssmKey(key) 
+KeyImpl::KeyImpl(const CSP &csp, const CSSM_KEY &key, bool copy) : ObjectImpl(csp), CssmKey(key)
 {
+       if (copy)
+               keyData() = CssmAutoData(csp.allocator(), keyData()).release();
        mActive=true;
 }