|
@@ -488,7 +488,7 @@ public class Keychain {
|
|
#if os(iOS)
|
|
#if os(iOS)
|
|
if #available(iOS 9.0, *) {
|
|
if #available(iOS 9.0, *) {
|
|
query[UseAuthenticationUI] = UseAuthenticationUIFail
|
|
query[UseAuthenticationUI] = UseAuthenticationUIFail
|
|
- } else if #available(iOS 8.0, *) {
|
|
|
|
|
|
+ } else {
|
|
query[UseNoAuthenticationUI] = true
|
|
query[UseNoAuthenticationUI] = true
|
|
}
|
|
}
|
|
#elseif os(OSX)
|
|
#elseif os(OSX)
|
|
@@ -1010,7 +1010,7 @@ extension Options {
|
|
query[AttributeAuthenticationType] = authenticationType.rawValue
|
|
query[AttributeAuthenticationType] = authenticationType.rawValue
|
|
}
|
|
}
|
|
|
|
|
|
- if #available(iOS 8.0, OSX 10.10, *) {
|
|
|
|
|
|
+ if #available(OSX 10.10, *) {
|
|
if authenticationPrompt != nil {
|
|
if authenticationPrompt != nil {
|
|
query[UseOperationPrompt] = authenticationPrompt
|
|
query[UseOperationPrompt] = authenticationPrompt
|
|
}
|
|
}
|
|
@@ -1039,7 +1039,7 @@ extension Options {
|
|
}
|
|
}
|
|
|
|
|
|
if let policy = authenticationPolicy {
|
|
if let policy = authenticationPolicy {
|
|
- if #available(iOS 8.0, OSX 10.10, *) {
|
|
|
|
|
|
+ if #available(OSX 10.10, *) {
|
|
var error: Unmanaged<CFError>?
|
|
var error: Unmanaged<CFError>?
|
|
guard let accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibility.rawValue, SecAccessControlCreateFlags(rawValue: policy.rawValue), &error) else {
|
|
guard let accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault, accessibility.rawValue, SecAccessControlCreateFlags(rawValue: policy.rawValue), &error) else {
|
|
if let error = error?.takeUnretainedValue() {
|
|
if let error = error?.takeUnretainedValue() {
|
|
@@ -1373,7 +1373,7 @@ extension AuthenticationType : RawRepresentable, CustomStringConvertible {
|
|
extension Accessibility : RawRepresentable, CustomStringConvertible {
|
|
extension Accessibility : RawRepresentable, CustomStringConvertible {
|
|
|
|
|
|
public init?(rawValue: String) {
|
|
public init?(rawValue: String) {
|
|
- if #available(iOS 8.0, OSX 10.10, *) {
|
|
|
|
|
|
+ if #available(OSX 10.10, *) {
|
|
switch rawValue {
|
|
switch rawValue {
|
|
case String(kSecAttrAccessibleWhenUnlocked):
|
|
case String(kSecAttrAccessibleWhenUnlocked):
|
|
self = WhenUnlocked
|
|
self = WhenUnlocked
|
|
@@ -1411,7 +1411,7 @@ extension Accessibility : RawRepresentable, CustomStringConvertible {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public var rawValue: String {
|
|
public var rawValue: String {
|
|
switch self {
|
|
switch self {
|
|
case WhenUnlocked:
|
|
case WhenUnlocked:
|
|
@@ -1421,7 +1421,7 @@ extension Accessibility : RawRepresentable, CustomStringConvertible {
|
|
case Always:
|
|
case Always:
|
|
return kSecAttrAccessibleAlways as String
|
|
return kSecAttrAccessibleAlways as String
|
|
case WhenPasscodeSetThisDeviceOnly:
|
|
case WhenPasscodeSetThisDeviceOnly:
|
|
- if #available(iOS 8.0, OSX 10.10, *) {
|
|
|
|
|
|
+ if #available(OSX 10.10, *) {
|
|
return kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly as String
|
|
return kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly as String
|
|
} else {
|
|
} else {
|
|
fatalError("'Accessibility.WhenPasscodeSetThisDeviceOnly' is not available on this version of OS.")
|
|
fatalError("'Accessibility.WhenPasscodeSetThisDeviceOnly' is not available on this version of OS.")
|