[Keychain-commit] SF.net SVN: keychain: [443] trunk/Frameworks/Keychain/Keychain/KeychainItem .m
Status: Abandoned
Brought to you by:
wadetregaskis
|
From: <wad...@us...> - 2007-12-09 23:49:46
|
Revision: 443
http://keychain.svn.sourceforge.net/keychain/?rev=443&view=rev
Author: wadetregaskis
Date: 2007-12-09 15:49:52 -0800 (Sun, 09 Dec 2007)
Log Message:
-----------
* Added TODO to -[KeychainItem createDuplicate] noting that it appears to be completely bogus as-is.
* Changed -[KeychainItem certificate] to not try casting the SecKeychainItemRef to a SecCertificateRef unless the receiver is actually a certificate.
Modified Paths:
--------------
trunk/Frameworks/Keychain/Keychain/KeychainItem.m
Modified: trunk/Frameworks/Keychain/Keychain/KeychainItem.m
===================================================================
--- trunk/Frameworks/Keychain/Keychain/KeychainItem.m 2007-12-09 22:11:06 UTC (rev 442)
+++ trunk/Frameworks/Keychain/Keychain/KeychainItem.m 2007-12-09 23:49:52 UTC (rev 443)
@@ -1092,6 +1092,7 @@
SecKeychainRef keychain = (SecKeychainRef)[[self keychain] keychainRef];
SecAccessRef access = [[self access] accessRef];
+ // TODO: verify this will ever actually work; we surely can't just create a complete duplicate of an item within the same keychain... I'm pretty sure SecKeychainItemCreateCopy is intended for copying items *between* keychains.
_error = SecKeychainItemCreateCopy(_keychainItem, keychain, access, &result);
if (noErr != _error) {
@@ -1108,7 +1109,11 @@
}
- (Certificate*)certificate {
- return [Certificate certificateWithCertificateRef:(SecCertificateRef)_keychainItem];
+ if ([self isCertificate]) {
+ return [Certificate certificateWithCertificateRef:(SecCertificateRef)_keychainItem];
+ } else {
+ return nil;
+ }
}
- (NSString*)description {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|