-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Schannel protocol & settings configuration
- Loading branch information
Showing
64 changed files
with
1,453 additions
and
1,607 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace CipherPunk.UI; | ||
|
||
using CommunityToolkit.Mvvm.ComponentModel; | ||
|
||
internal sealed class UiMemberStatus<T>(T member, bool enabled) : ObservableObject | ||
{ | ||
public T Member | ||
{ | ||
get => member; | ||
set => SetProperty(ref member, value); | ||
} | ||
|
||
public bool Enabled | ||
{ | ||
get => enabled; | ||
set => SetProperty(ref enabled, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace CipherPunk.UI; | ||
|
||
using CommunityToolkit.Mvvm.ComponentModel; | ||
|
||
internal sealed class UiSchannelProtocolSettings : ObservableObject | ||
{ | ||
private SchannelProtocol protocol; | ||
private SchannelProtocolStatus clientStatus; | ||
private SchannelProtocolStatus serverStatus; | ||
|
||
public UiSchannelProtocolSettings(SchannelProtocolSettings schannelProtocolSettings) | ||
{ | ||
Protocol = schannelProtocolSettings.Protocol; | ||
ClientStatus = schannelProtocolSettings.ClientStatus; | ||
ServerStatus = schannelProtocolSettings.ServerStatus; | ||
} | ||
|
||
public SchannelProtocol Protocol | ||
{ | ||
get => protocol; | ||
set => SetProperty(ref protocol, value); | ||
} | ||
|
||
public SchannelProtocolStatus ClientStatus | ||
{ | ||
get => clientStatus; | ||
set => SetProperty(ref clientStatus, value); | ||
} | ||
|
||
public SchannelProtocolStatus ServerStatus | ||
{ | ||
get => serverStatus; | ||
set => SetProperty(ref serverStatus, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
namespace CipherPunk.UI; | ||
|
||
using System.Collections.ObjectModel; | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
|
||
internal sealed class UiSchannelSettings : ObservableObject | ||
{ | ||
private ObservableCollection<UiMemberStatus<SchannelEventLogging>>? eventLogging; | ||
private ObservableCollection<UiMemberStatus<SchannelCertificateMappingMethod>>? certificateMappingMethod; | ||
private int? clientCacheTime; | ||
private bool? enableOcspStaplingForSni; | ||
private int? issuerCacheSize; | ||
private int? issuerCacheTime; | ||
private bool? sendTrustedIssuerList; | ||
private int? serverCacheTime; | ||
private int? messageLimitClient; | ||
private int? messageLimitServer; | ||
private int? messageLimitServerClientAuth; | ||
|
||
public UiSchannelSettings(SchannelSettings schannelSettings) | ||
{ | ||
EventLogging = new(Enum.GetValues<SchannelEventLogging>().Select(q => new UiMemberStatus<SchannelEventLogging>(q, schannelSettings.EventLogging!.Value.HasFlag(q)))); | ||
CertificateMappingMethods = new(Enum.GetValues<SchannelCertificateMappingMethod>().Select(q => new UiMemberStatus<SchannelCertificateMappingMethod>(q, schannelSettings.CertificateMappingMethods!.Value.HasFlag(q)))); | ||
ClientCacheTime = schannelSettings.ClientCacheTime; | ||
EnableOcspStaplingForSni = schannelSettings.EnableOcspStaplingForSni; | ||
IssuerCacheSize = schannelSettings.IssuerCacheSize; | ||
IssuerCacheTime = schannelSettings.IssuerCacheTime; | ||
MaximumCacheSize = schannelSettings.MaximumCacheSize; | ||
SendTrustedIssuerList = schannelSettings.SendTrustedIssuerList; | ||
ServerCacheTime = schannelSettings.ServerCacheTime; | ||
MessageLimitClient = schannelSettings.MessageLimitClient; | ||
MessageLimitServer = schannelSettings.MessageLimitServer; | ||
MessageLimitServerClientAuth = schannelSettings.MessageLimitServerClientAuth; | ||
} | ||
|
||
public ObservableCollection<UiMemberStatus<SchannelEventLogging>>? EventLogging | ||
{ | ||
get => eventLogging; | ||
set => SetProperty(ref eventLogging, value); | ||
} | ||
|
||
public ObservableCollection<UiMemberStatus<SchannelCertificateMappingMethod>>? CertificateMappingMethods | ||
{ | ||
get => certificateMappingMethod; | ||
set => SetProperty(ref certificateMappingMethod, value); | ||
} | ||
|
||
public int? ClientCacheTime | ||
{ | ||
get => clientCacheTime; | ||
set => SetProperty(ref clientCacheTime, value); | ||
} | ||
|
||
public bool? EnableOcspStaplingForSni | ||
{ | ||
get => enableOcspStaplingForSni; | ||
set => SetProperty(ref enableOcspStaplingForSni, value); | ||
} | ||
|
||
public int? IssuerCacheSize | ||
{ | ||
get => issuerCacheSize; | ||
set => SetProperty(ref issuerCacheSize, value); | ||
} | ||
|
||
public int? IssuerCacheTime | ||
{ | ||
get => issuerCacheTime; | ||
set => SetProperty(ref issuerCacheTime, value); | ||
} | ||
|
||
public int? MaximumCacheSize | ||
{ | ||
get => clientCacheTime; | ||
set => SetProperty(ref clientCacheTime, value); | ||
} | ||
|
||
public bool? SendTrustedIssuerList | ||
{ | ||
get => sendTrustedIssuerList; | ||
set => SetProperty(ref sendTrustedIssuerList, value); | ||
} | ||
|
||
public int? ServerCacheTime | ||
{ | ||
get => serverCacheTime; | ||
set => SetProperty(ref serverCacheTime, value); | ||
} | ||
|
||
public int? MessageLimitClient | ||
{ | ||
get => messageLimitClient; | ||
set => SetProperty(ref messageLimitClient, value); | ||
} | ||
|
||
public int? MessageLimitServer | ||
{ | ||
get => messageLimitServer; | ||
set => SetProperty(ref messageLimitServer, value); | ||
} | ||
|
||
public int? MessageLimitServerClientAuth | ||
{ | ||
get => messageLimitServerClientAuth; | ||
set => SetProperty(ref messageLimitServerClientAuth, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.