2 * Copyright (c) 2000-2001,2011-2014 Apple 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
;
30 #pragma clang diagnostic push
31 #pragma clang diagnostic ignored "-Wunused-const-variable"
32 // blob type for blobs created by these classes -- done so that we can change the formats later
33 const uint32 kBlobType
= 0x1;
34 #pragma clang diagnostic pop
42 DbCursorMaker::~DbCursorMaker()
45 DbUniqueRecordMaker::~DbUniqueRecordMaker()
50 // Manage DL attachments
52 DLImpl::DLImpl(const Guid
&guid
) : AttachmentImpl(guid
, CSSM_SERVICE_DL
)
56 DLImpl::DLImpl(const Module
&module) : AttachmentImpl(module, CSSM_SERVICE_DL
)
65 DLImpl::getDbNames(char **)
67 CssmError::throwMe(CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED
);
71 DLImpl::freeNameList(char **)
73 CssmError::throwMe(CSSMERR_DL_FUNCTION_NOT_IMPLEMENTED
);
77 DLImpl::newDb(const char *inDbName
, const CSSM_NET_ADDRESS
*inDbLocation
)
79 return new DbImpl(DL(this), inDbName
, inDbLocation
);
86 DbImpl::DbImpl(const DL
&dl
, const char *inDbName
, const CSSM_NET_ADDRESS
*inDbLocation
)
87 : ObjectImpl(dl
), mDbName(inDbName
, inDbLocation
),
88 mUseNameFromHandle(!inDbName
), mNameFromHandle(NULL
),
89 mAccessRequest(CSSM_DB_ACCESS_READ
), mAccessCredentials(NULL
),
90 mDefaultCredentials(NULL
), mOpenParameters(NULL
), mDbInfo(NULL
),
91 mResourceControlContext(NULL
)
100 allocator().free(mNameFromHandle
);
110 StLock
<Mutex
> _(mActivateMutex
);
113 assert(mDbInfo
== nil
);
114 mHandle
.DLHandle
= dl()->handle();
115 check(CSSM_DL_DbOpen(mHandle
.DLHandle
, mDbName
.canonicalName(), dbLocation(),
116 mAccessRequest
, mAccessCredentials
,
117 mOpenParameters
, &mHandle
.DBHandle
));
123 if (!mAccessCredentials
&& mDefaultCredentials
)
124 if (const AccessCredentials
*creds
= mDefaultCredentials
->makeCredentials())
125 CSSM_DL_Authenticate(handle(), mAccessRequest
, creds
); // ignore error
129 DbImpl::createWithBlob(CssmData
&blob
)
132 CssmError::throwMe(CSSMERR_DL_DATASTORE_ALREADY_EXISTS
);
134 if (mDbInfo
== nil
) {
135 // handle a missing (null) mDbInfo as an all-zero one
136 static const CSSM_DBINFO nullDbInfo
= { };
137 mDbInfo
= &nullDbInfo
;
140 mHandle
.DLHandle
= dl()->handle();
142 // create a parameter block for our call to the passthrough
143 CSSM_APPLE_CSPDL_DB_CREATE_WITH_BLOB_PARAMETERS params
;
145 params
.dbName
= mDbName
.canonicalName ();
146 params
.dbLocation
= dbLocation ();
147 params
.dbInfo
= mDbInfo
;
148 params
.accessRequest
= mAccessRequest
;
149 params
.credAndAclEntry
= NULL
;
150 params
.openParameters
= mOpenParameters
;
153 check(CSSM_DL_PassThrough (mHandle
, CSSM_APPLECSPDL_DB_CREATE_WITH_BLOB
, ¶ms
, (void**) &mHandle
.DBHandle
));
159 StLock
<Mutex
> _(mActivateMutex
);
161 CssmError::throwMe(CSSMERR_DL_DATASTORE_ALREADY_EXISTS
);
163 if (mDbInfo
== nil
) {
164 // handle a missing (null) mDbInfo as an all-zero one
165 static const CSSM_DBINFO nullDbInfo
= { };
166 mDbInfo
= &nullDbInfo
;
168 mHandle
.DLHandle
= dl()->handle();
170 if (!mResourceControlContext
&& mAccessCredentials
) {
171 AclFactory::AnyResourceContext
ctx(mAccessCredentials
);
172 check(CSSM_DL_DbCreate(mHandle
.DLHandle
, mDbName
.canonicalName(), dbLocation(),
173 mDbInfo
, mAccessRequest
, &ctx
,
174 mOpenParameters
, &mHandle
.DBHandle
));
176 check(CSSM_DL_DbCreate(mHandle
.DLHandle
, mDbName
.canonicalName(), dbLocation(),
177 mDbInfo
, mAccessRequest
, mResourceControlContext
,
178 mOpenParameters
, &mHandle
.DBHandle
));
186 StLock
<Mutex
> _(mActivateMutex
);
189 check(CSSM_DL_DbClose (mHandle
));
209 StLock
<Mutex
> _(mActivateMutex
);
220 // Deactivate so the db gets closed if it was open.
222 // This call does not require the receiver to be active.
223 check(CSSM_DL_DbDelete(dl()->handle(), mDbName
.canonicalName(), dbLocation(),
224 mAccessCredentials
));
228 DbImpl::rename(const char *newName
)
230 // Deactivate so the db gets closed if it was open.
232 if (::rename(mDbName
.canonicalName(), newName
))
233 UnixError::throwMe(errno
);
235 // Change our DbName to reflect this rename.
236 mDbName
= DbName(newName
, dbLocation());
240 DbImpl::authenticate(CSSM_DB_ACCESS_TYPE inAccessRequest
,
241 const CSSM_ACCESS_CREDENTIALS
*inAccessCredentials
)
245 // XXX Could do the same for create but this would require sticking
246 // inAccessCredentials into mResourceControlContext.
249 // We were not yet active. Just do an open.
250 accessRequest(inAccessRequest
);
251 accessCredentials(inAccessCredentials
);
257 check(CSSM_DL_Authenticate(handle(), inAccessRequest
, inAccessCredentials
));
261 DbImpl::name(char *&outDbName
)
263 check(CSSM_DL_GetDbNameFromHandle(handle(), &outDbName
));
269 if (mUseNameFromHandle
)
272 || !CSSM_DL_GetDbNameFromHandle(handle(), &mNameFromHandle
))
274 return mNameFromHandle
;
277 // We failed to get the name from the handle so use the passed
279 mUseNameFromHandle
= false;
282 return mDbName
.canonicalName();
286 DbImpl::createRelation(CSSM_DB_RECORDTYPE inRelationID
,
287 const char *inRelationName
,
288 uint32 inNumberOfAttributes
,
289 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO
*pAttributeInfo
,
290 uint32 inNumberOfIndexes
,
291 const CSSM_DB_SCHEMA_INDEX_INFO
*pIndexInfo
)
293 check(CSSM_DL_CreateRelation(handle(), inRelationID
, inRelationName
,
294 inNumberOfAttributes
, pAttributeInfo
,
295 inNumberOfIndexes
, pIndexInfo
));
299 DbImpl::destroyRelation(CSSM_DB_RECORDTYPE inRelationID
)
301 check(CSSM_DL_DestroyRelation(handle(), inRelationID
));
305 DbImpl::insert(CSSM_DB_RECORDTYPE recordType
, const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
306 const CSSM_DATA
*data
)
308 DbUniqueRecord
uniqueId(Db(this));
309 check(CSSM_DL_DataInsert(handle(), recordType
,
312 // Activate uniqueId so CSSM_DL_FreeUniqueRecord() gets called when it goes out of scope.
313 uniqueId
->activate();
319 DbImpl::insertWithoutEncryption(CSSM_DB_RECORDTYPE recordType
, const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
322 DbUniqueRecord
uniqueId(Db(this));
324 // fill out the parameters
325 CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION_PARAMETERS params
;
326 params
.recordType
= recordType
;
327 params
.attributes
= const_cast<CSSM_DB_RECORD_ATTRIBUTE_DATA
*>(attributes
);
330 // for clarity, call the overloaded operator to produce a unique record pointer
331 CSSM_DB_UNIQUE_RECORD_PTR
*uniquePtr
= uniqueId
;
334 passThrough (CSSM_APPLECSPDL_DB_INSERT_WITHOUT_ENCRYPTION
, ¶ms
, (void**) uniquePtr
);
336 // Activate uniqueId so CSSM_DL_FreeUniqueRecord() gets called when it goes out of scope.
337 uniqueId
->activate();
343 // Generic Passthrough interface
345 void DbImpl::passThrough(uint32 passThroughId
, const void *in
, void **out
)
347 check(CSSM_DL_PassThrough(handle(), passThroughId
, in
, out
));
352 // Passthrough functions (only implemented by AppleCSPDL).
357 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_LOCK
, NULL
, NULL
));
363 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_UNLOCK
, NULL
, NULL
));
367 DbImpl::unlock(const CSSM_DATA
&password
)
369 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_UNLOCK
, &password
, NULL
));
375 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_STASH
, NULL
, NULL
));
381 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_STASH_CHECK
, NULL
, NULL
));
385 DbImpl::getSettings(uint32
&outIdleTimeout
, bool &outLockOnSleep
)
387 CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS_PTR settings
;
388 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_GET_SETTINGS
,
389 NULL
, reinterpret_cast<void **>(&settings
)));
390 outIdleTimeout
= settings
->idleTimeout
;
391 outLockOnSleep
= settings
->lockOnSleep
;
392 allocator().free(settings
);
396 DbImpl::setSettings(uint32 inIdleTimeout
, bool inLockOnSleep
)
398 CSSM_APPLECSPDL_DB_SETTINGS_PARAMETERS settings
;
399 settings
.idleTimeout
= inIdleTimeout
;
400 settings
.lockOnSleep
= inLockOnSleep
;
401 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_SET_SETTINGS
, &settings
, NULL
));
407 CSSM_APPLECSPDL_DB_IS_LOCKED_PARAMETERS_PTR params
;
408 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_IS_LOCKED
,
409 NULL
, reinterpret_cast<void **>(¶ms
)));
410 bool isLocked
= params
->isLocked
;
411 allocator().free(params
);
416 DbImpl::changePassphrase(const CSSM_ACCESS_CREDENTIALS
*cred
)
418 CSSM_APPLECSPDL_DB_CHANGE_PASSWORD_PARAMETERS params
;
419 params
.accessCredentials
= const_cast<CSSM_ACCESS_CREDENTIALS
*>(cred
);
420 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_CHANGE_PASSWORD
, ¶ms
, NULL
));
423 void DbImpl::recode(const CSSM_DATA
&data
, const CSSM_DATA
&extraData
)
425 // setup parameters for the recode call
426 CSSM_APPLECSPDL_RECODE_PARAMETERS params
;
427 params
.dbBlob
= data
;
428 params
.extraData
= extraData
;
431 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_CSP_RECODE
, ¶ms
, NULL
));
434 void DbImpl::copyBlob (CssmData
&data
)
437 check(CSSM_DL_PassThrough(handle(), CSSM_APPLECSPDL_DB_COPY_BLOB
, NULL
, (void**) (CSSM_DATA
*) &data
));
440 void DbImpl::setBatchMode(Boolean mode
, Boolean rollback
)
443 // We need the DL_DB_Handle of the underyling DL in order to use CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT
446 CSSM_DL_DB_HANDLE dldbHandleOfUnderlyingDL
;
447 result
= CSSM_DL_PassThrough(handle(),
448 CSSM_APPLECSPDL_DB_GET_HANDLE
,
450 (void **)&dldbHandleOfUnderlyingDL
);
452 // Now, toggle the autocommit...
454 if ( result
== errSecSuccess
)
456 CSSM_BOOL modeToUse
= !mode
;
459 result
= (OSStatus
)CSSM_DL_PassThrough(dldbHandleOfUnderlyingDL
,
460 CSSM_APPLEFILEDL_ROLLBACK
, NULL
, NULL
);
463 result
= CSSM_DL_PassThrough(dldbHandleOfUnderlyingDL
,
464 CSSM_APPLEFILEDL_TOGGLE_AUTOCOMMIT
,
465 (void *)((size_t) modeToUse
),
467 if (!rollback
&& modeToUse
)
468 result
= CSSM_DL_PassThrough(dldbHandleOfUnderlyingDL
,
469 CSSM_APPLEFILEDL_COMMIT
,
479 DbImpl::newDbCursor(const CSSM_QUERY
&query
, Allocator
&allocator
)
481 return new DbDbCursorImpl(Db(this), query
, allocator
);
485 DbImpl::newDbCursor(uint32 capacity
, Allocator
&allocator
)
487 return new DbDbCursorImpl(Db(this), capacity
, allocator
);
492 // Db adapters for AclBearer
494 void DbImpl::getAcl(AutoAclEntryInfoList
&aclInfos
, const char *selectionTag
) const
496 aclInfos
.allocator(allocator());
497 check(CSSM_DL_GetDbAcl(const_cast<DbImpl
*>(this)->handle(),
498 reinterpret_cast<const CSSM_STRING
*>(selectionTag
), aclInfos
, aclInfos
));
501 void DbImpl::changeAcl(const CSSM_ACL_EDIT
&aclEdit
,
502 const CSSM_ACCESS_CREDENTIALS
*accessCred
)
504 check(CSSM_DL_ChangeDbAcl(handle(), AccessCredentials::needed(accessCred
), &aclEdit
));
507 void DbImpl::getOwner(AutoAclOwnerPrototype
&owner
) const
509 owner
.allocator(allocator());
510 check(CSSM_DL_GetDbOwner(const_cast<DbImpl
*>(this)->handle(), owner
));
513 void DbImpl::changeOwner(const CSSM_ACL_OWNER_PROTOTYPE
&newOwner
,
514 const CSSM_ACCESS_CREDENTIALS
*accessCred
)
516 check(CSSM_DL_ChangeDbOwner(handle(),
517 AccessCredentials::needed(accessCred
), &newOwner
));
520 void DbImpl::defaultCredentials(DefaultCredentialsMaker
*maker
)
522 mDefaultCredentials
= maker
;
527 // Abstract DefaultCredentialsMakers
529 DbImpl::DefaultCredentialsMaker::~DefaultCredentialsMaker()
534 // Db adapters for DLAccess
536 CSSM_HANDLE
Db::dlGetFirst(const CSSM_QUERY
&query
, CSSM_DB_RECORD_ATTRIBUTE_DATA
&attributes
,
537 CSSM_DATA
*data
, CSSM_DB_UNIQUE_RECORD
*&id
)
540 switch (CSSM_RETURN rc
= CSSM_DL_DataGetFirst(handle(), &query
, &result
, &attributes
, data
, &id
)) {
543 case CSSMERR_DL_ENDOFDATA
:
544 return CSSM_INVALID_HANDLE
;
546 CssmError::throwMe(rc
);
547 return CSSM_INVALID_HANDLE
; // placebo
551 bool Db::dlGetNext(CSSM_HANDLE query
, CSSM_DB_RECORD_ATTRIBUTE_DATA
&attributes
,
552 CSSM_DATA
*data
, CSSM_DB_UNIQUE_RECORD
*&id
)
554 CSSM_RETURN rc
= CSSM_DL_DataGetNext(handle(), query
, &attributes
, data
, &id
);
558 case CSSMERR_DL_ENDOFDATA
:
561 CssmError::throwMe(rc
);
562 return false; // placebo
566 void Db::dlAbortQuery(CSSM_HANDLE query
)
568 CssmError::check(CSSM_DL_DataAbortQuery(handle(), query
));
571 void Db::dlFreeUniqueId(CSSM_DB_UNIQUE_RECORD
*id
)
573 CssmError::check(CSSM_DL_FreeUniqueRecord(handle(), id
));
576 void Db::dlDeleteRecord(CSSM_DB_UNIQUE_RECORD
*id
)
578 CssmError::check(CSSM_DL_DataDelete(handle(), id
));
581 Allocator
&Db::allocator()
583 return Object::allocator();
588 // DbUniqueRecordMaker
591 DbImpl::newDbUniqueRecord()
593 return new DbUniqueRecordImpl(Db(this));
601 DbImpl::dlDbIdentifier()
603 // Always use the same dbName and dbLocation that were passed in during
605 return DLDbIdentifier(dl()->subserviceUid(), mDbName
.canonicalName(), dbLocation());
612 DbDbCursorImpl::DbDbCursorImpl(const Db
&db
, const CSSM_QUERY
&query
, Allocator
&allocator
)
613 : DbCursorImpl(db
, query
, allocator
), mResultsHandle(CSSM_INVALID_HANDLE
)
617 DbDbCursorImpl::DbDbCursorImpl(const Db
&db
, uint32 capacity
, Allocator
&allocator
)
618 : DbCursorImpl(db
, capacity
, allocator
), mResultsHandle(CSSM_INVALID_HANDLE
)
622 DbDbCursorImpl::~DbDbCursorImpl()
632 DbDbCursorImpl::next(DbAttributes
*attributes
, ::CssmDataContainer
*data
, DbUniqueRecord
&uniqueId
)
635 attributes
->deleteValues();
642 DbUniqueRecord
unique(db
);
645 // ask the CSP/DL if the requested record type exists
646 CSSM_BOOL boolResult
;
647 CSSM_DL_PassThrough(db
->handle(), CSSM_APPLECSPDL_DB_RELATION_EXISTS
, &RecordType
, (void**) &boolResult
);
658 result
= CSSM_DL_DataGetFirst(db
->handle(),
665 StLock
<Mutex
> _(mActivateMutex
);
666 if (result
== CSSM_OK
)
668 else if (data
!= NULL
)
673 result
= CSSM_DL_DataGetNext(db
->handle(),
679 if (result
!= CSSM_OK
&& data
!= NULL
)
685 if (result
!= CSSM_OK
&& attributes
!= NULL
)
687 attributes
->invalidate();
690 if (result
== CSSMERR_DL_ENDOFDATA
)
692 StLock
<Mutex
> _(mActivateMutex
);
699 // Activate uniqueId so CSSM_DL_FreeUniqueRecord() gets called when it goes out of scope.
706 DbDbCursorImpl::activate()
711 DbDbCursorImpl::deactivate()
713 StLock
<Mutex
> _(mActivateMutex
);
717 check(CSSM_DL_DataAbortQuery(database()->handle(), mResultsHandle
));
725 DbCursorImpl::DbCursorImpl(const Object
&parent
, const CSSM_QUERY
&query
, Allocator
&allocator
) :
726 ObjectImpl(parent
), CssmAutoQuery(query
, allocator
)
730 DbCursorImpl::DbCursorImpl(const Object
&parent
, uint32 capacity
, Allocator
&allocator
) :
731 ObjectImpl(parent
), CssmAutoQuery(capacity
, allocator
)
736 DbCursorImpl::allocator() const
738 return ObjectImpl::allocator();
742 DbCursorImpl::allocator(Allocator
&alloc
)
744 ObjectImpl::allocator(alloc
);
751 DbUniqueRecordImpl::DbUniqueRecordImpl(const Db
&db
) : ObjectImpl(db
), mDestroyID (false)
755 DbUniqueRecordImpl::~DbUniqueRecordImpl()
761 allocator ().free (mUniqueId
);
770 DbUniqueRecordImpl::deleteRecord()
772 check(CSSM_DL_DataDelete(database()->handle(), mUniqueId
));
776 DbUniqueRecordImpl::modify(CSSM_DB_RECORDTYPE recordType
,
777 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
778 const CSSM_DATA
*data
,
779 CSSM_DB_MODIFY_MODE modifyMode
)
781 check(CSSM_DL_DataModify(database()->handle(), recordType
, mUniqueId
,
787 DbUniqueRecordImpl::modifyWithoutEncryption(CSSM_DB_RECORDTYPE recordType
,
788 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*attributes
,
789 const CSSM_DATA
*data
,
790 CSSM_DB_MODIFY_MODE modifyMode
)
792 // fill out the parameters
793 CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION_PARAMETERS params
;
794 params
.recordType
= recordType
;
795 params
.uniqueID
= mUniqueId
;
796 params
.attributes
= const_cast<CSSM_DB_RECORD_ATTRIBUTE_DATA
*>(attributes
);
797 params
.data
= (CSSM_DATA
*) data
;
798 params
.modifyMode
= modifyMode
;
801 check(CSSM_DL_PassThrough(database()->handle(),
802 CSSM_APPLECSPDL_DB_MODIFY_WITHOUT_ENCRYPTION
,
808 DbUniqueRecordImpl::get(DbAttributes
*attributes
,
809 ::CssmDataContainer
*data
)
812 attributes
->deleteValues();
817 // @@@ Fix the allocators for attributes and data.
819 result
= CSSM_DL_DataGetFromUniqueRecordId(database()->handle(), mUniqueId
,
823 if (result
!= CSSM_OK
)
826 attributes
->invalidate();
827 if (data
!= NULL
) // the data returned is no longer valid
837 DbUniqueRecordImpl::getWithoutEncryption(DbAttributes
*attributes
,
838 ::CssmDataContainer
*data
)
841 attributes
->deleteValues();
846 // @@@ Fix the allocators for attributes and data.
849 // make the parameter block
850 CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION_PARAMETERS params
;
851 params
.uniqueID
= mUniqueId
;
852 params
.attributes
= attributes
;
855 ::CssmDataContainer recordData
;
856 result
= CSSM_DL_PassThrough(database()->handle(), CSSM_APPLECSPDL_DB_GET_WITHOUT_ENCRYPTION
, ¶ms
,
862 DbUniqueRecordImpl::activate()
864 StLock
<Mutex
> _(mActivateMutex
);
869 DbUniqueRecordImpl::deactivate()
871 StLock
<Mutex
> _(mActivateMutex
);
875 check(CSSM_DL_FreeUniqueRecord(database()->handle(), mUniqueId
));
880 DbUniqueRecordImpl::getRecordIdentifier(CSSM_DATA
&data
)
882 check(CSSM_DL_PassThrough(database()->handle(), CSSM_APPLECSPDL_DB_GET_RECORD_IDENTIFIER
,
883 mUniqueId
, (void**) &data
));
886 void DbUniqueRecordImpl::setUniqueRecordPtr(CSSM_DB_UNIQUE_RECORD_PTR uniquePtr
)
889 mUniqueId
= (CSSM_DB_UNIQUE_RECORD_PTR
) allocator ().malloc (sizeof (CSSM_DB_UNIQUE_RECORD
));
890 *mUniqueId
= *uniquePtr
;
897 DbAttributes::DbAttributes()
898 : CssmAutoDbRecordAttributeData(0, Allocator::standard(), Allocator::standard())
902 DbAttributes::DbAttributes(const Db
&db
, uint32 capacity
, Allocator
&allocator
)
903 : CssmAutoDbRecordAttributeData(capacity
, db
->allocator(), allocator
)