Show EKU and random endpoint in configuration

This commit is contained in:
Davide De Rosa 2019-03-27 17:06:13 +01:00
parent 250c3399da
commit 400cea0f7b
3 changed files with 28 additions and 2 deletions

View File

@ -83,12 +83,12 @@ class ConfigurationViewController: UIViewController, TableModelHost {
if isEditable {
model.set([.resetOriginal], in: .reset)
}
model.set([.client, .tlsWrapping], in: .tls)
model.set([.client, .tlsWrapping, .eku], in: .tls)
model.set([.compressionFraming, .compressionAlgorithm], in: .compression)
if let dnsServers = configuration.dnsServers {
model.set(.dnsServer, count: dnsServers.count, in: .dns)
}
model.set([.keepAlive, .renegSeconds], in: .other)
model.set([.keepAlive, .renegSeconds, .randomEndpoint], in: .other)
return model
}()
@ -188,6 +188,8 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
case tlsWrapping
case eku
case compressionFraming
case compressionAlgorithm
@ -197,6 +199,8 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
case keepAlive
case renegSeconds
case randomEndpoint
}
func numberOfSections(in tableView: UITableView) -> Int {
@ -275,6 +279,12 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
cell.accessoryType = .none
cell.isTappable = false
case .eku:
cell.leftText = V.Eku.caption
cell.rightText = (configuration.checksEKU ?? false) ? V.All.Value.enabled : V.All.Value.disabled
cell.accessoryType = .none
cell.isTappable = false
case .compressionFraming:
cell.leftText = L10n.Configuration.Cells.CompressionFraming.caption
cell.rightText = configuration.compressionFraming.cellDescription
@ -319,6 +329,12 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
}
cell.accessoryType = .none
cell.isTappable = false
case .randomEndpoint:
cell.leftText = V.RandomEndpoint.caption
cell.rightText = (configuration.randomizeEndpoint ?? false) ? V.All.Value.enabled : V.All.Value.disabled
cell.accessoryType = .none
cell.isTappable = false
}
return cell
}

View File

@ -162,6 +162,7 @@
"configuration.cells.tls_wrapping.caption" = "Wrapping";
"configuration.cells.tls_wrapping.value.auth" = "Authentication";
"configuration.cells.tls_wrapping.value.crypt" = "Encryption";
"configuration.cells.eku.caption" = "Extended verification";
"configuration.cells.dns_server.caption" = "Address";
"configuration.cells.compression_framing.caption" = "Framing";
"configuration.cells.compression_framing.value.lzo" = "--comp-lzo";
@ -173,6 +174,7 @@
"configuration.cells.keep_alive.value.seconds" = "%d seconds";
"configuration.cells.renegotiation_seconds.caption" = "Renegotiation";
"configuration.cells.renegotiation_seconds.value.after" = "after %@";
"configuration.cells.random_endpoint.caption" = "Randomize endpoint";
"configuration.cells.all.value.enabled" = "Enabled";
"configuration.cells.all.value.disabled" = "Disabled";

View File

@ -152,6 +152,10 @@ public enum L10n {
/// Address
public static let caption = L10n.tr("Localizable", "configuration.cells.dns_server.caption")
}
public enum Eku {
/// Extended verification
public static let caption = L10n.tr("Localizable", "configuration.cells.eku.caption")
}
public enum KeepAlive {
/// Keep-alive
public static let caption = L10n.tr("Localizable", "configuration.cells.keep_alive.caption")
@ -162,6 +166,10 @@ public enum L10n {
}
}
}
public enum RandomEndpoint {
/// Randomize endpoint
public static let caption = L10n.tr("Localizable", "configuration.cells.random_endpoint.caption")
}
public enum RenegotiationSeconds {
/// Renegotiation
public static let caption = L10n.tr("Localizable", "configuration.cells.renegotiation_seconds.caption")