Fixed wrong wiring of benchmark for key derivation parameters

This commit is contained in:
Michael Starke
2021-12-01 00:37:01 +01:00
parent a40049a425
commit ca31d4638f
4 changed files with 28 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
github "sparkle-project/Sparkle" ~> 1.22
github "MacPass/TransformerKit" "a8b5bb73cc327ec6798569b865c32fec5eb2289f"
github "MacPass/KeePassKit" "35da75901b293a53b44b1d0fe9d8fb312a4a7602"
github "MacPass/KeePassKit" "aa1a385a8e2a0c9296c8d5e8286f1c7884e04533"
github "mstarke/HNHUi" ~> 6.0

View File

@@ -1,4 +1,4 @@
github "MacPass/KeePassKit" "35da75901b293a53b44b1d0fe9d8fb312a4a7602"
github "MacPass/KeePassKit" "aa1a385a8e2a0c9296c8d5e8286f1c7884e04533"
github "MacPass/KissXML" "933f04fe5ad95c2be07ec0c2f801e140007f20fa"
github "MacPass/TransformerKit" "a8b5bb73cc327ec6798569b865c32fec5eb2289f"
github "mstarke/HNHUi" "6.0"

View File

@@ -53,9 +53,9 @@
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="500" height="360"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="500" height="380"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" misplaced="YES" id="2">
<rect key="frame" x="0.0" y="0.0" width="500" height="360"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="288">
<rect key="frame" x="433" y="13" width="54" height="32"/>
@@ -84,7 +84,7 @@ Gw
</connections>
</button>
<tabView translatesAutoresizingMaskIntoConstraints="NO" id="357">
<rect key="frame" x="13" y="40" width="474" height="334"/>
<rect key="frame" x="13" y="40" width="474" height="310"/>
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="General" identifier="1" id="358">
@@ -271,6 +271,9 @@ Gw
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="benchmarkParametersForDelay:" target="-2" id="Iyw-Hp-gm2"/>
</connections>
</button>
<tabView drawsBackground="NO" type="noTabsNoBorder" translatesAutoresizingMaskIntoConstraints="NO" id="2MY-PW-kzL">
<rect key="frame" x="12" y="47" width="390" height="111"/>
@@ -278,11 +281,11 @@ Gw
<tabViewItems>
<tabViewItem label="Aes" identifier="1" id="ft1-pl-lpO">
<view key="view" id="88i-IZ-Yev">
<rect key="frame" x="0.0" y="0.0" width="390" height="61"/>
<rect key="frame" x="0.0" y="0.0" width="390" height="111"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ztz-iY-hWV">
<rect key="frame" x="64" y="23" width="50" height="16"/>
<rect key="frame" x="64" y="73" width="50" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Rounds" id="uUQ-9s-M5E">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -290,7 +293,7 @@ Gw
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8aq-34-rcd">
<rect key="frame" x="120" y="20" width="150" height="21"/>
<rect key="frame" x="120" y="70" width="150" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="150" id="cdb-ED-zB3"/>
</constraints>
@@ -418,7 +421,7 @@ Gw
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qKz-Ir-3lf">
<rect key="frame" x="254" y="17" width="19" height="28"/>
<rect key="frame" x="254" y="18" width="19" height="26"/>
<stepperCell key="cell" continuous="YES" alignment="left" maxValue="100" id="vGb-iO-lp5"/>
</stepper>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="vRx-5Q-dar">

View File

@@ -197,12 +197,21 @@
[self dismissSheet:0];
}
- (IBAction)benchmarkRounds:(id)sender {
self.createKeyDerivationParametersButton.enabled = NO;
[KPKAESKeyDerivation parametersForDelay:1 completionHandler:^(NSDictionary * _Nonnull options) {
self.aesEncryptionRoundsTextField.integerValue = [options[KPKAESRoundsOption] unsignedInteger64Value];
self.createKeyDerivationParametersButton.enabled = YES;
}];
- (IBAction)benchmarkParametersForDelay:(id)sender {
NSUUID *selectedKdfUUID = self.keyDerivationSettingsTabView.selectedTabViewItem.identifier;
if([selectedKdfUUID isEqual:[KPKAESKeyDerivation uuid]]) {
self.createKeyDerivationParametersButton.enabled = NO;
[KPKAESKeyDerivation parametersForDelay:1 completionHandler:^(NSDictionary * _Nonnull options) {
self.aesEncryptionRoundsTextField.integerValue = [options[KPKAESRoundsOption] unsignedInteger64Value];
self.createKeyDerivationParametersButton.enabled = YES;
}];
}
else if([selectedKdfUUID isEqual:[KPKArgon2DKeyDerivation uuid]]) {
// TODO: add benchmark
}
else if([selectedKdfUUID isEqual:[KPKArgon2IDKeyDerivation uuid]]) {
// TODO: add benchmark
}
}
- (void)updateView {