[Keychain-commit] SF.net SVN: keychain:[459] trunk/Frameworks/Keychain/Keychain
Status: Abandoned
Brought to you by:
wadetregaskis
|
From: <wad...@us...> - 2009-01-04 20:57:53
|
Revision: 459
http://keychain.svn.sourceforge.net/keychain/?rev=459&view=rev
Author: wadetregaskis
Date: 2009-01-04 20:57:50 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
* Removed -[Keychain version] and -[Keychain setVersion:], as they don't make sense. Part of bug #2473561.
* Updated methods using SecKeychainSettings to properly set the struct version before calling SecKeychainCopySettings. Part of bug #2473561.
Modified Paths:
--------------
trunk/Frameworks/Keychain/Keychain/Keychain.h
trunk/Frameworks/Keychain/Keychain/Keychain.m
Modified: trunk/Frameworks/Keychain/Keychain/Keychain.h
===================================================================
--- trunk/Frameworks/Keychain/Keychain/Keychain.h 2009-01-04 20:45:53 UTC (rev 458)
+++ trunk/Frameworks/Keychain/Keychain/Keychain.h 2009-01-04 20:57:50 UTC (rev 459)
@@ -216,20 +216,6 @@
- (BOOL)isWritable;
-/*! @method setVersion:
- @abstract Sets the version of the receiver.
- @discussion You should be careful about setting this value, as it may relate intricately to the keychain file format on disk. See the description for the version method for more details.
- @param version The major version number. */
-
-- (void)setVersion:(uint32_t)version;
-
-/*! @method version
- @abstract Returns the version of the receiver.
- @discussion The version relates primarily to the format of the keychain file on disk, rather than how the receiver acts. At the time of writing, all keychain versions work the same. But MacOS 10.1 used a different format for storing keychains to 10.2. Indeed, 10.3 or another future release may change the format again.
- @result The major version number. */
-
-- (uint32_t)version;
-
/*! @method setLockOnSleep:
@abstract Sets whether or not the receiver will lock itself automatically when the system goes to sleep.
@discussion Some users like to have their keychain lock automatically when their computer is put to sleep. If they leave their computer alone overnight, for example, they might not want just anyone to be able to come along while they're sleeping and use their keychain.
Modified: trunk/Frameworks/Keychain/Keychain/Keychain.m
===================================================================
--- trunk/Frameworks/Keychain/Keychain/Keychain.m 2009-01-04 20:45:53 UTC (rev 458)
+++ trunk/Frameworks/Keychain/Keychain/Keychain.m 2009-01-04 20:57:50 UTC (rev 459)
@@ -465,43 +465,10 @@
}
}
-- (void)setVersion:(uint32_t)version {
- SecKeychainSettings settings;
-
- _error = SecKeychainCopySettings(_keychain, &settings);
-
- if (noErr == _error) {
- settings.version = version;
-
- _error = SecKeychainSetSettings(_keychain, &settings);
-
- if (CSSM_OK != _error) {
- PSYSLOGND(LOG_ERR, @"Unable to set version for keychain %p, error %@.\n", self, OSStatusAsString(_error));
- PDEBUG(@"SecKeychainSetSettings(%p, %p) returned error %@.\n", _keychain, &settings, OSStatusAsString(_error));
- }
- } else {
- PSYSLOGND(LOG_ERR, @"Unable to set version for keychain %p, error %@.\n", self, OSStatusAsString(_error));
- PDEBUG(@"SecKeychainCopySettings(%p, %p) returned error %@.\n", _keychain, &settings, OSStatusAsString(_error));
- }
-}
-
-- (uint32_t)version {
- SecKeychainSettings settings;
-
- _error = SecKeychainCopySettings(_keychain, &settings);
-
- if (noErr == _error) {
- return settings.version;
- } else {
- PSYSLOGND(LOG_ERR, @"Unable to determine version of keychain %p, error %@.\n", self, OSStatusAsString(_error));
- PDEBUG(@"SecKeychainCopySettings(%p, %p) returned error %@.\n", _keychain, &settings, OSStatusAsString(_error));
-
- return -1;
- }
-}
-
- (void)setLockOnSleep:(BOOL)lockOnSleep {
- SecKeychainSettings settings;
+ SecKeychainSettings settings = {
+ .version = SEC_KEYCHAIN_SETTINGS_VERS1
+ };
_error = SecKeychainCopySettings(_keychain, &settings);
@@ -521,7 +488,9 @@
}
- (BOOL)willLockOnSleep {
- SecKeychainSettings settings;
+ SecKeychainSettings settings = {
+ .version = SEC_KEYCHAIN_SETTINGS_VERS1
+ };
_error = SecKeychainCopySettings(_keychain, &settings);
@@ -536,7 +505,9 @@
}
- (void)setLockAfterInterval:(BOOL)lockAfterInterval {
- SecKeychainSettings settings;
+ SecKeychainSettings settings = {
+ .version = SEC_KEYCHAIN_SETTINGS_VERS1
+ };
_error = SecKeychainCopySettings(_keychain, &settings);
@@ -556,7 +527,9 @@
}
- (BOOL)willLockAfterInterval {
- SecKeychainSettings settings;
+ SecKeychainSettings settings = {
+ .version = SEC_KEYCHAIN_SETTINGS_VERS1
+ };
_error = SecKeychainCopySettings(_keychain, &settings);
@@ -571,7 +544,9 @@
}
- (void)setInterval:(uint32_t)interval {
- SecKeychainSettings settings;
+ SecKeychainSettings settings = {
+ .version = SEC_KEYCHAIN_SETTINGS_VERS1
+ };
_error = SecKeychainCopySettings(_keychain, &settings);
@@ -591,7 +566,9 @@
}
- (uint32_t)interval {
- SecKeychainSettings settings;
+ SecKeychainSettings settings = {
+ SEC_KEYCHAIN_SETTINGS_VERS1
+ };
_error = SecKeychainCopySettings(_keychain, &settings);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|