Skip to content

Commit

Permalink
Make green more dim; Allow key generation on simulator; Disable biometry
Browse files Browse the repository at this point in the history
  • Loading branch information
yspreen committed Apr 26, 2021
1 parent 5012129 commit 535aade
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions DGCAVerifier/Services/Enclave.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,24 @@ struct Enclave {
SecAccessControlCreateWithFlags(
kCFAllocatorDefault,
kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
[.privateKeyUsage, .biometryCurrentSet],
[.privateKeyUsage], // , .biometryCurrentSet],
&error
)
else {
return (nil, error?.takeRetainedValue().localizedDescription)
}
let attributes: [String: Any] = [
var attributes: [String: Any] = [
kSecAttrKeyType as String: kSecAttrKeyTypeEC,
kSecAttrKeySizeInBits as String: 256,
kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave,
kSecPrivateKeyAttrs as String: [
kSecAttrIsPermanent as String: true,
kSecAttrApplicationTag as String: tag,
kSecAttrAccessControl as String: access
]
]
#if !targetEnvironment(simulator)
attributes[kSecAttrTokenID as String] = kSecAttrTokenIDSecureEnclave
#endif
guard
let privateKey = SecKeyCreateRandomKey(
attributes as CFDictionary,
Expand Down
6 changes: 3 additions & 3 deletions DGCAVerifier/Storyboards/CertificateViewer.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sd1-4U-jsd">
<rect key="frame" x="0.0" y="0.0" width="0.0" height="812"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="width" priority="150" id="od5-ib-Ukc"/>
</constraints>
Expand Down Expand Up @@ -165,7 +165,7 @@
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mVj-cd-LLW">
<rect key="frame" x="0.0" y="0.0" width="0.0" height="812"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="width" priority="150" id="X3Y-ek-Sk0"/>
</constraints>
Expand Down Expand Up @@ -275,7 +275,7 @@
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="2S7-FB-tUG"/>
<color key="backgroundColor" red="0.0" green="0.32707966550000001" blue="0.088716190390000005" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.081256533510752751" green="0.19497380959577462" blue="0.074342156889608199" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstItem="mVj-cd-LLW" firstAttribute="top" secondItem="QEz-8z-pTe" secondAttribute="top" id="1Xv-In-jyj"/>
<constraint firstAttribute="topMargin" secondItem="QXS-Ot-xzX" secondAttribute="top" id="227-ff-tfJ"/>
Expand Down
2 changes: 1 addition & 1 deletion DGCAVerifier/ViewControllers/CertificateViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let buttonText = [
HCertValidity.invalid: "Retry",
]
let backgroundColor = [
HCertValidity.valid: UIColor(red: 0, green: 0.32708, blue: 0.08872, alpha: 1),
HCertValidity.valid: UIColor(red: 0.08126, green: 0.19497, blue: 0.07434, alpha: 1),
HCertValidity.invalid: UIColor(red: 0.36290, green: 0, blue: 0, alpha: 1),
]
let textColor = [
Expand Down

0 comments on commit 535aade

Please sign in to comment.