Skip to content

Commit

Permalink
Set item description to 'envchain'
Browse files Browse the repository at this point in the history
  • Loading branch information
sorah committed Nov 14, 2014
1 parent cc7a02c commit d7e5731
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions envchain.c
Expand Up @@ -39,6 +39,7 @@
#include <Security/Security.h>

#define ENVCHAIN_SERVICE_PREFIX "envchain-"
#define ENVCHAIN_ITEM_DESCRIPTION "envchain"

static const char version[] = "0.2.0";
const char *envchain_name;
Expand Down Expand Up @@ -336,6 +337,18 @@ envchain_save_value(const char *name, const char *key, char *value, int require_

if (status != noErr) goto fail;

/* Set description */
SecKeychainAttribute attr_desc = {
kSecDescriptionItemAttr, strlen(ENVCHAIN_ITEM_DESCRIPTION), ENVCHAIN_ITEM_DESCRIPTION};
SecKeychainAttributeList attrs = {1, &attr_desc};
status = SecKeychainItemModifyAttributesAndData(
ref,
&attrs,
strlen(value), value
);

if (status != noErr) goto fail;

if (require_passphrase >= 0) {
CFArrayRef app_list = NULL;
CFStringRef desc = NULL;
Expand Down

0 comments on commit d7e5731

Please sign in to comment.