Fix arrow position

This commit is contained in:
Max Goedjen 2021-01-17 17:36:10 -08:00
parent 4de805dd37
commit c5fe36cde1
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
2 changed files with 27 additions and 27 deletions

View File

@ -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 {

View File

@ -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()