2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 // dlclient - client interface to CSSM DLs and their operations
22 #include <security_cdsa_client/dlclient.h>
23 #include <security_cdsa_client/aclclient.h>
24 #include <Security/cssmapple.h>
25 #include <Security/cssmapplePriv.h>
26 #include <Security/SecBase.h>
28 using namespace CssmClient
;
31 // blob type for blobs created by these classes -- done so that we can change the formats later
32 const uint32 kBlobType
= 0x1;
41 DbCursorMaker::~DbCursorMaker()
44 DbUniqueRecordMaker::~DbUniqueRecordMaker()
49 // Manage DL attachments
51 DLImpl::DLImpl(const Guid
&guid
) : AttachmentImpl(guid
, CSSM_SERVICE_DL
)
55 DLImpl::DLImpl(const Module
&module) : AttachmentImpl(module, CSSM_SERVICE_DL
)
64 DLImpl::getDbNames(char **)
66 CssmError::throwMe(CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED
);
70 DLImpl::freeNameList(char **)
72 CssmError::throwMe(CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED
);
76 DLImpl::newDb(const char *inDbName
, const CSSM_NET_ADDRESS
*inDbLocation
)
78 return new DbImpl(DL(this), inDbName
, inDbLocation
);
85 DbImpl::DbImpl(const DL
&dl
, const char *inDbName
, const CSSM_NET_ADDRESS
*inDbLocation
)
86 : ObjectImpl(dl
), mDbName(inDbName
, inDbLocation
),
87 mUseNameFromHandle(!inDbName
), mNameFromHandle(NULL
),
88 mAccessRequest(CSSM_DB_ACCESS_READ
), mAccessCredentials(NULL
),
89 mDefaultCredentials(NULL
), mOpenParameters(NULL
), mDbInfo(NULL
),
90 mResourceControlContext(NULL
)
99 allocator().free(mNameFromHandle
);
109 StLock
<Mutex
> _(mActivateMutex
);
112 assert(mDbInfo
== nil
);
113 mHandle
.DLHandle
= dl()->handle();
114 check(CSSM_DL_DbOpen(mHandle
.DLHandle
, mDbName
.canonicalName(), dbLocation(),
115 mAccessRequest
, mAccessCredentials
,
116 mOpenParameters
, &mHandle
.DBHandle
));
122 if (!mAccessCredentials
&& mDefaultCredentials
)
123 if (const AccessCredentials
*creds
= mDefaultCredentials
->makeCredentials())
124 CSSM_DL_Authenticate(handle(), mAccessRequest
, creds
); // ignore error
128 DbImpl::createWithBlob(CssmData
&blob
)
131 CssmError::throwMe(CSSMERR_DL_DATASTORE_ALREADY_EXISTS
);
133 if (mDbInfo
== nil
) {
134 // handle a missing (null) mDbInfo as an all-zero one
135 static const CSSM_DBINFO nullDbInfo
= { };
136 mDbInfo
= &nullDbInfo
;
139 mHandle
.DLHandle
= dl()->handle();
141 // create a parameter block for our call to the passthrough
142 CSSM_APPLE_CSPDL_DB_CREATE_WITH_BLOB_PARAMETERS params
;
144 params
.dbName
= mDbName
.canonicalName ();
145 params
.dbLocation
= dbLocation ();
146 params
.dbInfo
= mDbInfo
;
147 params
.accessRequest
= mAccessRequest
;
148 params
.credAndAclEntry
= NULL
;
149 params
.openParameters
= mOpenParameters
;
152 check(CSSM_DL_PassThrough (mHandle
, CSSM_APPLECSPDL_DB_CREATE_WITH_BLOB
, ¶ms
, (void**) &mHandle
.DBHandle
));
158 StLock
<Mutex
> _(mActivateMutex
);
160 CssmError::throwMe(CSSMERR_DL_DATASTORE_ALREADY_EXISTS
);
162 if (mDbInfo
== nil
) {
163 // handle a missing (null) mDbInfo as an all-zero one
164 static const CSSM_DBINFO nullDbInfo
= { };
165 mDbInfo
= &nullDbInfo
;
167 mHandle
.DLHandle
= dl()->handle();
169 if (!mResourceControlContext
&& mAccessCredentials
) {
170 AclFactory::AnyResourceContext
ctx(mAccessCredentials
);
171 check(CSSM_DL_DbCreate(mHandle
.DLHandle
, mDbName
.canonicalName(), dbLocation(),
172 mDbInfo
, mAccessRequest
, &ctx
,
173 mOpenParameters
, &mHandle
.DBHandle
));
175 check(CSSM_DL_DbCreate(mHandle
.DLHandle
, mDbName
.canonicalName(), dbLocation(),
176 mDbInfo
, mAccessRequest
, mResourceControlContext
,
177 mOpenParameters
, &mHandle
.DBHandle
));
185 StLock
<Mutex
> _(mActivateMutex
);
188 check(CSSM_DL_DbClose (mHandle
));
208 StLock
<Mutex
> _(mActivateMutex
);
219 // Deactivate so the db gets closed if it was open.
221 // This call does not require the receiver to be active.
222 check(CSSM_DL_DbDelete(dl()->handle(), mDbName
.canonicalName(), dbLocation(),
223 mAccessCredentials
));
227 DbImpl::rename(const char *newName
)
229 // Deactivate so the db gets closed if it was open.
231 if (::rename(mDbName
.canonicalName(), newName
))
232 UnixError::throwMe(errno
);
234 // Change our DbName to reflect this rename.
235 mDbName
= DbName(newName
, dbLocation());
239 DbImpl::authenticate(CSSM_DB_ACCESS_TYPE inAccessRequest
,
240 const CSSM_ACCESS_CREDENTIALS
*inAccessCredentials
)
244 // XXX Could do the same for create but this would require sticking
245 // inAccessCredentials into mResourceControlContext.
248 // We were not yet active. Just do an open.
249 accessRequest(inAccessRequest
);
250 accessCredentials(inAccessCredentials
);
256 check(CSSM_DL_Authenticate(handle(), inAccessRequest
, inAccessCredentials
));
260 DbImpl::name(char *&outDbName
)
262 check(CSSM_DL_GetDbNameFromHandle(handle(), &outDbName
));
268 if (mUseNameFromHandle
)
271 || !CSSM_DL_GetDbNameFromHandle(handle(), &mNameFromHandle
))
273 return mNameFromHandle
;
276 // We failed to get the name from the handle so use the passed
278 mUseNameFromHandle
= false;
281 return mDbName
.canonicalName();
285 DbImpl::createRelation(CSSM_DB_RECORDTYPE inRelationID
,
286 const char *inRelationName
,
287 uint32 inNumberOfAttributes
,
288 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO
*pAttributeInfo
,
289 uint32 inNumberOfIndexes
,
290 const CSSM_DB_SCHEMA_INDEX_INFO
*pIndexInfo
)
292 check(CSSM_DL_CreateRelation(handle(), inRelationID
, inRelationName
,
293 inNumberOfAttributes
, pAttributeInfo
,
294 inNumberOfIndexes
, pIndexInfo
));
298 DbImpl::destroyRelation(CSSM_DB_RECORDTYPE inRelationID
)
300 check(CSSM_DL_DestroyRelation(handle(), inRelationID
));
304 DbImpl::insert(CSSM_DB_RECORDTYPE recordType
, const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
305 const CSSM_DATA
*data
)
307 DbUniqueRecord
uniqueId(Db(this));
308 check(CSSM_DL_DataInsert(handle(), recordType
,
311 // Activate uniqueId so CSSM_DL_FreeUniqueRecord() gets called when it goes out of scope.
312 uniqueId
->activate();
318 DbImpl::insertWithoutEncryption(CSSM_DB_RECORDTYPE recordType
, const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
321 DbUniqueRecord
uniqueId(Db(this));
323 // fill out the parameters
324 CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION_PARAMETERS params
;
325 params
.recordType
= recordType
;
326 params
.attributes
= const_cast<CSSM_DB_RECORD_ATTRIBUTE_DATA
*>(attributes
);
329 // for clarity, call the overloaded operator to produce a unique record pointer
330 CSSM_DB_UNIQUE_RECORD_PTR
*uniquePtr
= uniqueId
;
333 passThrough (CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION
, ¶ms
, (void**) uniquePtr
);
335 // Activate uniqueId so CSSM_DL_FreeUniqueRecord() gets called when it goes out of scope.
336 uniqueId
->activate();
342 // Generic Passthrough interface
344 void DbImpl::passThrough(uint32 passThroughId
, const void *in
, void **out
)
346 check(CSSM_DL_PassThrough(handle(), passThroughId
, in
, out
));
351 // Passthrough functions (only implemented by AppleCSPDL).
356 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_LOCK
, NULL
, NULL
));
362 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_UNLOCK
, NULL
, NULL
));
366 DbImpl::unlock(const CSSM_DATA
&password
)
368 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_UNLOCK
, &password
, NULL
));
374 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_STASH
, NULL
, NULL
));
380 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_STASH_CHECK
, NULL
, NULL
));
384 DbImpl::getSettings(uint32
&outIdleTimeout
, bool &outLockOnSleep
)
386 CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS_PTR settings
;
387 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_GET_SETTINGS
,
388 NULL
, reinterpret_cast<void **>(&settings
)));
389 outIdleTimeout
= settings
->idleTimeout
;
390 outLockOnSleep
= settings
->lockOnSleep
;
391 allocator().free(settings
);
395 DbImpl::setSettings(uint32 inIdleTimeout
, bool inLockOnSleep
)
397 CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS settings
;
398 settings
.idleTimeout
= inIdleTimeout
;
399 settings
.lockOnSleep
= inLockOnSleep
;
400 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_SET_SETTINGS
, &settings
, NULL
));
406 CSSM_APPLECSPDL_DB_IS_LOCKED_PARAMETERS_PTR params
;
407 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_IS_LOCKED
,
408 NULL
, reinterpret_cast<void **>(¶ms
)));
409 bool isLocked
= params
->isLocked
;
410 allocator().free(params
);
415 DbImpl::changePassphrase(const CSSM_ACCESS_CREDENTIALS
*cred
)
417 CSSM_APPLECSPDL_DB_CHANGE_PASSWORD_PARAMETERS params
;
418 params
.accessCredentials
= const_cast<CSSM_ACCESS_CREDENTIALS
*>(cred
);
419 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_CHANGE_PASSWORD
, ¶ms
, NULL
));
422 void DbImpl::recode(const CSSM_DATA
&data
, const CSSM_DATA
&extraData
)
424 // setup parameters for the recode call
425 CSSM_APPLECSPDL_RECODE_PARAMETERS params
;
426 params
.dbBlob
= data
;
427 params
.extraData
= extraData
;
430 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_CSP_RECODE
, ¶ms
, NULL
));
433 void DbImpl::copyBlob (CssmData
&data
)
436 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_COPY_BLOB
, NULL
, (void**) (CSSM_DATA
*) &data
));
439 void DbImpl::setBatchMode(Boolean mode
, Boolean rollback
)
442 // We need the DL_DB_Handle of the underyling DL in order to use CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT
445 CSSM_DL_DB_HANDLE dldbHandleOfUnderlyingDL
;
446 result
= CSSM_DL_PassThrough(handle(),
447 CSSM_APPLECSPDL_DB_GET_HANDLE
,
449 (void **)&dldbHandleOfUnderlyingDL
);
451 // Now, toggle the autocommit...
453 if ( result
== errSecSuccess
)
455 CSSM_BOOL modeToUse
= !mode
;
458 result
= (OSStatus
)CSSM_DL_PassThrough(dldbHandleOfUnderlyingDL
,
459 CSSM_APPLEFILEDL_ROLLBACK
, NULL
, NULL
);
462 result
= CSSM_DL_PassThrough(dldbHandleOfUnderlyingDL
,
463 CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT
,
464 (void *)((size_t) modeToUse
),
466 if (!rollback
&& modeToUse
)
467 result
= CSSM_DL_PassThrough(dldbHandleOfUnderlyingDL
,
468 CSSM_APPLEFILEDL_COMMIT
,
478 DbImpl::newDbCursor(const CSSM_QUERY
&query
, Allocator
&allocator
)
480 return new DbDbCursorImpl(Db(this), query
, allocator
);
484 DbImpl::newDbCursor(uint32 capacity
, Allocator
&allocator
)
486 return new DbDbCursorImpl(Db(this), capacity
, allocator
);
491 // Db adapters for AclBearer
493 void DbImpl::getAcl(AutoAclEntryInfoList
&aclInfos
, const char *selectionTag
) const
495 aclInfos
.allocator(allocator());
496 check(CSSM_DL_GetDbAcl(const_cast<DbImpl
*>(this)->handle(),
497 reinterpret_cast<const CSSM_STRING
*>(selectionTag
), aclInfos
, aclInfos
));
500 void DbImpl::changeAcl(const CSSM_ACL_EDIT
&aclEdit
,
501 const CSSM_ACCESS_CREDENTIALS
*accessCred
)
503 check(CSSM_DL_ChangeDbAcl(handle(), AccessCredentials::needed(accessCred
), &aclEdit
));
506 void DbImpl::getOwner(AutoAclOwnerPrototype
&owner
) const
508 owner
.allocator(allocator());
509 check(CSSM_DL_GetDbOwner(const_cast<DbImpl
*>(this)->handle(), owner
));
512 void DbImpl::changeOwner(const CSSM_ACL_OWNER_PROTOTYPE
&newOwner
,
513 const CSSM_ACCESS_CREDENTIALS
*accessCred
)
515 check(CSSM_DL_ChangeDbOwner(handle(),
516 AccessCredentials::needed(accessCred
), &newOwner
));
519 void DbImpl::defaultCredentials(DefaultCredentialsMaker
*maker
)
521 mDefaultCredentials
= maker
;
526 // Abstract DefaultCredentialsMakers
528 DbImpl::DefaultCredentialsMaker::~DefaultCredentialsMaker()
533 // Db adapters for DLAccess
535 CSSM_HANDLE
Db::dlGetFirst(const CSSM_QUERY
&query
, CSSM_DB_RECORD_ATTRIBUTE_DATA
&attributes
,
536 CSSM_DATA
*data
, CSSM_DB_UNIQUE_RECORD
*&id
)
539 switch (CSSM_RETURN rc
= CSSM_DL_DataGetFirst(handle(), &query
, &result
, &attributes
, data
, &id
)) {
542 case CSSMERR_DL_ENDOFDATA
:
543 return CSSM_INVALID_HANDLE
;
545 CssmError::throwMe(rc
);
546 return CSSM_INVALID_HANDLE
; // placebo
550 bool Db::dlGetNext(CSSM_HANDLE query
, CSSM_DB_RECORD_ATTRIBUTE_DATA
&attributes
,
551 CSSM_DATA
*data
, CSSM_DB_UNIQUE_RECORD
*&id
)
553 CSSM_RETURN rc
= CSSM_DL_DataGetNext(handle(), query
, &attributes
, data
, &id
);
557 case CSSMERR_DL_ENDOFDATA
:
560 CssmError::throwMe(rc
);
561 return false; // placebo
565 void Db::dlAbortQuery(CSSM_HANDLE query
)
567 CssmError::check(CSSM_DL_DataAbortQuery(handle(), query
));
570 void Db::dlFreeUniqueId(CSSM_DB_UNIQUE_RECORD
*id
)
572 CssmError::check(CSSM_DL_FreeUniqueRecord(handle(), id
));
575 void Db::dlDeleteRecord(CSSM_DB_UNIQUE_RECORD
*id
)
577 CssmError::check(CSSM_DL_DataDelete(handle(), id
));
580 Allocator
&Db::allocator()
582 return Object::allocator();
587 // DbUniqueRecordMaker
590 DbImpl::newDbUniqueRecord()
592 return new DbUniqueRecordImpl(Db(this));
600 DbImpl::dlDbIdentifier()
602 // Always use the same dbName and dbLocation that were passed in during
604 return DLDbIdentifier(dl()->subserviceUid(), mDbName
.canonicalName(), dbLocation());
611 DbDbCursorImpl::DbDbCursorImpl(const Db
&db
, const CSSM_QUERY
&query
, Allocator
&allocator
)
612 : DbCursorImpl(db
, query
, allocator
), mResultsHandle(CSSM_INVALID_HANDLE
)
616 DbDbCursorImpl::DbDbCursorImpl(const Db
&db
, uint32 capacity
, Allocator
&allocator
)
617 : DbCursorImpl(db
, capacity
, allocator
), mResultsHandle(CSSM_INVALID_HANDLE
)
621 DbDbCursorImpl::~DbDbCursorImpl()
631 DbDbCursorImpl::next(DbAttributes
*attributes
, ::CssmDataContainer
*data
, DbUniqueRecord
&uniqueId
)
634 attributes
->deleteValues();
641 DbUniqueRecord
unique(db
);
644 // ask the CSP/DL if the requested record type exists
645 CSSM_BOOL boolResult
;
646 CSSM_DL_PassThrough(db
->handle(), CSSM_APPLECSPDL_DB_RELATION_EXISTS
, &RecordType
, (void**) &boolResult
);
657 result
= CSSM_DL_DataGetFirst(db
->handle(),
664 StLock
<Mutex
> _(mActivateMutex
);
665 if (result
== CSSM_OK
)
667 else if (data
!= NULL
)
672 result
= CSSM_DL_DataGetNext(db
->handle(),
678 if (result
!= CSSM_OK
&& data
!= NULL
)
684 if (result
!= CSSM_OK
&& attributes
!= NULL
)
686 attributes
->invalidate();
689 if (result
== CSSMERR_DL_ENDOFDATA
)
691 StLock
<Mutex
> _(mActivateMutex
);
698 // Activate uniqueId so CSSM_DL_FreeUniqueRecord() gets called when it goes out of scope.
705 DbDbCursorImpl::activate()
710 DbDbCursorImpl::deactivate()
712 StLock
<Mutex
> _(mActivateMutex
);
716 check(CSSM_DL_DataAbortQuery(database()->handle(), mResultsHandle
));
724 DbCursorImpl::DbCursorImpl(const Object
&parent
, const CSSM_QUERY
&query
, Allocator
&allocator
) :
725 ObjectImpl(parent
), CssmAutoQuery(query
, allocator
)
729 DbCursorImpl::DbCursorImpl(const Object
&parent
, uint32 capacity
, Allocator
&allocator
) :
730 ObjectImpl(parent
), CssmAutoQuery(capacity
, allocator
)
735 DbCursorImpl::allocator() const
737 return ObjectImpl::allocator();
741 DbCursorImpl::allocator(Allocator
&alloc
)
743 ObjectImpl::allocator(alloc
);
750 DbUniqueRecordImpl::DbUniqueRecordImpl(const Db
&db
) : ObjectImpl(db
), mDestroyID (false)
754 DbUniqueRecordImpl::~DbUniqueRecordImpl()
760 allocator ().free (mUniqueId
);
769 DbUniqueRecordImpl::deleteRecord()
771 check(CSSM_DL_DataDelete(database()->handle(), mUniqueId
));
775 DbUniqueRecordImpl::modify(CSSM_DB_RECORDTYPE recordType
,
776 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
777 const CSSM_DATA
*data
,
778 CSSM_DB_MODIFY_MODE modifyMode
)
780 check(CSSM_DL_DataModify(database()->handle(), recordType
, mUniqueId
,
786 DbUniqueRecordImpl::modifyWithoutEncryption(CSSM_DB_RECORDTYPE recordType
,
787 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
788 const CSSM_DATA
*data
,
789 CSSM_DB_MODIFY_MODE modifyMode
)
791 // fill out the parameters
792 CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION_PARAMETERS params
;
793 params
.recordType
= recordType
;
794 params
.uniqueID
= mUniqueId
;
795 params
.attributes
= const_cast<CSSM_DB_RECORD_ATTRIBUTE_DATA
*>(attributes
);
796 params
.data
= (CSSM_DATA
*) data
;
797 params
.modifyMode
= modifyMode
;
800 check(CSSM_DL_PassThrough(database()->handle(),
801 CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION
,
807 DbUniqueRecordImpl::get(DbAttributes
*attributes
,
808 ::CssmDataContainer
*data
)
811 attributes
->deleteValues();
816 // @@@ Fix the allocators for attributes and data.
818 result
= CSSM_DL_DataGetFromUniqueRecordId(database()->handle(), mUniqueId
,
822 if (result
!= CSSM_OK
)
825 attributes
->invalidate();
826 if (data
!= NULL
) // the data returned is no longer valid
836 DbUniqueRecordImpl::getWithoutEncryption(DbAttributes
*attributes
,
837 ::CssmDataContainer
*data
)
840 attributes
->deleteValues();
845 // @@@ Fix the allocators for attributes and data.
848 // make the parameter block
849 CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION_PARAMETERS params
;
850 params
.uniqueID
= mUniqueId
;
851 params
.attributes
= attributes
;
854 ::CssmDataContainer recordData
;
855 result
= CSSM_DL_PassThrough(database()->handle(), CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION
, ¶ms
,
861 DbUniqueRecordImpl::activate()
863 StLock
<Mutex
> _(mActivateMutex
);
868 DbUniqueRecordImpl::deactivate()
870 StLock
<Mutex
> _(mActivateMutex
);
874 check(CSSM_DL_FreeUniqueRecord(database()->handle(), mUniqueId
));
879 DbUniqueRecordImpl::getRecordIdentifier(CSSM_DATA
&data
)
881 check(CSSM_DL_PassThrough(database()->handle(), CSSM_APPLECSPDL_DB_GET_RECORD_IDENTIFIER
,
882 mUniqueId
, (void**) &data
));
885 void DbUniqueRecordImpl::setUniqueRecordPtr(CSSM_DB_UNIQUE_RECORD_PTR uniquePtr
)
888 mUniqueId
= (CSSM_DB_UNIQUE_RECORD_PTR
) allocator ().malloc (sizeof (CSSM_DB_UNIQUE_RECORD
));
889 *mUniqueId
= *uniquePtr
;
896 DbAttributes::DbAttributes()
897 : CssmAutoDbRecordAttributeData(0, Allocator::standard(), Allocator::standard())
901 DbAttributes::DbAttributes(const Db
&db
, uint32 capacity
, Allocator
&allocator
)
902 : CssmAutoDbRecordAttributeData(capacity
, db
->allocator(), allocator
)