2 * Copyright (c) 2000-2001,2011-2012,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 // DatabaseSession.cpp - DL Session.
22 #include <security_cdsa_plugin/DatabaseSession.h>
24 #include <security_cdsa_plugin/Database.h>
25 #include <security_cdsa_plugin/DbContext.h>
26 #include <security_cdsa_utilities/cssmbridge.h>
28 #include <security_utilities/debugging.h>
30 /* log open/close events */
31 #define DOCDebug(args...) secinfo("DBOpen", ## args)
36 extern "C" char* cssmErrorString(CSSM_RETURN errCode
);
39 // Session constructor
41 DatabaseSession::DatabaseSession(DatabaseManager
&inDatabaseManager
)
42 : mDatabaseManager(inDatabaseManager
)
46 DatabaseSession::~DatabaseSession()
53 DatabaseSession::GetDbNames(CSSM_NAME_LIST_PTR
&outNameList
)
55 secinfo("dbsession", "GetDbNames");
56 outNameList
= mDatabaseManager
.getDbNames (*this);
59 // dump the returned names
61 secinfo("dbsession", "GetDbNames returned %d names", outNameList
->NumStrings
);
62 for (n
= 0; n
< outNameList
->NumStrings
; ++n
)
64 secinfo("dbsession", "%d: %s", n
, outNameList
->String
[n
]);
71 DatabaseSession::FreeNameList(CSSM_NAME_LIST
&inNameList
)
73 secinfo("dbsession", "FreeNameList");
74 mDatabaseManager
.freeNameList (*this, inNameList
);
79 DatabaseSession::DbDelete(const char *inDbName
,
80 const CSSM_NET_ADDRESS
*inDbLocation
,
81 const AccessCredentials
*inAccessCred
)
83 // The databaseManager will notify all its DbContext instances
84 // that the database is question is being deleted.
85 secinfo("dbsession", "DbDelete of %s", inDbName
);
86 mDatabaseManager
.dbDelete(*this, DbName(inDbName
, CssmNetAddress::optional(inDbLocation
)), inAccessCred
);
89 // DbContext creation and destruction.
91 DatabaseSession::DbCreate(const char *inDbName
,
92 const CSSM_NET_ADDRESS
*inDbLocation
,
93 const CSSM_DBINFO
&inDBInfo
,
94 CSSM_DB_ACCESS_TYPE inAccessRequest
,
95 const CSSM_RESOURCE_CONTROL_CONTEXT
*inCredAndAclEntry
,
96 const void *inOpenParameters
,
97 CSSM_DB_HANDLE
&outDbHandle
)
99 outDbHandle
= CSSM_INVALID_HANDLE
; // CDSA 2.0 says to set this if we fail
100 secinfo("dbsession", "DbCreate of %s", inDbName
);
102 outDbHandle
= insertDbContext(mDatabaseManager
.dbCreate(*this,
103 DbName(inDbName
, CssmNetAddress::optional(inDbLocation
)),
108 secinfo("dbsession", "DbCreate returned handle %#lx", outDbHandle
);
112 DatabaseSession::DbOpen(const char *inDbName
,
113 const CSSM_NET_ADDRESS
*inDbLocation
,
114 CSSM_DB_ACCESS_TYPE inAccessRequest
,
115 const AccessCredentials
*inAccessCred
,
116 const void *inOpenParameters
,
117 CSSM_DB_HANDLE
&outDbHandle
)
119 DOCDebug("DatabaseSession::DbOpen: dbName %s", inDbName
);
120 secinfo("dbsession", "DbOpen of %s", inDbName
);
121 outDbHandle
= CSSM_INVALID_HANDLE
; // CDSA 2.0 says to set this if we fail
122 outDbHandle
= insertDbContext(mDatabaseManager
.dbOpen(*this,
123 DbName(inDbName
, CssmNetAddress::optional(inDbLocation
)),
127 secinfo("dbsession", "DbOpen returned handle %#lx", outDbHandle
);
131 DatabaseSession::insertDbContext(DbContext
&inDbContext
)
133 CSSM_DB_HANDLE aDbHandle
;
136 aDbHandle
= inDbContext
.handle ();
137 StLock
<Mutex
> _(mDbContextMapLock
);
138 mDbContextMap
.insert(DbContextMap::value_type(aDbHandle
, &inDbContext
));
143 mDatabaseManager
.dbClose(inDbContext
);
151 DatabaseSession::findDbContext(CSSM_DB_HANDLE inDbHandle
)
153 StLock
<Mutex
> _(mDbContextMapLock
);
154 DbContextMap::iterator it
= mDbContextMap
.find(inDbHandle
);
155 if (it
== mDbContextMap
.end())
156 CssmError::throwMe(CSSM_ERRCODE_INVALID_DB_HANDLE
);
161 DatabaseSession::closeAll()
163 StLock
<Mutex
> _(mDbContextMapLock
);
164 for (DbContextMap::iterator it
= mDbContextMap
.begin();
165 it
!= mDbContextMap
.end();
168 DbContext
*aDbContext
= it
->second
;
171 mDatabaseManager
.dbClose(*aDbContext
);
172 // This is done by the database itself which owns the context.
177 // Ignore exceptions since we want to close as many DBs as possible.
178 // XXX @@@ log an error or something.
182 mDbContextMap
.clear();
185 // Operations using DbContext instances.
187 DatabaseSession::DbClose(CSSM_DB_HANDLE inDbHandle
)
189 StLock
<Mutex
> _(mDbContextMapLock
);
190 DOCDebug("DatabaseSession::Close");
191 secinfo("dbsession", "DbClose of handle %ld", inDbHandle
);
192 DbContextMap::iterator it
= mDbContextMap
.find(inDbHandle
);
193 if (it
== mDbContextMap
.end())
194 CssmError::throwMe(CSSM_ERRCODE_INVALID_DB_HANDLE
);
195 unique_ptr
<DbContext
> aDbContext(it
->second
);
196 mDbContextMap
.erase(it
);
197 mDatabaseManager
.dbClose(*aDbContext
);
201 DatabaseSession::CreateRelation(CSSM_DB_HANDLE inDbHandle
,
202 CSSM_DB_RECORDTYPE inRelationID
,
203 const char *inRelationName
,
204 uint32 inNumberOfAttributes
,
205 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO
*inAttributeInfo
,
206 uint32 inNumberOfIndexes
,
207 const CSSM_DB_SCHEMA_INDEX_INFO
&inIndexInfo
)
209 secinfo("dbsession", "CreateRelation from handle %ld of record type %X with relation name %s", inDbHandle
, inRelationID
, inRelationName
);
210 secinfo("dbsession", "number of attributes = %d", inNumberOfAttributes
);
213 for (n
= 0; n
< inNumberOfAttributes
; ++n
)
215 secinfo("dbsession", "%d: id %d name %s, data type %d", n
, inAttributeInfo
[n
].AttributeId
,
216 inAttributeInfo
[n
].AttributeName
,
217 inAttributeInfo
[n
].DataType
);
221 secinfo("dbsession", "number of indexes: %d", inNumberOfIndexes
);
223 for (n
= 0; n
< inNumberOfIndexes
; ++n
)
225 secinfo("dbsession", "%d: id %d indexid %d indextype %d location %d", n
, inIndexInfo
.AttributeId
,
226 inIndexInfo
.IndexedDataLocation
,
228 inIndexInfo
.IndexType
);
232 DbContext
&aDbContext
= findDbContext(inDbHandle
);
233 return aDbContext
.mDatabase
.createRelation(aDbContext
, inRelationID
, inRelationName
,
234 inNumberOfAttributes
, inAttributeInfo
,
235 inNumberOfIndexes
, inIndexInfo
);
239 DatabaseSession::DestroyRelation(CSSM_DB_HANDLE inDbHandle
,
240 CSSM_DB_RECORDTYPE inRelationID
)
242 secinfo("dbsession", "DestroyRelation (handle %ld) %d", inDbHandle
, inRelationID
);
243 DbContext
&aDbContext
= findDbContext(inDbHandle
);
244 aDbContext
.mDatabase
.destroyRelation(aDbContext
, inRelationID
);
248 DatabaseSession::Authenticate(CSSM_DB_HANDLE inDbHandle
,
249 CSSM_DB_ACCESS_TYPE inAccessRequest
,
250 const AccessCredentials
&inAccessCred
)
252 secinfo("dbsession", "Authenticate (handle %ld) inAccessRequest %d", inDbHandle
, inAccessRequest
);
253 DbContext
&aDbContext
= findDbContext(inDbHandle
);
254 aDbContext
.mDatabase
.authenticate(aDbContext
, inAccessRequest
, inAccessCred
);
259 DatabaseSession::GetDbAcl(CSSM_DB_HANDLE inDbHandle
,
260 const CSSM_STRING
*inSelectionTag
,
261 uint32
&outNumberOfAclInfos
,
262 CSSM_ACL_ENTRY_INFO_PTR
&outAclInfos
)
264 secinfo("dbsession", "GetDbAcl (handle %ld)", inDbHandle
);
265 DbContext
&aDbContext
= findDbContext(inDbHandle
);
266 aDbContext
.mDatabase
.getDbAcl(aDbContext
, inSelectionTag
, outNumberOfAclInfos
, outAclInfos
);
270 DatabaseSession::ChangeDbAcl(CSSM_DB_HANDLE inDbHandle
,
271 const AccessCredentials
&inAccessCred
,
272 const CSSM_ACL_EDIT
&inAclEdit
)
274 secinfo("dbsession", "ChangeDbAcl (handle %ld)", inDbHandle
);
275 DbContext
&aDbContext
= findDbContext(inDbHandle
);
276 aDbContext
.mDatabase
.changeDbAcl(aDbContext
, inAccessCred
, inAclEdit
);
280 DatabaseSession::GetDbOwner(CSSM_DB_HANDLE inDbHandle
,
281 CSSM_ACL_OWNER_PROTOTYPE
&outOwner
)
283 secinfo("dbsession", "GetDbOwner (handle %ld)", inDbHandle
);
284 DbContext
&aDbContext
= findDbContext(inDbHandle
);
285 aDbContext
.mDatabase
.getDbOwner(aDbContext
, outOwner
);
289 DatabaseSession::ChangeDbOwner(CSSM_DB_HANDLE inDbHandle
,
290 const AccessCredentials
&inAccessCred
,
291 const CSSM_ACL_OWNER_PROTOTYPE
&inNewOwner
)
293 secinfo("dbsession", "ChangeDbOwner (handle %ld)", inDbHandle
);
294 DbContext
&aDbContext
= findDbContext(inDbHandle
);
295 aDbContext
.mDatabase
.changeDbOwner(aDbContext
, inAccessCred
, inNewOwner
);
299 DatabaseSession::GetDbNameFromHandle(CSSM_DB_HANDLE inDbHandle
,
302 secinfo("dbsession", "GetDbNameFromHandle (handle %ld)", inDbHandle
);
303 DbContext
&aDbContext
= findDbContext(inDbHandle
);
304 Required(outDbName
) = aDbContext
.mDatabase
.getDbNameFromHandle(aDbContext
);
305 secinfo("dbsession", "name: %s", *outDbName
);
311 #if 0 /* unusued functions */
314 void DumpAttributeInfo(const CSSM_DB_ATTRIBUTE_INFO
&info
)
316 const char* attrNameType
;
317 switch (info
.AttributeFormat
)
319 case CSSM_DB_ATTRIBUTE_NAME_AS_STRING
:
320 attrNameType
= "CSSM_DB_ATTRIBUTE_NAME_AS_STRING";
323 case CSSM_DB_ATTRIBUTE_NAME_AS_OID
:
324 attrNameType
= "CSSM_DB_ATTRIBUTE_NAME_AS_OID";
327 case CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER
:
328 attrNameType
= "CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER";
332 secinfo("dbsession", " Attribute name type: %s", attrNameType
);
333 switch (info
.AttributeFormat
)
335 case CSSM_DB_ATTRIBUTE_NAME_AS_STRING
:
336 secinfo("dbsession", " name: %s", info
.Label
.AttributeName
);
339 case CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER
:
340 secinfo("dbsession", " name: %d", info
.Label
.AttributeID
);
343 case CSSM_DB_ATTRIBUTE_NAME_AS_OID
:
344 secinfo("dbsession", " name is oid");
349 switch (info
.AttributeFormat
)
351 case CSSM_DB_ATTRIBUTE_FORMAT_STRING
:
352 s
= "CSSM_DB_ATTRIBUTE_FORMAT_STRING";
354 case CSSM_DB_ATTRIBUTE_FORMAT_SINT32
:
355 s
= "CSSM_DB_ATTRIBUTE_FORMAT_SINT32";
357 case CSSM_DB_ATTRIBUTE_FORMAT_UINT32
:
358 s
= "CSSM_DB_ATTRIBUTE_FORMAT_UINT32";
360 case CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM
:
361 s
= "CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM";
363 case CSSM_DB_ATTRIBUTE_FORMAT_REAL
:
364 s
= "CSSM_DB_ATTRIBUTE_FORMAT_REAL";
366 case CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE
:
367 s
= "CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE";
369 case CSSM_DB_ATTRIBUTE_FORMAT_BLOB
:
370 s
= "CSSM_DB_ATTRIBUTE_FORMAT_BLOB";
372 case CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32
:
373 s
= "CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32";
375 case CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX
:
376 s
= "CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX";
380 secinfo("dbsession", " attribute format: %s", s
);
385 void DumpAttributes(const CSSM_DB_RECORD_ATTRIBUTE_DATA
*inAttributes
)
389 secinfo("dbsession", "No attributes defined.");
393 secinfo("dbsession", "insert into %d", inAttributes
->DataRecordType
);
394 secinfo("dbsession", "Semantic information %d", inAttributes
->SemanticInformation
);
395 secinfo("dbsession", "Number of attributes: %d", inAttributes
->NumberOfAttributes
);
398 for (n
= 0; n
< inAttributes
->NumberOfAttributes
; ++n
)
400 DumpAttributeInfo(inAttributes
->AttributeData
[n
].Info
);
401 secinfo("dbsession", "Attribute %d\n", n
);
402 secinfo("dbsession", " number of values: %d", inAttributes
->AttributeData
[n
].NumberOfValues
);
404 for (i
= 0; i
< inAttributes
->AttributeData
[n
].NumberOfValues
; ++i
)
406 switch (inAttributes
->AttributeData
[n
].Info
.AttributeFormat
)
408 case CSSM_DB_ATTRIBUTE_FORMAT_STRING
:
410 std::string
ss((char*) inAttributes
->AttributeData
[n
].Value
[i
].Data
, inAttributes
->AttributeData
[n
].Value
[i
].Length
);
411 secinfo("dbsession", " Value %d: %s", i
, ss
.c_str());
414 case CSSM_DB_ATTRIBUTE_FORMAT_SINT32
:
415 secinfo("dbsession", " Value %d: %d", i
, *(sint32
*)inAttributes
->AttributeData
[n
].Value
[i
].Data
);
417 case CSSM_DB_ATTRIBUTE_FORMAT_UINT32
:
418 secinfo("dbsession", " Value %d: %u", i
, *(uint32
*)inAttributes
->AttributeData
[n
].Value
[i
].Data
);
420 case CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM
:
421 secinfo("dbsession", " Value %d: (bignum)", i
);
423 case CSSM_DB_ATTRIBUTE_FORMAT_REAL
:
424 secinfo("dbsession", " Value %d: %f", i
, *(double*)inAttributes
->AttributeData
[n
].Value
[i
].Data
);
426 case CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE
:
427 secinfo("dbsession", " Value %d: %s", i
, (char*)inAttributes
->AttributeData
[n
].Value
[i
].Data
);
429 case CSSM_DB_ATTRIBUTE_FORMAT_BLOB
:
430 secinfo("dbsession", " Value %d: (blob)", i
);
432 case CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32
:
435 unsigned long numInts
= inAttributes
->AttributeData
[n
].Value
[i
].Length
/ sizeof(UInt32
);
436 for (j
= 0; j
< numInts
; ++j
)
438 uint32
* nums
= (uint32
*) inAttributes
->AttributeData
[n
].Value
[i
].Data
;
439 secinfo("dbsession", " %d", nums
[j
]);
445 case CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX
:
446 secinfo("dbsession", " Value %d: (complex)", i
);
456 DumpUniqueRecord(const CSSM_DB_UNIQUE_RECORD
&record
)
461 switch (record.RecordLocator.IndexType)
463 case CSSM_DB_INDEX_UNIQUE:
465 s = "CSSM_DB_INDEX_UNIQUE";
469 case CSSM_DB_INDEX_NONUNIQUE:
471 s = "CSSM_DB_INDEX_NONUNIQUE";
476 secinfo("dbsession", "RecordLocator.IndexType: %s", s);
478 switch (record.RecordLocator.IndexedDataLocation)
480 case CSSM_DB_INDEX_ON_UNKNOWN:
482 s = "CSSM_DB_INDEX_ON_UNKNOWN";
486 case CSSM_DB_INDEX_ON_ATTRIBUTE:
488 s = "CSSM_DB_INDEX_ON_ATTRIBUTE";
492 case CSSM_DB_INDEX_ON_RECORD:
494 s = "CSSM_DB_INDEX_ON_RECORD";
499 secinfo("dbsession", "RecordLocator.IndexedDataLocation: %s", s);
501 secinfo("dbsession", "Attribute info:");
503 DumpAttributeInfo(record.RecordLocator.Info);
506 // put the record ID into hex
510 for (i
= 0; i
< record
.RecordIdentifier
.Length
; ++i
)
512 sprintf(hexBuffer
, "%02X", record
.RecordIdentifier
.Data
[i
]);
516 secinfo("dbsession", " RecordIdentifier.Data: %s", output
.c_str());
521 DatabaseSession::DataInsert(CSSM_DB_HANDLE inDbHandle
,
522 CSSM_DB_RECORDTYPE inRecordType
,
523 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*inAttributes
,
524 const CssmData
*inData
,
525 CSSM_DB_UNIQUE_RECORD_PTR
&outUniqueId
)
527 secinfo("dbsession", "%p DataInsert(%lx,%x)", this, inDbHandle
, inRecordType
);
528 DbContext
&aDbContext
= findDbContext(inDbHandle
);
529 outUniqueId
= aDbContext
.mDatabase
.dataInsert(aDbContext
, inRecordType
, inAttributes
, inData
);
532 secinfo("dbsession", "Returned unique id:");
533 DumpUniqueRecord(*outUniqueId
);
539 DatabaseSession::DataDelete(CSSM_DB_HANDLE inDbHandle
,
540 const CSSM_DB_UNIQUE_RECORD
&inUniqueRecordIdentifier
)
542 secinfo("dbsession", "%p DataDelete(%lx)", this, inDbHandle
);
543 DbContext
&aDbContext
= findDbContext(inDbHandle
);
544 aDbContext
.mDatabase
.dataDelete(aDbContext
, inUniqueRecordIdentifier
);
547 secinfo("dbsession", "Record identifier:");
548 DumpUniqueRecord(inUniqueRecordIdentifier
);
554 DatabaseSession::DataModify(CSSM_DB_HANDLE inDbHandle
,
555 CSSM_DB_RECORDTYPE inRecordType
,
556 CSSM_DB_UNIQUE_RECORD
&inoutUniqueRecordIdentifier
,
557 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*inAttributesToBeModified
,
558 const CssmData
*inDataToBeModified
,
559 CSSM_DB_MODIFY_MODE inModifyMode
)
561 secinfo("dbsession", "%p DataModify(%lx,%x)", this, inDbHandle
, inRecordType
);
562 DbContext
&aDbContext
= findDbContext(inDbHandle
);
563 aDbContext
.mDatabase
.dataModify(aDbContext
, inRecordType
, inoutUniqueRecordIdentifier
,
564 inAttributesToBeModified
, inDataToBeModified
, inModifyMode
);
566 secinfo("dbsession", "Out record identifier:");
567 DumpUniqueRecord(inoutUniqueRecordIdentifier
);
572 DatabaseSession::DataGetFirst(CSSM_DB_HANDLE inDbHandle
,
573 const CssmQuery
*inQuery
,
574 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR inoutAttributes
,
576 CSSM_DB_UNIQUE_RECORD_PTR
&outUniqueId
)
578 secinfo("dbsession", "%p DataGetFirst(%lx)", this, inDbHandle
);
579 DbContext
&aDbContext
= findDbContext(inDbHandle
);
581 CSSM_HANDLE result
= aDbContext
.mDatabase
.dataGetFirst(aDbContext
, inQuery
,
582 inoutAttributes
, inoutData
, outUniqueId
);
584 secinfo("dbsession", "result handle: %lx", result
);
587 secinfo("dbsession", "Returned ID:");
588 DumpUniqueRecord(*outUniqueId
);
596 DatabaseSession::DataGetNext(CSSM_DB_HANDLE inDbHandle
,
597 CSSM_HANDLE inResultsHandle
,
598 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR inoutAttributes
,
600 CSSM_DB_UNIQUE_RECORD_PTR
&outUniqueRecord
)
602 secinfo("dbsession", "DataGetNext(%lx)", inDbHandle
);
603 DbContext
&aDbContext
= findDbContext(inDbHandle
);
605 bool result
= aDbContext
.mDatabase
.dataGetNext(aDbContext
, inResultsHandle
, inoutAttributes
,
606 inoutData
, outUniqueRecord
);
611 secinfo("dbsession", "Returned ID:");
612 DumpUniqueRecord(*outUniqueRecord
);
620 DatabaseSession::DataAbortQuery(CSSM_DB_HANDLE inDbHandle
,
621 CSSM_HANDLE inResultsHandle
)
623 secinfo("dbsession", "%p DataAbortQuery(%lx)", this, inDbHandle
);
624 DbContext
&aDbContext
= findDbContext(inDbHandle
);
625 aDbContext
.mDatabase
.dataAbortQuery(aDbContext
, inResultsHandle
);
629 DatabaseSession::DataGetFromUniqueRecordId(CSSM_DB_HANDLE inDbHandle
,
630 const CSSM_DB_UNIQUE_RECORD
&inUniqueRecord
,
631 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR inoutAttributes
,
634 secinfo("dbsession", "%p DataGetFromUniqueId(%lx)", this, inDbHandle
);
636 secinfo("dbsession", "inUniqueRecord:");
637 DumpUniqueRecord(inUniqueRecord
);
640 DbContext
&aDbContext
= findDbContext(inDbHandle
);
641 aDbContext
.mDatabase
.dataGetFromUniqueRecordId(aDbContext
, inUniqueRecord
,
642 inoutAttributes
, inoutData
);
646 DatabaseSession::FreeUniqueRecord(CSSM_DB_HANDLE inDbHandle
,
647 CSSM_DB_UNIQUE_RECORD
&inUniqueRecordIdentifier
)
649 secinfo("dbsession", "FreeUniqueRecord: %lx", inDbHandle
);
651 secinfo("dbsession", "inUniqueRecordIdentifier follows:");
652 DumpUniqueRecord(inUniqueRecordIdentifier
);
654 DbContext
&aDbContext
= findDbContext(inDbHandle
);
655 aDbContext
.mDatabase
.freeUniqueRecord(aDbContext
, inUniqueRecordIdentifier
);
659 DatabaseSession::PassThrough(CSSM_DB_HANDLE inDbHandle
,
660 uint32 passThroughId
,
661 const void *inputParams
,
664 DbContext
&aDbContext
= findDbContext(inDbHandle
);
665 aDbContext
.mDatabase
.passThrough(aDbContext
, passThroughId
, inputParams
, outputParams
);