#include <Security/Authorization.h>
#include <Security/AuthorizationTagsPriv.h>
+#include <os/activity.h>
+
#if 0
static CFTypeID
SecPasswordGetTypeID(void)
SecGenericPasswordCreate(SecKeychainAttributeList *searchAttrList, SecKeychainAttributeList *itemAttrList, SecPasswordRef *itemRef)
{
BEGIN_SECAPI
+ os_activity_t activity = os_activity_create("SecGenericPasswordCreate", OS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_IF_NONE_PRESENT);
+ os_activity_scope(activity);
+ os_release(activity);
KCThrowParamErrIf_( (itemRef == NULL) );
KCThrowParamErrIf_( (searchAttrList == NULL) ^ (itemAttrList == NULL) ); // Both or neither
SecPasswordSetInitialAccess(SecPasswordRef itemRef, SecAccessRef accessRef)
{
BEGIN_SECAPI
+ os_activity_t activity = os_activity_create("SecPasswordSetInitialAccess", OS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_IF_NONE_PRESENT);
+ os_activity_scope(activity);
+ os_release(activity);
PasswordImpl::required(itemRef)->setAccess(Access::required(accessRef));
END_SECAPI
}
SecPasswordAction(SecPasswordRef itemRef, CFTypeRef message, UInt32 flags, UInt32 *length, const void **data)
{
BEGIN_SECAPI
+ os_activity_t activity = os_activity_create("SecPasswordAction", OS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_IF_NONE_PRESENT);
+ os_activity_scope(activity);
+ os_release(activity);
Password passwordRef = PasswordImpl::required(itemRef);
AuthorizationItemSet envSet = { sizeof(envRights) / sizeof(*envRights), envRights };
- secdebug("SecPassword", "dialog(%s)%s%s%s.", right.name, tries?" retry":"", keychain?" show-add-keychain":"", addToKeychain?" save-to-keychain":"");
+ secinfo("SecPassword", "dialog(%s)%s%s%s.", right.name, tries?" retry":"", keychain?" show-add-keychain":"", addToKeychain?" save-to-keychain":"");
status = AuthorizationCopyRights(authRef, &rightSet, &envSet, kAuthorizationFlagDefaults|kAuthorizationFlagInteractionAllowed|kAuthorizationFlagExtendRights, NULL);
if (data)
*data = passwordData;
- secdebug("SecPassword", "Got password (%u,%p).", (unsigned int)passwordLength, passwordData);
+ secinfo("SecPassword", "Got password (%u,%p).", (unsigned int)passwordLength, passwordData);
}
else if (!strcmp(AGENT_ADD_TO_KEYCHAIN, item.name))
{
bool remember = (item.value && item.valueLength == strlen("YES") && !memcmp("YES", static_cast<char *>(item.value), item.valueLength));
passwordRef->setRememberInKeychain(remember);
if (remember)
- secdebug("SecPassword", "User wants to add the password to the Keychain.");
+ secinfo("SecPassword", "User wants to add the password to the Keychain.");
}
}
}
-
- AuthorizationFreeItemSet(returnedInfo);
+
+ if(returnedInfo) {
+ AuthorizationFreeItemSet(returnedInfo);
+ }
AuthorizationFree(authRef, 0);
}