[vlc-commits] keychain: refactor
Thomas Guillem
git at videolan.org
Thu Nov 14 15:24:03 CET 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Oct 31 10:35:58 2019 +0100| [e61115077f7cd8d9ed5da704944bcbfcbe284feb] | committer: Thomas Guillem
keychain: refactor
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e61115077f7cd8d9ed5da704944bcbfcbe284feb
---
modules/keystore/keychain.m | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/modules/keystore/keychain.m b/modules/keystore/keychain.m
index 9119e8543f..d8852e061a 100644
--- a/modules/keystore/keychain.m
+++ b/modules/keystore/keychain.m
@@ -178,31 +178,35 @@ static void SetAccessibilityForQuery(vlc_keystore *p_keystore,
NSMutableDictionary *query)
{
int accessibilityType = var_InheritInteger(p_keystore, "keychain-accessibility-type");
+ CFStringRef secattr;
switch (accessibilityType) {
case 1:
- [query setObject:(__bridge id)kSecAttrAccessibleAfterFirstUnlock forKey:(__bridge id)kSecAttrAccessible];
+ secattr = kSecAttrAccessibleAfterFirstUnlock;
break;
case 2:
- [query setObject:(__bridge id)kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly forKey:(__bridge id)kSecAttrAccessible];
+ secattr = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly;
break;
case 3:
- [query setObject:(__bridge id)kSecAttrAccessibleAlways forKey:(__bridge id)kSecAttrAccessible];
+ secattr = kSecAttrAccessibleAlways;
break;
case 4:
- [query setObject:(__bridge id)kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly forKey:(__bridge id)kSecAttrAccessible];
+ secattr = kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly;
break;
case 5:
- [query setObject:(__bridge id)kSecAttrAccessibleAlwaysThisDeviceOnly forKey:(__bridge id)kSecAttrAccessible];
+ secattr = kSecAttrAccessibleAlwaysThisDeviceOnly;
break;
case 6:
- [query setObject:(__bridge id)kSecAttrAccessibleWhenUnlocked forKey:(__bridge id)kSecAttrAccessible];
+ secattr = kSecAttrAccessibleWhenUnlocked;
break;
case 7:
- [query setObject:(__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly forKey:(__bridge id)kSecAttrAccessible];
+ secattr = kSecAttrAccessibleWhenUnlockedThisDeviceOnly;
break;
default:
+ secattr = nil;
break;
}
+ if (secattr != nil)
+ [query setObject:(__bridge id)secattr forKey:(__bridge id)kSecAttrAccessible];
}
struct vlc2secattr
More information about the vlc-commits
mailing list