X-Git-Url: https://git.saurik.com/apple/securityd.git/blobdiff_plain/ee396ef47db58c01c7ceaecfec60781c95ffeea1..4cd1cad0dea00daa03e1b54fdf2797a02373ad5b:/src/localkey.cpp diff --git a/src/localkey.cpp b/src/localkey.cpp index e50d82f..c8cb9fe 100644 --- a/src/localkey.cpp +++ b/src/localkey.cpp @@ -39,7 +39,7 @@ LocalKey::LocalKey(Database &db, const CssmKey &newKey, CSSM_KEYATTR_FLAGS moreA { mValidKey = true; setup(newKey, moreAttributes); - secdebug("SSkey", "%p (handle 0x%lx) created from key alg=%ld use=0x%lx attr=0x%lx db=%p", + secdebug("SSkey", "%p (handle %#x) created from key alg=%u use=0x%x attr=0x%x db=%p", this, handle(), mKey.header().algorithm(), mKey.header().usage(), mAttributes, &db); } @@ -101,6 +101,7 @@ LocalDatabase &LocalKey::database() const // CssmClient::Key LocalKey::keyValue() { + StLock _(*this); if (!mValidKey) { getKey(); mValidKey = true; @@ -121,8 +122,10 @@ CSSM_KEYATTR_FLAGS LocalKey::attributes() // // Return a key's handle and header in external form // -void LocalKey::returnKey(Handle &h, CssmKey::Header &hdr) +void LocalKey::returnKey(U32HandleObject::Handle &h, CssmKey::Header &hdr) { + StLock _(*this); + // return handle h = this->handle(); @@ -145,6 +148,7 @@ void LocalKey::returnKey(Handle &h, CssmKey::Header &hdr) // const CssmData &LocalKey::canonicalDigest() { + StLock _(*this); if (!mDigest) { CssmClient::PassThrough ctx(Server::csp()); ctx.key(keyValue());