File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use security_framework_sys::access_control::{
12
12
} ;
13
13
use security_framework_sys:: base:: { errSecParam, SecAccessControlRef } ;
14
14
use std:: fmt;
15
- use std:: ptr:: { self , null } ;
15
+ use std:: ptr;
16
16
17
17
declare_TCFType ! {
18
18
/// A type representing sec access control settings.
@@ -62,11 +62,13 @@ impl SecAccessControl {
62
62
ProtectionMode :: AccessibleAfterFirstUnlockThisDeviceOnly => unsafe { CFString :: wrap_under_get_rule ( kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly) } ,
63
63
ProtectionMode :: AccessibleAfterFirstUnlock => unsafe { CFString :: wrap_under_get_rule ( kSecAttrAccessibleAfterFirstUnlock) } ,
64
64
}
65
+ } ) . unwrap_or_else ( || {
66
+ unsafe { CFString :: wrap_under_get_rule ( kSecAttrAccessibleWhenUnlocked) }
65
67
} ) ;
66
68
unsafe {
67
69
let access_control = SecAccessControlCreateWithFlags (
68
70
kCFAllocatorDefault,
69
- protection_val. map ( |v| v . as_CFTypeRef ( ) ) . unwrap_or ( null ( ) ) ,
71
+ protection_val. as_CFTypeRef ( ) ,
70
72
flags,
71
73
ptr:: null_mut ( ) ,
72
74
) ;
You can’t perform that action at this time.
0 commit comments