Skip to content

Commit ea683f2

Browse files
authored
Merge pull request #201 from simlay/add-visionos-support
2 parents f27b7f3 + ce824b5 commit ea683f2

File tree

14 files changed

+112
-112
lines changed

14 files changed

+112
-112
lines changed

security-framework-sys/src/certificate.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core_foundation_sys::base::{CFAllocatorRef, CFTypeID, OSStatus};
33
use core_foundation_sys::data::CFDataRef;
44
#[cfg(target_os = "macos")]
55
use core_foundation_sys::dictionary::CFDictionaryRef;
6-
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
6+
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
77
use core_foundation_sys::error::CFErrorRef;
88
use core_foundation_sys::string::CFStringRef;
99

@@ -55,9 +55,9 @@ extern "C" {
5555
certificate: SecCertificateRef,
5656
email_addresses: *mut CFArrayRef,
5757
) -> OSStatus;
58-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
58+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
5959
pub fn SecCertificateCopyNormalizedIssuerSequence(certificate: SecCertificateRef) -> CFDataRef;
60-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
60+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
6161
pub fn SecCertificateCopyNormalizedSubjectSequence(certificate: SecCertificateRef)
6262
-> CFDataRef;
6363
#[cfg(target_os = "macos")]
@@ -67,9 +67,9 @@ extern "C" {
6767
certificate: SecCertificateRef,
6868
key: *mut SecKeyRef,
6969
) -> OSStatus;
70-
#[cfg(any(feature = "OSX_10_14", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
70+
#[cfg(any(feature = "OSX_10_14", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
7171
pub fn SecCertificateCopyKey(certificate: SecCertificateRef) -> SecKeyRef;
72-
#[cfg(any(feature = "OSX_10_13", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
72+
#[cfg(any(feature = "OSX_10_13", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
7373
pub fn SecCertificateCopySerialNumberData(
7474
certificate: SecCertificateRef,
7575
error: *mut CFErrorRef,

security-framework-sys/src/item.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ extern "C" {
3737
pub static kSecAttrKeyClassSymmetric: CFStringRef;
3838

3939
pub static kSecUseKeychain: CFStringRef;
40-
#[cfg(any(feature = "OSX_10_15", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
40+
#[cfg(any(feature = "OSX_10_15", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
4141
pub static kSecUseDataProtectionKeychain: CFStringRef;
42-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
42+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
4343
pub static kSecAttrTokenID: CFStringRef;
44-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
44+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
4545
pub static kSecAttrTokenIDSecureEnclave: CFStringRef;
4646

4747
pub static kSecAttrKeySizeInBits: CFStringRef;
@@ -62,7 +62,7 @@ extern "C" {
6262
pub static kSecAttrKeyTypeRC2: CFStringRef;
6363
#[cfg(target_os = "macos")]
6464
pub static kSecAttrKeyTypeCAST: CFStringRef;
65-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
65+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
6666
pub static kSecAttrKeyTypeEC: CFStringRef;
6767

6868
pub static kSecAttrAccessGroup: CFStringRef;

security-framework-sys/src/key.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ use core_foundation_sys::base::CFTypeID;
22
use core_foundation_sys::data::CFDataRef;
33
use core_foundation_sys::dictionary::CFDictionaryRef;
44
use core_foundation_sys::error::CFErrorRef;
5-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
5+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
66
use core_foundation_sys::string::CFStringRef;
77

88
use crate::base::SecKeyRef;
99

10-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
10+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
1111
pub type SecKeyAlgorithm = CFStringRef;
1212

13-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
13+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
1414
pub type SecKeyOperationType = u32;
15-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
15+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
1616
pub const kSecKeyOperationTypeSign: SecKeyOperationType = 0;
17-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
17+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
1818
pub const kSecKeyOperationTypeVerify: SecKeyOperationType = 1;
19-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
19+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
2020
pub const kSecKeyOperationTypeEncrypt: SecKeyOperationType = 2;
21-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
21+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
2222
pub const kSecKeyOperationTypeDecrypt: SecKeyOperationType = 3;
23-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
23+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
2424
pub const kSecKeyOperationTypeKeyExchange: SecKeyOperationType = 4;
2525

2626
extern "C" {
2727
pub fn SecKeyGetTypeID() -> CFTypeID;
2828

29-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
29+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
3030
pub fn SecKeyCreateRandomKey(parameters: CFDictionaryRef, error: *mut CFErrorRef) -> SecKeyRef;
3131

3232
#[cfg(target_os = "macos")]
@@ -36,22 +36,22 @@ extern "C" {
3636
error: *mut CFErrorRef,
3737
) -> SecKeyRef;
3838

39-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
39+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
4040
pub fn SecKeyCopyExternalRepresentation(key: SecKeyRef, error: *mut CFErrorRef) -> CFDataRef;
41-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
41+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
4242
pub fn SecKeyCopyAttributes(key: SecKeyRef) -> CFDictionaryRef;
43-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
43+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
4444
pub fn SecKeyCopyPublicKey(key: SecKeyRef) -> SecKeyRef;
4545

46-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
46+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
4747
pub fn SecKeyCreateSignature(
4848
key: SecKeyRef,
4949
algorithm: SecKeyAlgorithm,
5050
dataToSign: CFDataRef,
5151
error: *mut CFErrorRef,
5252
) -> CFDataRef;
5353

54-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
54+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
5555
pub fn SecKeyVerifySignature(
5656
key: SecKeyRef,
5757
algorithm: SecKeyAlgorithm,
@@ -60,15 +60,15 @@ extern "C" {
6060
error: *mut CFErrorRef,
6161
) -> core_foundation_sys::base::Boolean;
6262

63-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
63+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
6464
pub fn SecKeyIsAlgorithmSupported(
6565
key: SecKeyRef,
6666
operation: SecKeyOperationType,
6767
algorithm: SecKeyAlgorithm,
6868
) -> core_foundation_sys::base::Boolean;
6969
}
7070

71-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
71+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
7272
macro_rules! names {
7373
($($i:ident => $x:ident),*) => {
7474
extern "C" {
@@ -91,7 +91,7 @@ macro_rules! names {
9191
}
9292
}
9393

94-
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
94+
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
9595
names! {
9696
ECIESEncryptionStandardX963SHA1AESGCM => kSecKeyAlgorithmECIESEncryptionStandardX963SHA1AESGCM,
9797
ECIESEncryptionStandardX963SHA224AESGCM => kSecKeyAlgorithmECIESEncryptionStandardX963SHA224AESGCM,

security-framework-sys/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(bad_style)]
22

33
#[cfg_attr(
4-
any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"),
4+
any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"),
55
link(name = "Security", kind = "framework")
66
)]
77
extern "C" {}
@@ -12,7 +12,7 @@ pub mod access_control;
1212
#[cfg(target_os = "macos")]
1313
pub mod authorization;
1414
pub mod base;
15-
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
15+
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
1616
pub mod certificate;
1717
#[cfg(target_os = "macos")]
1818
pub mod certificate_oids;

security-framework-sys/src/policy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
1+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
22
use core_foundation_sys::base::CFOptionFlags;
33
use core_foundation_sys::base::{Boolean, CFTypeID};
44
use core_foundation_sys::string::CFStringRef;
55

66
use crate::base::SecPolicyRef;
77

8-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
8+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
99
mod revocation_flags {
1010
use super::CFOptionFlags;
1111

@@ -17,12 +17,12 @@ mod revocation_flags {
1717
pub const kSecRevocationUseAnyAvailableMethod: CFOptionFlags = kSecRevocationOCSPMethod | kSecRevocationCRLMethod;
1818
}
1919

20-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
20+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
2121
pub use revocation_flags::*;
2222

2323
extern "C" {
2424
pub fn SecPolicyCreateSSL(server: Boolean, hostname: CFStringRef) -> SecPolicyRef;
25-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
25+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
2626
pub fn SecPolicyCreateRevocation(revocationFlags: CFOptionFlags) -> SecPolicyRef;
2727
pub fn SecPolicyGetTypeID() -> CFTypeID;
2828
pub fn SecPolicyCreateBasicX509() -> SecPolicyRef;

security-framework-sys/src/secure_transport.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ pub type SSLSessionOption = c_int;
3030
pub const kSSLSessionOptionBreakOnServerAuth: SSLSessionOption = 0;
3131
pub const kSSLSessionOptionBreakOnCertRequested: SSLSessionOption = 1;
3232
pub const kSSLSessionOptionBreakOnClientAuth: SSLSessionOption = 2;
33-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
33+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
3434
pub const kSSLSessionOptionFalseStart: SSLSessionOption = 3;
35-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
35+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
3636
pub const kSSLSessionOptionSendOneByteRecord: SSLSessionOption = 4;
37-
#[cfg(all(feature = "OSX_10_11", not(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))))]
37+
#[cfg(all(feature = "OSX_10_11", not(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))))]
3838
pub const kSSLSessionOptionAllowServerIdentityChange: SSLSessionOption = 5;
39-
#[cfg(all(feature = "OSX_10_10", not(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))))]
39+
#[cfg(all(feature = "OSX_10_10", not(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))))]
4040
pub const kSSLSessionOptionFallback: SSLSessionOption = 6;
41-
#[cfg(all(feature = "OSX_10_11", not(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))))]
41+
#[cfg(all(feature = "OSX_10_11", not(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))))]
4242
pub const kSSLSessionOptionBreakOnClientHello: SSLSessionOption = 7;
4343

4444
pub type SSLSessionState = c_int;

security-framework-sys/src/trust.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::base::SecKeyRef;
33
use core_foundation_sys::array::CFArrayRef;
44
use core_foundation_sys::base::{Boolean, CFIndex, CFTypeID, CFTypeRef, OSStatus};
55
use core_foundation_sys::date::CFDateRef;
6-
#[cfg(any(feature = "OSX_10_13", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
6+
#[cfg(any(feature = "OSX_10_13", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
77
use core_foundation_sys::error::CFErrorRef;
88

99
pub type SecTrustResultType = u32;
@@ -55,7 +55,7 @@ extern "C" {
5555
#[deprecated(note = "deprecated by Apple")]
5656
pub fn SecTrustEvaluate(trust: SecTrustRef, result: *mut SecTrustResultType) -> OSStatus;
5757
// it should have been OSX_10_14, but due to back-compat it can't rely on the newer feature flag
58-
#[cfg(any(feature = "OSX_10_13", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
58+
#[cfg(any(feature = "OSX_10_13", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
5959
pub fn SecTrustEvaluateWithError(trust: SecTrustRef, error: *mut CFErrorRef) -> bool;
6060
pub fn SecTrustCreateWithCertificates(
6161
certificates: CFTypeRef,
@@ -65,13 +65,13 @@ extern "C" {
6565
pub fn SecTrustSetPolicies(trust: SecTrustRef, policies: CFTypeRef) -> OSStatus;
6666
#[cfg(target_os = "macos")]
6767
pub fn SecTrustSetOptions(trust: SecTrustRef, options: SecTrustOptionFlags) -> OSStatus;
68-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
68+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
6969
pub fn SecTrustGetNetworkFetchAllowed(trust: SecTrustRef, allowFetch: *mut Boolean) -> OSStatus;
70-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
70+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
7171
pub fn SecTrustSetNetworkFetchAllowed(trust: SecTrustRef, allowFetch: Boolean) -> OSStatus;
72-
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
72+
#[cfg(any(feature = "OSX_10_9", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
7373
pub fn SecTrustSetOCSPResponse(trust: SecTrustRef, responseData: CFTypeRef) -> OSStatus;
74-
#[cfg(any(feature = "OSX_10_14", target_os = "ios", target_os = "tvos", target_os = "watchos"))]
74+
#[cfg(any(feature = "OSX_10_14", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
7575
pub fn SecTrustSetSignedCertificateTimestamps(
7676
trust: SecTrustRef,
7777
sctArray: CFArrayRef,

0 commit comments

Comments
 (0)