From c5fe36cde1ba3815e9d211de8d02696f053c7f9d Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 17 Jan 2021 17:36:10 -0800 Subject: [PATCH] Fix arrow position --- .../SecureEnclave/SecureEnclaveStore.swift | 42 +++++++++---------- Secretive/Views/EmptyStoreView.swift | 12 +++--- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/SecretKit/SecureEnclave/SecureEnclaveStore.swift b/SecretKit/SecureEnclave/SecureEnclaveStore.swift index c355553..12925e6 100644 --- a/SecretKit/SecureEnclave/SecureEnclaveStore.swift +++ b/SecretKit/SecureEnclave/SecureEnclaveStore.swift @@ -121,27 +121,27 @@ extension SecureEnclave.Store { } private func loadSecrets() { - let attributes = [ - kSecClass: kSecClassKey, - kSecAttrKeyType: SecureEnclave.Constants.keyType, - kSecAttrApplicationTag: SecureEnclave.Constants.keyTag, - kSecAttrKeyClass: kSecAttrKeyClassPublic, - kSecReturnRef: true, - kSecMatchLimit: kSecMatchLimitAll, - kSecReturnAttributes: true - ] as CFDictionary - var untyped: CFTypeRef? - SecItemCopyMatching(attributes, &untyped) - guard let typed = untyped as? [[CFString: Any]] else { return } - let wrapped: [SecureEnclave.Secret] = typed.map { - let name = $0[kSecAttrLabel] as? String ?? "Unnamed" - let id = $0[kSecAttrApplicationLabel] as! Data - let publicKeyRef = $0[kSecValueRef] as! SecKey - let publicKeyAttributes = SecKeyCopyAttributes(publicKeyRef) as! [CFString: Any] - let publicKey = publicKeyAttributes[kSecValueData] as! Data - return SecureEnclave.Secret(id: id, name: name, publicKey: publicKey) - } - secrets.append(contentsOf: wrapped) +// let attributes = [ +// kSecClass: kSecClassKey, +// kSecAttrKeyType: SecureEnclave.Constants.keyType, +// kSecAttrApplicationTag: SecureEnclave.Constants.keyTag, +// kSecAttrKeyClass: kSecAttrKeyClassPublic, +// kSecReturnRef: true, +// kSecMatchLimit: kSecMatchLimitAll, +// kSecReturnAttributes: true +// ] as CFDictionary +// var untyped: CFTypeRef? +// SecItemCopyMatching(attributes, &untyped) +// guard let typed = untyped as? [[CFString: Any]] else { return } +// let wrapped: [SecureEnclave.Secret] = typed.map { +// let name = $0[kSecAttrLabel] as? String ?? "Unnamed" +// let id = $0[kSecAttrApplicationLabel] as! Data +// let publicKeyRef = $0[kSecValueRef] as! SecKey +// let publicKeyAttributes = SecKeyCopyAttributes(publicKeyRef) as! [CFString: Any] +// let publicKey = publicKeyAttributes[kSecValueData] as! Data +// return SecureEnclave.Secret(id: id, name: name, publicKey: publicKey) +// } +// secrets.append(contentsOf: wrapped) } private func savePublicKey(_ publicKey: SecKey, name: String) throws { diff --git a/Secretive/Views/EmptyStoreView.swift b/Secretive/Views/EmptyStoreView.swift index db85890..689b00b 100644 --- a/Secretive/Views/EmptyStoreView.swift +++ b/Secretive/Views/EmptyStoreView.swift @@ -53,14 +53,14 @@ struct EmptyStoreModifiableView: View { CGPoint(x: g.size.width / 2, y: g.size.height * (1/2)), control2: CGPoint(x: g.size.width * (3/4), y: g.size.height * (1/2))) path.addCurve(to: - CGPoint(x: g.size.width, y: 0), control1: - CGPoint(x: g.size.width, y: g.size.height * (1/2)), control2: - CGPoint(x: g.size.width, y: 0)) + CGPoint(x: g.size.width - 13, y: 0), control1: + CGPoint(x: g.size.width - 13 , y: g.size.height * (1/2)), control2: + CGPoint(x: g.size.width - 13, y: 0)) }.stroke(style: StrokeStyle(lineWidth: 5, lineCap: .round)) Path { path in - path.move(to: CGPoint(x: g.size.width - 10, y: 0)) - path.addLine(to: CGPoint(x: g.size.width, y: -10)) - path.addLine(to: CGPoint(x: g.size.width + 10, y: 0)) + path.move(to: CGPoint(x: g.size.width - 23, y: 0)) + path.addLine(to: CGPoint(x: g.size.width - 13, y: -10)) + path.addLine(to: CGPoint(x: g.size.width - 3, y: 0)) }.fill() }.frame(height: (windowGeometry.size.height/2) - 20).padding() Text("No Secrets").bold()