Commit 1976cd6 1 parent 816c796 commit 1976cd6 Copy full SHA for 1976cd6
File tree 3 files changed +12
-0
lines changed
security-framework-sys/src
3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,12 @@ mod access_control_flags {
8
8
use super :: CFOptionFlags ;
9
9
10
10
pub const kSecAccessControlUserPresence: CFOptionFlags = 1 << 0 ;
11
+ #[ cfg( feature = "OSX_10_13" ) ]
11
12
pub const kSecAccessControlBiometryAny: CFOptionFlags = 1 << 1 ;
13
+ #[ cfg( feature = "OSX_10_13" ) ]
12
14
pub const kSecAccessControlBiometryCurrentSet: CFOptionFlags = 1 << 3 ;
13
15
pub const kSecAccessControlDevicePasscode: CFOptionFlags = 1 << 4 ;
16
+ #[ cfg( feature = "OSX_10_15" ) ]
14
17
pub const kSecAccessControlWatch: CFOptionFlags = 1 << 5 ;
15
18
pub const kSecAccessControlOr: CFOptionFlags = 1 << 14 ;
16
19
pub const kSecAccessControlAnd: CFOptionFlags = 1 << 15 ;
Original file line number Diff line number Diff line change @@ -149,6 +149,9 @@ impl SecCertificate {
149
149
#[ cfg( any( feature = "OSX_10_12" , target_os = "ios" ) ) ]
150
150
#[ must_use]
151
151
fn pk_to_der ( & self , public_key : key:: SecKey ) -> Option < Vec < u8 > > {
152
+ use security_framework_sys:: item:: kSecAttrKeyType;
153
+ use security_framework_sys:: item:: kSecAttrKeySizeInBits;
154
+
152
155
let public_key_attributes = public_key. attributes ( ) ;
153
156
let public_key_type = public_key_attributes
154
157
. find ( unsafe { kSecAttrKeyType } . cast :: < std:: os:: raw:: c_void > ( ) ) ?;
@@ -200,6 +203,9 @@ impl SecCertificate {
200
203
201
204
#[ cfg( any( feature = "OSX_10_12" , target_os = "ios" ) ) ]
202
205
fn get_asn1_header_bytes ( pkt : CFString , ksz : u32 ) -> Option < & ' static [ u8 ] > {
206
+ use security_framework_sys:: item:: kSecAttrKeyTypeRSA;
207
+ use security_framework_sys:: item:: kSecAttrKeyTypeECSECPrimeRandom;
208
+
203
209
if pkt == unsafe { CFString :: wrap_under_get_rule ( kSecAttrKeyTypeRSA) } && ksz == 2048 {
204
210
return Some ( & RSA_2048_ASN1_HEADER ) ;
205
211
}
Original file line number Diff line number Diff line change @@ -20,12 +20,15 @@ bitflags::bitflags! {
20
20
pub struct AccessControlOptions : CFOptionFlags {
21
21
/** Constraint to access an item with either biometry or passcode. */
22
22
const USER_PRESENCE = kSecAccessControlUserPresence;
23
+ #[ cfg( feature = "OSX_10_13" ) ]
23
24
/** Constraint to access an item with Touch ID for any enrolled fingers, or Face ID. */
24
25
const BIOMETRY_ANY = kSecAccessControlBiometryAny;
26
+ #[ cfg( feature = "OSX_10_13" ) ]
25
27
/** Constraint to access an item with Touch ID for currently enrolled fingers, or from Face ID with the currently enrolled user. */
26
28
const BIOMETRY_CURRENT_SET = kSecAccessControlBiometryCurrentSet;
27
29
/** Constraint to access an item with a passcode. */
28
30
const DEVICE_PASSCODE = kSecAccessControlDevicePasscode;
31
+ #[ cfg( feature = "OSX_10_15" ) ]
29
32
/** Constraint to access an item with a watch. */
30
33
const WATCH = kSecAccessControlWatch;
31
34
/** Indicates that at least one constraint must be satisfied. */
You can’t perform that action at this time.
0 commit comments