diff options
author | Jeroen Leenarts <jeroen.leenarts@gmail.com> | 2018-09-16 22:38:32 +0200 |
---|---|---|
committer | Jeroen Leenarts <jeroen.leenarts@gmail.com> | 2018-09-16 22:38:32 +0200 |
commit | 8326735fcb800ef87157610670f478aeeb468c12 (patch) | |
tree | 558ed8f48b6a7ea87659cbd8b134dfc67d74f727 /WireGuard | |
parent | Start a new peer without an allowed ips entry. (diff) | |
download | wireguard-apple-8326735fcb800ef87157610670f478aeeb468c12.tar.xz wireguard-apple-8326735fcb800ef87157610670f478aeeb468c12.zip |
Show public key on interface. Do not generate public key on peer on generate. Add public key copy buttons.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard')
4 files changed, 234 insertions, 218 deletions
diff --git a/WireGuard/Base.lproj/Main.storyboard b/WireGuard/Base.lproj/Main.storyboard index bf68b14..5d8e3f5 100644 --- a/WireGuard/Base.lproj/Main.storyboard +++ b/WireGuard/Base.lproj/Main.storyboard @@ -117,24 +117,24 @@ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> <prototypes> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="InterfaceTableViewCell" rowHeight="400" id="06N-KU-LSv" customClass="InterfaceTableViewCell" customModule="WireGuard" customModuleProvider="target"> - <rect key="frame" x="0.0" y="28" width="375" height="400"/> + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="InterfaceTableViewCell" rowHeight="452" id="06N-KU-LSv" customClass="InterfaceTableViewCell" customModule="WireGuard" customModuleProvider="target"> + <rect key="frame" x="0.0" y="28" width="375" height="452"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="06N-KU-LSv" id="CSX-Am-ix0"> - <rect key="frame" x="0.0" y="0.0" width="375" height="399.5"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="451.5"/> <autoresizingMask key="autoresizingMask"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="DIe-hK-tf6"> - <rect key="frame" x="16" y="11" width="343" height="378"/> + <rect key="frame" x="16" y="11" width="343" height="430"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Interface" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uku-6H-QWf"> - <rect key="frame" x="0.0" y="0.0" width="343" height="51.5"/> + <rect key="frame" x="0.0" y="0.0" width="343" height="49.5"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="uLA-3S-jCk"> - <rect key="frame" x="0.0" y="65.5" width="343" height="51"/> + <rect key="frame" x="0.0" y="63.5" width="343" height="49.5"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uJE-LK-T3Y"> <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> @@ -143,7 +143,7 @@ <nil key="highlightedColor"/> </label> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="6y9-eJ-8fF"> - <rect key="frame" x="0.0" y="16" width="343" height="35"/> + <rect key="frame" x="0.0" y="16" width="343" height="33.5"/> <nil key="textColor"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> @@ -155,7 +155,7 @@ </subviews> </stackView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="wwN-OL-XUr"> - <rect key="frame" x="0.0" y="130.5" width="343" height="51.5"/> + <rect key="frame" x="0.0" y="127" width="343" height="49.5"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Private key" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fMQ-kK-FD5"> <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> @@ -164,10 +164,10 @@ <nil key="highlightedColor"/> </label> <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="26U-vy-7Lc"> - <rect key="frame" x="0.0" y="16" width="343" height="35.5"/> + <rect key="frame" x="0.0" y="16" width="343" height="33.5"/> <subviews> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hYd-0L-nnY"> - <rect key="frame" x="0.0" y="0.0" width="232" height="35.5"/> + <rect key="frame" x="0.0" y="0.0" width="235" height="33.5"/> <nil key="textColor"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/> @@ -177,7 +177,10 @@ </connections> </textField> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="C1M-bh-5mf"> - <rect key="frame" x="240" y="0.0" width="103" height="35.5"/> + <rect key="frame" x="243" y="0.0" width="100" height="33.5"/> + <constraints> + <constraint firstAttribute="width" constant="100" id="EvB-pb-J1d"/> + </constraints> <state key="normal" title="Generate"/> <connections> <action selector="generateTapped:" destination="06N-KU-LSv" eventType="touchUpInside" id="efE-zK-eCe"/> @@ -187,8 +190,43 @@ </stackView> </subviews> </stackView> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="wbd-4k-oxV"> + <rect key="frame" x="0.0" y="190.5" width="343" height="49"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Public key" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jrM-B3-YSD"> + <rect key="frame" x="0.0" y="0.0" width="343" height="15.5"/> + <fontDescription key="fontDescription" type="system" pointSize="13"/> + <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> + <nil key="highlightedColor"/> + </label> + <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Cuy-Vl-A3X"> + <rect key="frame" x="0.0" y="15.5" width="343" height="33.5"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qks-JK-qzc"> + <rect key="frame" x="0.0" y="0.0" width="243" height="33.5"/> + <constraints> + <constraint firstAttribute="height" constant="33.5" id="YP4-TS-hbj"/> + </constraints> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Oxw-Sl-4if"> + <rect key="frame" x="243" y="0.0" width="100" height="33.5"/> + <constraints> + <constraint firstAttribute="width" constant="100" id="cMG-GD-Qad"/> + </constraints> + <state key="normal" title="Copy"/> + <connections> + <action selector="copyPublicKey:" destination="06N-KU-LSv" eventType="touchUpInside" id="bkX-yC-E6w"/> + </connections> + </button> + </subviews> + </stackView> + </subviews> + </stackView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="nv7-4q-QjM"> - <rect key="frame" x="0.0" y="196" width="343" height="51.5"/> + <rect key="frame" x="0.0" y="253.5" width="343" height="49.5"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Listen port" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h1p-Ea-ler"> <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> @@ -197,7 +235,7 @@ <nil key="highlightedColor"/> </label> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="(random)" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="CSv-At-WVr"> - <rect key="frame" x="0.0" y="16" width="343" height="35.5"/> + <rect key="frame" x="0.0" y="16" width="343" height="33.5"/> <nil key="textColor"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> @@ -209,7 +247,7 @@ </subviews> </stackView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="PJF-32-WyF"> - <rect key="frame" x="0.0" y="261.5" width="343" height="51"/> + <rect key="frame" x="0.0" y="317" width="343" height="49.5"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Addresses" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="L6l-5D-oKQ"> <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> @@ -218,7 +256,7 @@ <nil key="highlightedColor"/> </label> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="oOY-vP-nYT"> - <rect key="frame" x="0.0" y="16" width="343" height="35"/> + <rect key="frame" x="0.0" y="16" width="343" height="33.5"/> <nil key="textColor"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> @@ -230,19 +268,19 @@ </subviews> </stackView> <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="7fC-XV-6KP"> - <rect key="frame" x="0.0" y="326.5" width="343" height="51.5"/> + <rect key="frame" x="0.0" y="380.5" width="343" height="49.5"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="NR3-Me-yLc"> - <rect key="frame" x="0.0" y="0.0" width="232" height="51.5"/> + <rect key="frame" x="0.0" y="0.0" width="235" height="49.5"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="DNS servers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SA3-N0-wfi"> - <rect key="frame" x="0.0" y="0.0" width="232" height="16"/> + <rect key="frame" x="0.0" y="0.0" width="235" height="16"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ByK-wW-6Q4"> - <rect key="frame" x="0.0" y="16" width="232" height="35.5"/> + <rect key="frame" x="0.0" y="16" width="235" height="33.5"/> <nil key="textColor"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> @@ -254,16 +292,16 @@ </subviews> </stackView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="UId-O4-q3t"> - <rect key="frame" x="240" y="0.0" width="103" height="51.5"/> + <rect key="frame" x="243" y="0.0" width="100" height="49.5"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MTU" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vYu-BI-0Gj"> - <rect key="frame" x="0.0" y="0.0" width="103" height="16"/> + <rect key="frame" x="0.0" y="0.0" width="100" height="16"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="(auto)" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="myM-B2-sjT"> - <rect key="frame" x="0.0" y="16" width="103" height="35.5"/> + <rect key="frame" x="0.0" y="16" width="100" height="33.5"/> <nil key="textColor"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> @@ -273,14 +311,13 @@ </connections> </textField> </subviews> + <constraints> + <constraint firstAttribute="width" constant="100" id="4BH-E4-p8q"/> + </constraints> </stackView> </subviews> </stackView> </subviews> - <constraints> - <constraint firstItem="C1M-bh-5mf" firstAttribute="width" secondItem="DIe-hK-tf6" secondAttribute="width" multiplier="0.3" id="CGs-Ix-e2L"/> - <constraint firstItem="UId-O4-q3t" firstAttribute="width" secondItem="DIe-hK-tf6" secondAttribute="width" multiplier="0.3" id="Tly-iG-ApC"/> - </constraints> </stackView> </subviews> <constraints> @@ -297,10 +334,11 @@ <outlet property="mtuField" destination="myM-B2-sjT" id="ppo-pV-tMl"/> <outlet property="nameField" destination="6y9-eJ-8fF" id="PKk-lj-jK9"/> <outlet property="privateKeyField" destination="hYd-0L-nnY" id="JLS-5M-E3T"/> + <outlet property="publicKeyField" destination="Qks-JK-qzc" id="20S-qa-P0O"/> </connections> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="AddPeerTableViewCell" rowHeight="60" id="RyR-s5-lBV" customClass="AddPeerTableViewCell" customModule="WireGuard" customModuleProvider="target"> - <rect key="frame" x="0.0" y="428" width="375" height="60"/> + <rect key="frame" x="0.0" y="480" width="375" height="60"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="RyR-s5-lBV" id="gPY-qW-fbd"> <rect key="frame" x="0.0" y="0.0" width="375" height="59.5"/> @@ -325,7 +363,7 @@ </tableViewCellContentView> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="PeerTableViewCell" rowHeight="308" id="gzz-88-0IG" customClass="PeerTableViewCell" customModule="WireGuard" customModuleProvider="target"> - <rect key="frame" x="0.0" y="488" width="375" height="308"/> + <rect key="frame" x="0.0" y="540" width="375" height="308"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="gzz-88-0IG" id="XA6-EM-5V9"> <rect key="frame" x="0.0" y="0.0" width="375" height="307.5"/> @@ -365,16 +403,31 @@ <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="RLw-0o-akQ"> + <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sN7-yp-U0M"> <rect key="frame" x="0.0" y="16" width="343" height="30"/> - <nil key="textColor"/> - <fontDescription key="fontDescription" type="system" pointSize="14"/> - <textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/> - <connections> - <action selector="textfieldDidChange:" destination="gzz-88-0IG" eventType="editingChanged" id="taX-Ji-pVu"/> - <outlet property="delegate" destination="gzz-88-0IG" id="bkQ-Nc-VH4"/> - </connections> - </textField> + <subviews> + <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="RLw-0o-akQ"> + <rect key="frame" x="0.0" y="0.0" width="243" height="30"/> + <nil key="textColor"/> + <fontDescription key="fontDescription" type="system" pointSize="14"/> + <textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" smartDashesType="no" smartInsertDeleteType="no" smartQuotesType="no"/> + <connections> + <action selector="textfieldDidChange:" destination="gzz-88-0IG" eventType="editingChanged" id="taX-Ji-pVu"/> + <outlet property="delegate" destination="gzz-88-0IG" id="bkQ-Nc-VH4"/> + </connections> + </textField> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="k1n-bm-do3"> + <rect key="frame" x="243" y="0.0" width="100" height="30"/> + <constraints> + <constraint firstAttribute="width" constant="100" id="qqO-dK-9SJ"/> + </constraints> + <state key="normal" title="Copy"/> + <connections> + <action selector="copyPublicKey:" destination="gzz-88-0IG" eventType="touchUpInside" id="ozU-nW-UXP"/> + </connections> + </button> + </subviews> + </stackView> </subviews> </stackView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="miX-4O-NOP"> @@ -527,33 +580,36 @@ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> <prototypes> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="InterfaceInfoTableViewCell" rowHeight="400" id="4nk-ch-nYS" customClass="InterfaceInfoTableViewCell" customModule="WireGuard" customModuleProvider="target"> - <rect key="frame" x="0.0" y="28" width="375" height="400"/> + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="InterfaceInfoTableViewCell" rowHeight="268" id="4nk-ch-nYS" customClass="InterfaceInfoTableViewCell" customModule="WireGuard" customModuleProvider="target"> + <rect key="frame" x="0.0" y="28" width="375" height="268"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="4nk-ch-nYS" id="eBg-fg-M9P"> - <rect key="frame" x="0.0" y="0.0" width="375" height="399.5"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="267.5"/> <autoresizingMask key="autoresizingMask"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="LbD-1j-3B4"> - <rect key="frame" x="16" y="11" width="343" height="378"/> + <rect key="frame" x="16" y="11" width="343" height="246"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Interface" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qcg-LJ-nRV"> - <rect key="frame" x="0.0" y="0.0" width="343" height="51.5"/> + <rect key="frame" x="0.0" y="0.0" width="343" height="51"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="wJ9-cl-tZH"> - <rect key="frame" x="0.0" y="65.5" width="343" height="51"/> + <rect key="frame" x="0.0" y="65" width="343" height="51"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mov-bF-HkG"> - <rect key="frame" x="0.0" y="0.0" width="343" height="30.5"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mov-bF-HkG"> + <rect key="frame" x="0.0" y="0.0" width="343" height="17.5"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="t89-wK-B5h"> - <rect key="frame" x="0.0" y="30.5" width="343" height="20.5"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="t89-wK-B5h"> + <rect key="frame" x="0.0" y="17.5" width="343" height="33.5"/> + <constraints> + <constraint firstAttribute="height" constant="33.5" id="gFw-bj-ygR"/> + </constraints> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> @@ -561,99 +617,62 @@ </subviews> </stackView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Ao6-49-xJm"> - <rect key="frame" x="0.0" y="130.5" width="343" height="51.5"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Private key" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vWC-ql-O8v"> - <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> - <fontDescription key="fontDescription" type="system" pointSize="13"/> - <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bCm-fp-MGf"> - <rect key="frame" x="0.0" y="16" width="343" height="35.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="J6k-WI-jjf"> - <rect key="frame" x="0.0" y="196" width="343" height="51.5"/> + <rect key="frame" x="0.0" y="130" width="343" height="51"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Listen port" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TTJ-6b-ome"> - <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Public key" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vWC-ql-O8v"> + <rect key="frame" x="0.0" y="0.0" width="343" height="17.5"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="I9X-NK-kCV"> - <rect key="frame" x="0.0" y="16" width="343" height="35.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - </label> + <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5W3-mw-rz8"> + <rect key="frame" x="0.0" y="17.5" width="343" height="33.5"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bCm-fp-MGf"> + <rect key="frame" x="0.0" y="0.0" width="243" height="33.5"/> + <gestureRecognizers/> + <constraints> + <constraint firstAttribute="height" constant="33.5" id="tj9-5o-wt9"/> + </constraints> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QuI-0b-Odb"> + <rect key="frame" x="243" y="0.0" width="100" height="33.5"/> + <constraints> + <constraint firstAttribute="width" constant="100" id="Cwg-HP-HvQ"/> + </constraints> + <state key="normal" title="Copy"/> + <connections> + <action selector="copyPublicKey:" destination="4nk-ch-nYS" eventType="touchUpInside" id="4i8-TJ-9Ix"/> + </connections> + </button> + </subviews> + </stackView> </subviews> </stackView> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="bu6-xb-eu0"> - <rect key="frame" x="0.0" y="261.5" width="343" height="51"/> + <rect key="frame" x="0.0" y="195" width="343" height="51"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Addresses" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GWn-Of-NWj"> - <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Addresses" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GWn-Of-NWj"> + <rect key="frame" x="0.0" y="0.0" width="343" height="17.5"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nxw-Kz-Bhj"> - <rect key="frame" x="0.0" y="16" width="343" height="35"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nxw-Kz-Bhj"> + <rect key="frame" x="0.0" y="17.5" width="343" height="33.5"/> + <constraints> + <constraint firstAttribute="height" constant="33.5" id="Pzj-Qq-uXx"/> + </constraints> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> </subviews> </stackView> - <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="ua3-dP-NKH"> - <rect key="frame" x="0.0" y="326.5" width="343" height="51.5"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="YDF-kD-W2c"> - <rect key="frame" x="0.0" y="0.0" width="232" height="51.5"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="DNS servers" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3yE-yO-hwt"> - <rect key="frame" x="0.0" y="0.0" width="232" height="31"/> - <fontDescription key="fontDescription" type="system" pointSize="13"/> - <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MYs-AI-nbx"> - <rect key="frame" x="0.0" y="31" width="232" height="20.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="1EB-sf-JeM"> - <rect key="frame" x="240" y="0.0" width="103" height="51.5"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="MTU" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GWI-hc-UbS"> - <rect key="frame" x="0.0" y="0.0" width="103" height="16"/> - <fontDescription key="fontDescription" type="system" pointSize="13"/> - <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="r3L-cH-wX1"> - <rect key="frame" x="0.0" y="16" width="103" height="35.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - </stackView> </subviews> - <constraints> - <constraint firstItem="1EB-sf-JeM" firstAttribute="width" secondItem="LbD-1j-3B4" secondAttribute="width" multiplier="0.3" id="ZdE-IM-Xz4"/> - </constraints> </stackView> </subviews> <constraints> @@ -665,123 +684,102 @@ </tableViewCellContentView> <connections> <outlet property="addressesField" destination="nxw-Kz-Bhj" id="e7Y-Z0-3Mk"/> - <outlet property="dnsField" destination="MYs-AI-nbx" id="Pge-e9-zYk"/> - <outlet property="listenPortField" destination="I9X-NK-kCV" id="EjP-bc-q5B"/> - <outlet property="mtuField" destination="r3L-cH-wX1" id="beI-fZ-cSs"/> <outlet property="nameField" destination="t89-wK-B5h" id="6fz-z4-Gf5"/> - <outlet property="privateKeyField" destination="bCm-fp-MGf" id="ELY-n7-1Cc"/> + <outlet property="publicKeyField" destination="bCm-fp-MGf" id="O6Q-Tf-gKf"/> </connections> </tableViewCell> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="PeerInfoTableViewCell" rowHeight="308" id="E8O-dS-GmI" customClass="PeerInfoTableViewCell" customModule="WireGuard" customModuleProvider="target"> - <rect key="frame" x="0.0" y="428" width="375" height="308"/> + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="PeerInfoTableViewCell" rowHeight="268" id="E8O-dS-GmI" customClass="PeerInfoTableViewCell" customModule="WireGuard" customModuleProvider="target"> + <rect key="frame" x="0.0" y="296" width="375" height="268"/> <autoresizingMask key="autoresizingMask"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="E8O-dS-GmI" id="Igy-0b-NWe"> - <rect key="frame" x="0.0" y="0.0" width="375" height="307.5"/> + <rect key="frame" x="0.0" y="0.0" width="375" height="267.5"/> <autoresizingMask key="autoresizingMask"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="14" translatesAutoresizingMaskIntoConstraints="NO" id="QR4-dk-gU5"> - <rect key="frame" x="16" y="11" width="343" height="286"/> + <rect key="frame" x="16" y="11" width="343" height="246"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Peer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5qD-R9-tZb"> - <rect key="frame" x="0.0" y="0.0" width="343" height="46"/> + <rect key="frame" x="0.0" y="0.0" width="343" height="51"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="1NC-ix-aSU"> - <rect key="frame" x="0.0" y="60" width="343" height="46"/> + <rect key="frame" x="0.0" y="65" width="343" height="51"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Public key" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="quD-G5-mlN"> - <rect key="frame" x="0.0" y="0.0" width="343" height="25.5"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Public key" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="quD-G5-mlN"> + <rect key="frame" x="0.0" y="0.0" width="343" height="17.5"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QB9-fz-eN5"> - <rect key="frame" x="0.0" y="25.5" width="343" height="20.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - </label> + <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7mv-Bm-kLf"> + <rect key="frame" x="0.0" y="17.5" width="343" height="33.5"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QB9-fz-eN5"> + <rect key="frame" x="0.0" y="0.0" width="243" height="33.5"/> + <constraints> + <constraint firstAttribute="height" constant="33.5" id="T62-rA-BQP"/> + </constraints> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <nil key="textColor"/> + <nil key="highlightedColor"/> + </label> + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pfR-7r-TKm"> + <rect key="frame" x="243" y="0.0" width="100" height="33.5"/> + <constraints> + <constraint firstAttribute="width" constant="100" id="fQD-S2-KoL"/> + </constraints> + <state key="normal" title="Copy"/> + <connections> + <action selector="copyPublicKey:" destination="E8O-dS-GmI" eventType="touchUpInside" id="fe2-gy-StL"/> + </connections> + </button> + </subviews> + </stackView> </subviews> </stackView> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="pVH-s6-OWU"> - <rect key="frame" x="0.0" y="120" width="343" height="46"/> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="1v9-H0-PWt"> + <rect key="frame" x="0.0" y="130" width="343" height="51"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Pre-shared key" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i6i-mE-2aX"> - <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Allowed IPs" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3fw-zF-zA7"> + <rect key="frame" x="0.0" y="0.0" width="343" height="17.5"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kz0-I7-wvc"> - <rect key="frame" x="0.0" y="16" width="343" height="30"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h84-DM-thL"> + <rect key="frame" x="0.0" y="17.5" width="343" height="33.5"/> + <constraints> + <constraint firstAttribute="height" constant="33.5" id="VAA-Cv-By1"/> + </constraints> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> </subviews> </stackView> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="1v9-H0-PWt"> - <rect key="frame" x="0.0" y="180" width="343" height="46"/> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="2h1-6W-ZsL"> + <rect key="frame" x="0.0" y="195" width="343" height="51"/> <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Allowed IPs" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3fw-zF-zA7"> - <rect key="frame" x="0.0" y="0.0" width="343" height="16"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Endpoint" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TYO-NN-8gk"> + <rect key="frame" x="0.0" y="0.0" width="343" height="17.5"/> <fontDescription key="fontDescription" type="system" pointSize="13"/> <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> <nil key="highlightedColor"/> </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h84-DM-thL"> - <rect key="frame" x="0.0" y="16" width="343" height="30"/> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pju-S6-5Ls"> + <rect key="frame" x="0.0" y="17.5" width="343" height="33.5"/> + <constraints> + <constraint firstAttribute="height" constant="33.5" id="hBg-pD-foN"/> + </constraints> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> </subviews> </stackView> - <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="qMd-me-JGQ"> - <rect key="frame" x="0.0" y="240" width="343" height="46"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="2h1-6W-ZsL"> - <rect key="frame" x="0.0" y="0.0" width="232" height="46"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Endpoint" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TYO-NN-8gk"> - <rect key="frame" x="0.0" y="0.0" width="232" height="25.5"/> - <fontDescription key="fontDescription" type="system" pointSize="13"/> - <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pju-S6-5Ls"> - <rect key="frame" x="0.0" y="25.5" width="232" height="20.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="7TC-8I-7Ms"> - <rect key="frame" x="240" y="0.0" width="103" height="46"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Persistent keepalive" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Vmu-2v-xFe"> - <rect key="frame" x="0.0" y="0.0" width="103" height="16"/> - <fontDescription key="fontDescription" type="system" pointSize="13"/> - <color key="textColor" red="0.60784313729999995" green="0.60784313729999995" blue="0.60784313729999995" alpha="1" colorSpace="calibratedRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UvC-3x-kth"> - <rect key="frame" x="0.0" y="16" width="103" height="30"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - </stackView> </subviews> - <constraints> - <constraint firstItem="7TC-8I-7Ms" firstAttribute="width" secondItem="QR4-dk-gU5" secondAttribute="width" multiplier="0.3" id="SNf-fC-Uq3"/> - </constraints> </stackView> </subviews> <constraints> @@ -794,8 +792,6 @@ <connections> <outlet property="allowedIpsField" destination="h84-DM-thL" id="CR8-i3-y2q"/> <outlet property="endpointField" destination="pju-S6-5Ls" id="y3c-20-rkp"/> - <outlet property="persistentKeepaliveField" destination="UvC-3x-kth" id="5kQ-cy-TaW"/> - <outlet property="preSharedKeyField" destination="kz0-I7-wvc" id="TJa-5a-tEU"/> <outlet property="publicKeyField" destination="QB9-fz-eN5" id="hfg-EO-IRw"/> </connections> </tableViewCell> diff --git a/WireGuard/Models/Interface+Extension.swift b/WireGuard/Models/Interface+Extension.swift index 5dbeb5a..aa4e3cb 100644 --- a/WireGuard/Models/Interface+Extension.swift +++ b/WireGuard/Models/Interface+Extension.swift @@ -10,6 +10,20 @@ import Foundation extension Interface { + var publicKey: String? { + if let privateKeyString = privateKey, let privateKey = Data(base64Encoded: privateKeyString) { + var publicKey = Data(count: 32) + privateKey.withUnsafeBytes({ (privateKeyBytes) -> Void in + publicKey.withUnsafeMutableBytes({ (mutableBytes) -> Void in + curve25519_derive_public_key(mutableBytes, privateKeyBytes) + }) + }) + return publicKey.base64EncodedString() + } else { + return nil + } + } + func validate() throws { guard let privateKey = privateKey, !privateKey.isEmpty else { throw InterfaceValidationError.emptyPrivateKey diff --git a/WireGuard/ViewControllers/TunnelConfigurationTableViewController.swift b/WireGuard/ViewControllers/TunnelConfigurationTableViewController.swift index db5182e..d5b0740 100644 --- a/WireGuard/ViewControllers/TunnelConfigurationTableViewController.swift +++ b/WireGuard/ViewControllers/TunnelConfigurationTableViewController.swift @@ -150,18 +150,6 @@ extension TunnelConfigurationTableViewController: InterfaceTableViewCellDelegate } self.tunnel.interface?.privateKey = privateKey.base64EncodedString() - - if let peers = self.tunnel.peers?.array as? [Peer] { - peers.forEach { - var publicKey = Data(count: 32) - privateKey.withUnsafeBytes({ (privateKeyBytes) -> Void in - publicKey.withUnsafeMutableBytes({ (mutableBytes) -> Void in - curve25519_derive_public_key(mutableBytes, privateKeyBytes) - }) - }) - $0.publicKey = publicKey.base64EncodedString() - } - } } } self.tableView.reloadData() @@ -178,17 +166,26 @@ class InterfaceTableViewCell: UITableViewCell { nameField.text = model.tunnel?.title addressesField.text = model.addresses privateKeyField.text = model.privateKey + publicKeyField.text = model.publicKey + listenPortField.text = String(model.listenPort) dnsField.text = model.dns mtuField.text = String(model.mtu) } } + @IBAction func copyPublicKey(_ sender: Any) { + if let publicKey = model.publicKey { + UIPasteboard.general.string = publicKey + } + } + weak var delegate: InterfaceTableViewCellDelegate? @IBOutlet weak var nameField: UITextField! @IBOutlet weak var addressesField: UITextField! @IBOutlet weak var privateKeyField: UITextField! + @IBOutlet weak var publicKeyField: UILabel! @IBOutlet weak var listenPortField: UITextField! @IBOutlet weak var dnsField: UITextField! @IBOutlet weak var mtuField: UITextField! @@ -208,6 +205,7 @@ extension InterfaceTableViewCell: UITextFieldDelegate { model.tunnel?.title = string } else if sender == privateKeyField { model.privateKey = string + publicKeyField.text = model.publicKey } else if sender == addressesField { model.addresses = string } else if sender == listenPortField { @@ -246,6 +244,12 @@ class PeerTableViewCell: UITableViewCell { @IBOutlet weak var endpointField: UITextField! @IBOutlet weak var persistentKeepaliveField: UITextField! + @IBAction func copyPublicKey(_ sender: Any) { + if let publicKey = peer.publicKey { + UIPasteboard.general.string = publicKey + } + } + @IBAction func deletePeer(_ sender: Any) { delegate?.delete(peer: peer) } diff --git a/WireGuard/ViewControllers/TunnelInfoTableViewController.swift b/WireGuard/ViewControllers/TunnelInfoTableViewController.swift index 7e05222..094114a 100644 --- a/WireGuard/ViewControllers/TunnelInfoTableViewController.swift +++ b/WireGuard/ViewControllers/TunnelInfoTableViewController.swift @@ -73,37 +73,39 @@ class InterfaceInfoTableViewCell: UITableViewCell { didSet { nameField.text = model.tunnel?.title addressesField.text = model.addresses - privateKeyField.text = model.privateKey - listenPortField.text = String(model.listenPort) - dnsField.text = model.dns - mtuField.text = String(model.mtu) + publicKeyField.text = model.publicKey } } @IBOutlet weak var nameField: UILabel! @IBOutlet weak var addressesField: UILabel! - @IBOutlet weak var privateKeyField: UILabel! - @IBOutlet weak var listenPortField: UILabel! - @IBOutlet weak var dnsField: UILabel! - @IBOutlet weak var mtuField: UILabel! + @IBOutlet weak var publicKeyField: UILabel! + + @IBAction func copyPublicKey(_ sender: Any) { + if let publicKey = model.publicKey { + UIPasteboard.general.string = publicKey + } + } } class PeerInfoTableViewCell: UITableViewCell { var peer: Peer! { didSet { publicKeyField.text = peer.publicKey - preSharedKeyField.text = peer.presharedKey allowedIpsField.text = peer.allowedIPs endpointField.text = peer.endpoint - persistentKeepaliveField.text = String(peer.persistentKeepalive) } } @IBOutlet weak var publicKeyField: UILabel! - @IBOutlet weak var preSharedKeyField: UILabel! @IBOutlet weak var allowedIpsField: UILabel! @IBOutlet weak var endpointField: UILabel! - @IBOutlet weak var persistentKeepaliveField: UILabel! + + @IBAction func copyPublicKey(_ sender: Any) { + if let publicKey = peer.publicKey { + UIPasteboard.general.string = publicKey + } + } } extension TunnelInfoTableViewController: Identifyable {} |