Skip to content

Commit

Permalink
Sets kSecAttrDescription
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Apr 30, 2024
1 parent f36269b commit df6ee73
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/key/store/default.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ int default_store_store_key(const UInt8 *id, const UInt8 *key, const char *tag)
CFDataRef bin;
CFStringRef str;
SecAccessControlRef access;
CFDateRef date;
OSStatus status;

// Setup attributes,
Expand All @@ -24,6 +23,10 @@ int default_store_store_key(const UInt8 *id, const UInt8 *key, const char *tag)
CFDictionarySetValue(attrs, kSecAttrLabel, str);
CFRelease(str);

str = CFStringCreateWithCStringNoCopy(NULL, "Key to encrypt files before sending to Warp server", kCFStringEncodingUTF8, kCFAllocatorNull);
CFDictionarySetValue(attrs, kSecAttrDescription, str);
CFRelease(str);

bin = CFDataCreateWithBytesNoCopy(NULL, id, 16, kCFAllocatorNull);
CFDictionarySetValue(attrs, kSecAttrApplicationLabel, bin);
CFRelease(bin);
Expand All @@ -41,10 +44,6 @@ int default_store_store_key(const UInt8 *id, const UInt8 *key, const char *tag)
CFDictionarySetValue(attrs, kSecAttrAccessControl, access);
CFRelease(access);

date = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());
CFDictionarySetValue(attrs, kSecAttrCreationDate, date);
CFRelease(date);

// Store key.
status = SecItemAdd(attrs, nil);
CFRelease(attrs);
Expand Down

0 comments on commit df6ee73

Please sign in to comment.