Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions EduroamConfigure/CertificateStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class CertificateStore
{
/// <summary>
/// Installs the certificate into the certificate store chosen.
/// If the certificate is sucessfully installed, this will be recorded in the Persistant Storage
/// If the certificate is successfully installed, this will be recorded in the Persistent Storage
/// </summary>
/// <param name="cert">Certificate to install</param>
/// <param name="storeName">The certificate store to use</param>
Expand Down Expand Up @@ -181,7 +181,7 @@ public static bool UninstallCertificate(X509Certificate2 cert, StoreName storeNa
}

/// <summary>
/// Uses the persistant storage to uninstall all known installed certificates
/// Uses the persistent storage to uninstall all known installed certificates
/// </summary>
/// <returns>true on success</returns>
public static bool UninstallAllInstalledCertificates(bool omitRootCa, bool abortOnFail = false, bool omitNotInstalledByUs = true)
Expand Down
6 changes: 3 additions & 3 deletions EduroamConfigure/ConnectToEduroam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void AttemptInstallCertificate()

/// <summary>
/// A class which helps you install one of the authMethods
/// in a EapConfig, designed to be interactive wiht the user.
/// in a EapConfig, designed to be interactive with the user.
/// </summary>
public class EapAuthMethodInstaller
{
Expand All @@ -173,7 +173,7 @@ public class EapAuthMethodInstaller
/// <summary>
/// Constructs a EapAuthMethodInstaller
/// </summary>
/// <param name="authMethod">The authentification method to attempt to install</param>
/// <param name="authMethod">The authentication method to attempt to install</param>
public EapAuthMethodInstaller(EapConfig.AuthenticationMethod authMethod)
{
AuthMethod = authMethod ?? throw new ArgumentNullException(paramName: nameof(authMethod));
Expand Down Expand Up @@ -247,7 +247,7 @@ public void InstallWLANProfile()
/// <summary>
/// Deletes all network profile matching ssid, which is "eduroam" by default
/// </summary>
/// <returns>True if all profile deletions were succesful</returns>
/// <returns>True if all profile deletions were successful</returns>
public static void RemoveAllWLANProfiles()
{
Exception ex = null;
Expand Down
12 changes: 6 additions & 6 deletions EduroamConfigure/EapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class AuthenticationMethod
public string ClientCertificatePassphrase { get; } // passphrase for ^
public string ClientOuterIdentity { get; } // expect it to have a realm. Also known as: anonymous identity, routing identity
public string ClientInnerIdentitySuffix { get; } // realm
public bool ClientInnerIdentityHint { get; } // Wether to disallow subrealms or not (see https://github.com/GEANT/CAT/issues/190)
public bool ClientInnerIdentityHint { get; } // Whether to disallow subrealms or not (see https://github.com/GEANT/CAT/issues/190)

public bool IsHS20Supported { get => EapConfig.CredentialApplicabilities.Any(cred => cred.ConsortiumOid != null); }
public bool IsSSIDSupported { get => EapConfig.CredentialApplicabilities.Any(cred => cred.Ssid != null && cred.Ssid.Length != 0); }
Expand Down Expand Up @@ -186,7 +186,7 @@ public X509Certificate2 ClientCertificateAsX509Certificate2()
#endregion CertExport
#region Verification

// methods to check if the authentification method is complete, and methods to mend it
// methods to check if the authentication method is complete, and methods to mend it

/// <summary>
/// If this returns true, then the user must provide the login credentials
Expand Down Expand Up @@ -531,7 +531,7 @@ public static EapConfig FromXmlData(string eapConfigXmlData)
// Outdated: https://tools.ietf.org/id/draft-winter-opsawg-eap-metadata-00.html

// TODO: validate the file first. use schema?
// TODO: add a test on this function using fuzzing accoring to schema
// TODO: add a test on this function using fuzzing according to schema

static Func<XElement, bool> nameIs(string name) => // shorthand lambda
element => element.Name.LocalName == name;
Expand Down Expand Up @@ -715,7 +715,7 @@ static Func<XElement, bool> nameIs(string name) => // shorthand lambda
/// Refer to frmSummary.InstallEapConfig to see how to use it (TODO: actually explain when finalized)
/// </summary>
/// <param name="eapConfig">EapConfig object</param>
/// <returns>Enumeration of EapAuthMethodInstaller intances for each supported authentification method in eapConfig</returns>
/// <returns>Enumeration of EapAuthMethodInstaller instances for each supported authentication method in eapConfig</returns>
public IEnumerable<AuthenticationMethod> SupportedAuthenticationMethods
{
get => AuthenticationMethods.Where(EduroamNetwork.IsAuthMethodSupported);
Expand Down Expand Up @@ -879,8 +879,8 @@ public enum EapType
}

/// <summary>
/// The type of authentification used in the inner tunnel.
/// Also known as stage 2 authentification.
/// The type of authentication used in the inner tunnel.
/// Also known as stage 2 authentication.
/// </summary>
public enum InnerAuthType
{
Expand Down
18 changes: 9 additions & 9 deletions EduroamConfigure/EduroamNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private EduroamNetwork(
}

/// <summary>
/// Checks if eapConfig contains any supported authentification methods.
/// Checks if eapConfig contains any supported authentication methods.
/// If no such method exists, then warn the user before trying to install the config.
/// </summary>
/// <param name="eapConfig">The EAP config to check</param>
Expand All @@ -69,7 +69,7 @@ public static bool IsEapConfigSupported(EapConfig eapConfig)
/// <summary>
/// Checks if authMethod is supported.
/// </summary>
/// <param name="authMethod">The Authentification method to check</param>
/// <param name="authMethod">The Authentication method to check</param>
/// <returns>True if supported</returns>
public static bool IsAuthMethodSupported(EapConfig.AuthenticationMethod authMethod)
{
Expand Down Expand Up @@ -104,7 +104,7 @@ public void InstallProfiles(EapConfig.AuthenticationMethod authMethod, bool forA
try
{
// forAllUsers must be true when installing the profile, but false when installing userdata
// Otherwise the profile is installed but doens't work. We don't know why.
// Otherwise the profile is installed but doesn't work. We don't know why.
profile = InstallProfile(profileName, profileXml, hs20: false, forAllUsers: true);
// forAllUsers does not work with EAP-TLS, probably because the certificate is in the personal store
// Same for all methods where the CA is not public
Expand All @@ -127,7 +127,7 @@ public void InstallProfiles(EapConfig.AuthenticationMethod authMethod, bool forA
try
{
// forAllUsers must be true when installing the profile, but false when installing userdata
// Otherwise the profile is installed but doens't work. We don't know why.
// Otherwise the profile is installed but doesn't work. We don't know why.
profile = InstallProfile(profileName, profileXml, hs20: true, forAllUsers: true);
// forAllUsers does not work with EAP-TLS, probably because the certificate is in the personal store
// Same for all methods where the CA is not public
Expand Down Expand Up @@ -170,7 +170,7 @@ public void InstallProfiles(EapConfig.AuthenticationMethod authMethod, bool forA
// https://answers.microsoft.com/en-us/msoffice/forum/msoffice_onenote-mso_amobile-msoversion_other/error-code-80004005/ba567a2a-e037-40c3-9a5e-428030db6223

// When HS20 is not supported, an exception is thrown with these values
// We ignore the error, except if no SSID was configured (ignored in the stanza ealier)
// We ignore the error, except if no SSID was configured (ignored in the stanza earlier)
// 1206 == ManagedNativeWifi.Win32.NativeMethod.ERROR_BAD_PROFILE
if (e.ErrorCode == -2147467259 && e.NativeErrorCode == 1206)
{
Expand Down Expand Up @@ -254,7 +254,7 @@ public void InstallUserData(ConfiguredWLANProfile profile, string userDataXml, b
,
userDataXml))
{
if (!profile.HasUserData) // ommit uneccesary writes
if (!profile.HasUserData) // omit unnecessary writes
{
PersistingStore.ConfiguredWLANProfiles = PersistingStore.ConfiguredWLANProfiles
.Remove(profile)
Expand All @@ -270,9 +270,9 @@ public void InstallUserData(ConfiguredWLANProfile profile, string userDataXml, b
/// <summary>
/// Attempts to delete any previously installed network profiles
/// </summary>
/// <returns>True if ANY profile was deleted succesfully</returns>
/// <returns>True if ANY profile was deleted successfully</returns>
/// <remarks>
/// True does not mean all the profiles has been deleted. Check IsConfigured ot verify this.
/// True does not mean all the profiles has been deleted. Check IsConfigured or verify this.
/// </remarks>
public void RemoveInstalledProfiles()
{
Expand Down Expand Up @@ -399,7 +399,7 @@ private static void PruneStaleProfiles()
}

/// <summary>
/// Tries to access the wireless interfaces and reports wether the service is available or not
/// Tries to access the wireless interfaces and reports whether the service is available or not
/// If this returns false, then no interfaces nor packs will be available to configure
/// </summary>
/// <returns>True if wireless service is available</returns>
Expand Down
6 changes: 3 additions & 3 deletions EduroamConfigure/IdentityProviderParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace EduroamConfigure
public static class IdentityProviderParser
{
/// <summary>
/// Searches thourgh the list of providers, intended for user-facing search interfaces.
/// Searches through the list of providers, intended for user-facing search interfaces.
/// </summary>
/// <param name="providers">List of providers to query</param>
/// <param name="searchString">Query string</param>
Expand All @@ -28,7 +28,7 @@ static bool startsWithInv(string str, string query) =>

// NICE TO HAVE: add realms/domain as possible match

// Lexically sort by prioritized criterias.
// Lexically sort by prioritized criteria.
var sortedList = providers
// Precompute compute the normalized name
.Select(provider => (nname: NormalizeString(provider.Name), provider))
Expand Down Expand Up @@ -98,7 +98,7 @@ private static string StringToAcronym(string str)
/// </summary>
/// <param name="username">user[@realm]</param>
/// <param name="requiredRealm">the realm required for the username, empty for any realm, null for no realm needed</param>
/// <param name="noSubDomainInRealm">Wether to allow subdomains in the realm</param>
/// <param name="noSubDomainInRealm">Whether to allow subdomains in the realm</param>
/// <returns>nothing if no rules are broken, otherwise descriptions of rulse being broken</returns>
public static IEnumerable<string> GetRulesBrokenOnUsername(string username, string requiredRealm, bool noSubDomainInRealm)
{
Expand Down
6 changes: 3 additions & 3 deletions EduroamConfigure/LetsWifi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static async Task<bool> AuthorizeAccess(IdentityProviderProfile profile,
/// Parse a json response and store the tokens provided
/// </summary>
/// <param name="jsonResponse"></param>
/// <exception cref="ApiParsingException">Misformed JSON or missing requird fields</exception>
/// <exception cref="ApiParsingException">Malformed JSON or missing required fields</exception>
private static void SetAccessTokensFromJson(string jsonResponse)
{
// Parse json response to retrieve authorization tokens
Expand Down Expand Up @@ -218,7 +218,7 @@ public static async Task<EapConfig> RequestAndDownloadEapConfig()
/// Either refreshes the stored Eapconfig XML (for TTLS and PEAP), or requests
/// a new EAP config (TLS) from LetsWifi using the refresh token, then installs it.
/// </summary>
/// <param name="force">Wether to force a reinstall even if the current certificate still is valid for quote some time</param>
/// <param name="force">Whether to force a reinstall even if the current certificate still is valid for quote some time</param>
/// <returns>An enum describing the result</returns>
/// <exception cref="ApiParsingException">JSON cannot be deserialized</exception>
public static async Task<RefreshResponse> RefreshAndInstallEapConfig(bool force = false, bool onlyLetsWifi = false)
Expand Down Expand Up @@ -259,7 +259,7 @@ public static async Task<RefreshResponse> RefreshAndInstallEapConfig(bool force
if (!PersistingStore.IsRefreshable)
return RefreshResponse.NotRefreshable;

// should never be null since the check above was successfull
// should never be null since the check above was successful
var profileInfo = PersistingStore.IdentityProvider
?? throw new NullReferenceException(nameof(PersistingStore.IdentityProvider) + " was null");

Expand Down
2 changes: 1 addition & 1 deletion EduroamConfigure/OAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Uri GetRedirectUri()
// check if url is valid
if (!(responseUrl?.IsWellFormedOriginalString() ?? false)
|| string.IsNullOrEmpty(responseUrl?.ToString()))
throw new EduroamAppUserException("oauth empty reponse url",
throw new EduroamAppUserException("oauth empty response url",
userFacingMessage: "HTTP request returned nothing valid.");

// Extract query parameters from response url
Expand Down
2 changes: 1 addition & 1 deletion EduroamConfigure/PersistingStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static ImmutableHashSet<ConfiguredWLANProfile> ConfiguredWLANProfiles
}

/// <summary>
/// Check if there is installed any valid (not neccesarily tested) connection
/// Check if there is installed any valid (not necessarily tested) connection
/// </summary>
public static bool AnyValidWLANProfile
{
Expand Down
4 changes: 2 additions & 2 deletions EduroamConfigure/ProfileXml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private static XElement CreateEapConfiguration(
// and we cannot do inner validation.
bool enableServerValidation = serverNames.Any() || caThumbprints.Any();

// creates the root xml strucure, with references to some of its descendants
// creates the root xml structure, with references to some of its descendants
XElement configElement;
XElement serverValidationElement;
XElement caHashListElement = null; // eapType == eapType.TLS only
Expand All @@ -211,7 +211,7 @@ private static XElement CreateEapConfiguration(
new XElement(nsEHC + "Config")
);

// namespace element local names dependant on EAP type
// namespace element local names dependent on EAP type
XNamespace nsEapType;
string thumbprintNodeName;

Expand Down
4 changes: 2 additions & 2 deletions WpfApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ bool contains(string check) =>
/// Refresh the profile if needed and report to the user if running persistent
/// </summary>
/// <param name="f">Function to show user a message in the tray icon</param>
/// <param name="force">Wether to force a reinstall even if the current certificate still is valid for quote some time</param>
/// <param name="force">Whether to force a reinstall even if the current certificate still is valid for quote some time</param>
/// <exception cref="ApiException">The API did something unexpected</exception>
private static async void RefreshInstalledProfile(bool force)
{
Expand Down Expand Up @@ -187,7 +187,7 @@ public static void RemoveSettings(bool omitRootCa = false)
public static void PromptAndUninstallSelf(Action<bool> shutdown)
{
var choice = MessageBox.Show(
"You are currently in the process of completly uninstalling geteduroam.\n" +
"You are currently in the process of completely uninstalling geteduroam.\n" +
(CertificateStore.AnyRootCaInstalledByUs()
? "This means uninstalling all the trusted root certificates installed by this application.\n\n"
: "\n") +
Expand Down
2 changes: 1 addition & 1 deletion WpfApp/Classes/FileDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private static string GetFileFromDialog(string dialogTitle, string filter)

/// <summary>
/// Checks if a config file has been selected,
/// and if the filepath and type extention is valid.
/// and if the filepath and type extension is valid.
/// </summary>
/// <returns>True if valid file, false if not.</returns>
public static bool ValidateFileSelection(string filePath, List<string> fileTypes)
Expand Down
8 changes: 4 additions & 4 deletions WpfApp/Classes/SelfInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void EnsureIsInstalled()
if (IsRunningInInstallLocation) return; // TODO: some flow to update itself
if (IsInstalled)
{
// TODO: assemblyversion instad of file date
// TODO: assemblyversion instead of file date
var d1 = File.GetLastWriteTime(ThisExePath);
var d2 = File.GetLastWriteTime(InstallExePath);
if (DateTime.Compare(d1, d2) <= 0)
Expand All @@ -205,7 +205,7 @@ public void EnsureIsInstalled()
/// </summary>
private void InstallToUserLocal()
{
// avoid uneccesary/illegal updates
// avoid unnecessary/illegal updates
if (IsRunningInInstallLocation) // sanity check, should never happen
throw new EduroamConfigure.EduroamAppUserException("already installed", // TODO: use a more fitting exception?
"This application has already been installed. " +
Expand All @@ -220,7 +220,7 @@ private void InstallToUserLocal()
File.Copy(ThisExePath, InstallExePath, overwrite: true); // BAD: keeps NTFS streams which we don't want
*/
//
// Reading and writing manually works better, because then the resulting .exe can be openend
// Reading and writing manually works better, because then the resulting .exe can be opened
// at startup or by the scheduler without the user getting "Are you sure you want to run this software?"
var binaryExe = File.ReadAllBytes(ThisExePath);
File.WriteAllBytes(InstallExePath, binaryExe);
Expand Down Expand Up @@ -300,7 +300,7 @@ private void InstallToUserLocal()
/// Uninstalls the program.
/// </summary>
/// <typeparam name="T">return value</typeparam>
/// <param name="shutdownAction">a action which will shut down the application in the way you want, recieves true on successfull uninstall</param>
/// <param name="shutdownAction">a action which will shut down the application in the way you want, receives true on successful uninstall</param>
/// <param name="doDeleteSelf">whether to schedule a deletion of InstallExePath</param>
/// <returns>T</returns>
public void ExitAndUninstallSelf(Action<bool> shutdownAction, bool doDeleteSelf = false)
Expand Down
Loading