/*
- * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 2000-2007 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
#include "key.h"
#include "server.h"
#include "session.h"
+#include "notifications.h"
#include <security_agent_client/agentclient.h>
+#include <securityd_client/dictionary.h>
#include <security_cdsa_utilities/acl_any.h> // for default owner ACLs
#include <security_cdsa_client/wrapkey.h>
#include <security_utilities/endian.h>
{
return referent<Process>();
}
+
+
+//
+// Send a keychain-related notification event about this database
+//
+void DbCommon::notify(NotificationEvent event, const DLDbIdentifier &ident)
+{
+ // form the data (encoded DLDbIdentifier)
+ NameValueDictionary nvd;
+ NameValueDictionary::MakeNameValueDictionaryFromDLDbIdentifier(ident, nvd);
+ CssmData data;
+ nvd.Export(data);
+
+ // inject notification into Security event system
+ Listener::notify(kNotificationDomainDatabase, event, data);
+
+ // clean up
+ free (data.data());
+}
//
// nothing
}
+bool DbCommon::belongsToSystem() const
+{
+ return false;
+}
+
void Database::releaseKey(Key &key)
{
CssmError::throwMe(CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED);
}
-bool Database::isLocked() const
+bool Database::isLocked()
{
secdebug("database", "%p calling unimplemented isLocked", this);
CssmError::throwMe(CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED);
return dbAcl;
}
-GenericHandle Database::aclHandle() const
-{
- return HandleObject::handle();
-}
-
//
// Remote validation is not, by default, supported