X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/dbe775057b53a81d9983d810772462c3233fccd3..refs/heads/master:/OSX/libsecurity_keychain/lib/KeyItem.cpp?ds=sidebyside diff --git a/OSX/libsecurity_keychain/lib/KeyItem.cpp b/OSX/libsecurity_keychain/lib/KeyItem.cpp index fed9dae0..1f079ff5 100644 --- a/OSX/libsecurity_keychain/lib/KeyItem.cpp +++ b/OSX/libsecurity_keychain/lib/KeyItem.cpp @@ -38,8 +38,8 @@ #include #include "KCEventNotifier.h" #include -#include -#include +#include +#include #include // @@@ This needs to be shared. @@ -75,13 +75,13 @@ KeyItem *KeyItem::optional(SecKeyRef ptr) } } -KeyItem::operator CFTypeRef() const throw() +KeyItem::operator CFTypeRef() const _NOEXCEPT { StMaybeLock _(this->getMutexForObject()); if (mWeakSecKeyRef != NULL) { if (_CFTryRetain(mWeakSecKeyRef) == NULL) { - StMaybeLock secKeyCDSAMutex(mWeakSecKeyRef->cdsaKeyMutex); + StMaybeLock secKeyCDSAMutex(static_cast(mWeakSecKeyRef)->cdsaKeyMutex); // mWeakSecKeyRef is not really valid, pointing to SecKeyRef which going to die - it is somewhere between last CFRelease and entering into mutex-protected section of SecCDSAKeyDestroy. Avoid using it, pretend that no enveloping SecKeyRef exists. But make sure that this KeyImpl is disconnected from this about-to-die SecKeyRef, because we do not want KeyImpl connected to it to be really destroyed, it will be connected to newly created SecKeyRef (see below). mWeakSecKeyRef->key = NULL; mWeakSecKeyRef = NULL; @@ -758,8 +758,8 @@ KeyItem::createPair( pubKeyHash.set(*pubKeyHashData); passThrough.allocator().free(pubKeyHashData); - auto_ptr privDescription; - auto_ptr pubDescription; + unique_ptr privDescription; + unique_ptr pubDescription; try { privDescription.reset(new string(initialAccess->promptDescription())); pubDescription.reset(new string(initialAccess->promptDescription())); @@ -997,8 +997,8 @@ KeyItem::importPair( csp.allocator().free(cssmData->Data); csp.allocator().free(cssmData); - auto_ptrprivDescription; - auto_ptrpubDescription; + unique_ptrprivDescription; + unique_ptrpubDescription; try { privDescription.reset(new string(initialAccess->promptDescription())); pubDescription.reset(new string(initialAccess->promptDescription()));