[Keychain-commit] SF.net SVN: keychain:[460] trunk/Frameworks/Keychain/Keychain
Status: Abandoned
Brought to you by:
wadetregaskis
|
From: <wad...@us...> - 2009-01-04 21:13:27
|
Revision: 460
http://keychain.svn.sourceforge.net/keychain/?rev=460&view=rev
Author: wadetregaskis
Date: 2009-01-04 21:13:23 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
* Removed -[Keychain setLockAfterInterval:] and -[Keychain willLockAfterInterval] - these rely on functionality in the Security framework which isn't actually implemented (as of 10.5.6, at least). Renamed -[Keychain setInterval:] to -[Keychain setLockInterval:] and -[Keychain interval] to -[Keychain lockInterval]. 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:57:50 UTC (rev 459)
+++ trunk/Frameworks/Keychain/Keychain/Keychain.h 2009-01-04 21:13:23 UTC (rev 460)
@@ -229,34 +229,19 @@
- (BOOL)willLockOnSleep;
-/*! @method setLockAfterInterval:
- @abstract Sets whether or not the receiver will automatically lock itself after a certain period of inactivity.
- @discussion Some users like to have their keychain lock automatically after a certain period of it being unused, for extra security, as locked keychains cannot be used at all - neither read nor added to.
-
- Note that you should set this only after setting the interval using setInterval:. If you set this first, and interval is 0, you will induce a race condition, the outcome of which may be that the receiver becomes locked.
- @param lockAfterInterval YES if the receiver should lock itself automatically after a certain period of inactivity, NO otherwise. */
-
-- (void)setLockAfterInterval:(BOOL)lockAfterInterval;
-
-/*! @method willLockAfterInterval
- @abstract Returns whether or not the receiver will automatically lock itself after a certain period of inactivity.
- @result Returns YES if the receiver is set to lock after some interval (which can be determined using the interval method), NO otherwise and in case of error. */
-
-- (BOOL)willLockAfterInterval;
-
-/*! @method setInterval:
+/*! @method setLockInterval:
@abstract Sets the time in seconds after which a keychain automatically locks itself.
@discussion This is an idle timeout - if the receiver is unused for the specified interval of time, it locks itself. Note that since keychains are system-wide, other applications may use the receiver without your knowledge. Also not that this interval does not need to be 'reset' every time you use the receiver - the receiver keeps track of time and usage itself.
@param interval The number of seconds of idle time after which the receiver should lock itself. This may be 0, in which case the receiver will lock itself immediately after any operation. Since this setting is system-wide, you should be wary about setting this value to 0, or any other brief interval. */
-- (void)setInterval:(uint32_t)interval;
+- (void)setLockInterval:(uint32_t)interval;
-/*! @method interval
+/*! @method lockInterval
@abstract Returns the time in seconds after which a keychain automatically locks.
@discussion This is an idle timeout - if the receiver is unused for this interval of time, it locks itself. Note that since keychains are system-wide, other applications may use the receiver without your knowledge.
@result The time interval in seconds. This may be a non-zero number even if the receiver is not set to use it. */
-- (uint32_t)interval;
+- (uint32_t)lockInterval;
/*! @method lock
@abstract Locks the receiver.
Modified: trunk/Frameworks/Keychain/Keychain/Keychain.m
===================================================================
--- trunk/Frameworks/Keychain/Keychain/Keychain.m 2009-01-04 20:57:50 UTC (rev 459)
+++ trunk/Frameworks/Keychain/Keychain/Keychain.m 2009-01-04 21:13:23 UTC (rev 460)
@@ -504,7 +504,7 @@
}
}
-- (void)setLockAfterInterval:(BOOL)lockAfterInterval {
+- (void)setLockInterval:(uint32_t)interval {
SecKeychainSettings settings = {
.version = SEC_KEYCHAIN_SETTINGS_VERS1
};
@@ -512,45 +512,6 @@
_error = SecKeychainCopySettings(_keychain, &settings);
if (noErr == _error) {
- settings.useLockInterval = lockAfterInterval;
-
- _error = SecKeychainSetSettings(_keychain, &settings);
-
- if (CSSM_OK != _error) {
- PSYSLOGND(LOG_ERR, @"Unable to set lock-after-interval 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 lock-after-interval for keychain %p, error %@.\n", self, OSStatusAsString(_error));
- PDEBUG(@"SecKeychainCopySettings(%p, %p) returned error %@.\n", _keychain, &settings, OSStatusAsString(_error));
- }
-}
-
-- (BOOL)willLockAfterInterval {
- SecKeychainSettings settings = {
- .version = SEC_KEYCHAIN_SETTINGS_VERS1
- };
-
- _error = SecKeychainCopySettings(_keychain, &settings);
-
- if (noErr == _error) {
- return settings.useLockInterval;
- } else {
- PSYSLOGND(LOG_ERR, @"Unable to determine lock-after-interval setting of keychain %p, error %@.\n", self, OSStatusAsString(_error));
- PDEBUG(@"SecKeychainCopySettings(%p, %p) returned error %@.\n", _keychain, &settings, OSStatusAsString(_error));
-
- return NO;
- }
-}
-
-- (void)setInterval:(uint32_t)interval {
- SecKeychainSettings settings = {
- .version = SEC_KEYCHAIN_SETTINGS_VERS1
- };
-
- _error = SecKeychainCopySettings(_keychain, &settings);
-
- if (noErr == _error) {
settings.lockInterval = interval;
_error = SecKeychainSetSettings(_keychain, &settings);
@@ -565,7 +526,7 @@
}
}
-- (uint32_t)interval {
+- (uint32_t)lockInterval {
SecKeychainSettings settings = {
SEC_KEYCHAIN_SETTINGS_VERS1
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|