Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jpassing committed Mar 31, 2024
1 parent b5d5ab6 commit 7adc2ee
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions sources/Jpki.NUnit/AssertThrows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ private static Exception Unwrap(this Exception e)
{
try
{
#pragma warning disable VSTHRD002 // Avoid problematic synchronous waits
#pragma warning disable VSTHRD002 // Avoid problematic synchronous waits
code().Wait();
#pragma warning restore VSTHRD002
#pragma warning restore VSTHRD002
}
catch (AggregateException e)
{
Expand Down
4 changes: 2 additions & 2 deletions sources/Jpki.Powershell.Test/Runtime/Http/TestJsonResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ namespace Jpki.Powershell.Test.Runtime.Http
[TestFixture]
public class TestJsonResource
{
private static readonly Uri SampleUrl =
private static readonly Uri SampleUrl =
new Uri("https://accounts.google.com/.well-known/openid-configuration");

private static readonly Uri NotFoundUrl =
new Uri("https://gstatic.com/generate_404");

Expand Down
4 changes: 2 additions & 2 deletions sources/Jpki.Powershell.Test/Runtime/Text/TestJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public void DeserializeStream()
public void DeserializeString()
{
var json = "{\"a\": \"aa\",\"b\": \"bb\"}";

var c = Json.Deserialize<SomeClass>(json);

AssertThat.NotNull(c);
AssertThat.AreEqual("aa", c!.A);
AssertThat.AreEqual("bb", c!.B);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void YubiKey5ci()
AssertThat.AreEqual("...", statement.LegalHeader);
AssertThat.AreEqual("YubiKey 5 Series with Lightning", statement.Description);
CollectionAssertThat.AreEquivalent(
new[] { "secp256r1_ecdsa_sha256_raw" },
new[] { "secp256r1_ecdsa_sha256_raw" },
statement.AuthenticationAlgorithms!);
CollectionAssertThat.AreEquivalent(
new[] { "hardware", "secure_element", "remote_handle" },
Expand All @@ -61,7 +61,7 @@ public void YubiKey5ci()
statement.MatcherProtection!);
AssertThat.AreEqual(128, statement.CryptoStrength);
AssertThat.AreEqual(
"CN=Yubico U2F Root CA Serial 457200631",
"CN=Yubico U2F Root CA Serial 457200631",
statement.AttestationRootCertificates.First().Issuer);
}

Expand Down
3 changes: 2 additions & 1 deletion sources/Jpki.Powershell/Runtime/Http/HttpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ internal class HttpServer : IDisposable
/// port stays the same for this instance.
/// </summary>
private readonly Lazy<int> randomUnusedPort = new Lazy<int>(
() => {
() =>
{
var listener = new TcpListener(IPAddress.Loopback, 0);
try
{
Expand Down
4 changes: 2 additions & 2 deletions sources/Jpki.Powershell/Runtime/Http/JsonResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
//

using Jpki.Powershell.Runtime.Text;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Threading;
using System.Net;
using System.Threading.Tasks;

namespace Jpki.Powershell.Runtime.Http
{
Expand Down
2 changes: 1 addition & 1 deletion sources/Jpki.Powershell/Runtime/Http/RestResourceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected RequestBase(RestResourceBase resource)
/// <summary>
/// Request URI.
/// </summary>
public Uri Uri { get; set; }
public Uri Uri { get; set; }

/// <summary>
/// Initialze a HTTP request message.
Expand Down
2 changes: 1 addition & 1 deletion sources/Jpki.Powershell/Runtime/Http/TextResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// under the License.
//

using System.Net.Http;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

Expand Down
2 changes: 1 addition & 1 deletion sources/Jpki.Powershell/Runtime/Http/UserAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class UserAgent
public string Platform { get; }

public static UserAgent Default = new UserAgent(
"JPKI",
"JPKI",
typeof(UserAgent).Assembly.GetName().Version ?? new Version(1, 0));

public UserAgent(string product, Version version, string platform)
Expand Down
2 changes: 1 addition & 1 deletion sources/Jpki.Powershell/Runtime/Text/Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Jpki.Powershell.Runtime.Text
/// Deserialize JSON using either Newtonsoft.Json (NetFx) or
/// System.Text.Json (.NET).
/// </summary>
internal static class Json
internal static class Json
{
public static T? Deserialize<T>(Stream stream) where T : class
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public Guid? Aaguid
/// in the authenticator attestation.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public IReadOnlyList<X509Certificate2> AttestationRootCertificates
public IReadOnlyList<X509Certificate2> AttestationRootCertificates
{
get => this.AttestationRootCertificateStrings
.EnsureNotNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private static ECDsa CreateKey()
private static ECDsa CreateKey(int keySize)
{
#if WINDOWS || NETFRAMEWORK
return new ECDsaCng(keySize);
return new ECDsaCng(keySize);
#else
return ECDsa.Create();
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

using Jpki.Security.Cryptography;
using NUnit.Framework;
using System.Diagnostics;
using System.Linq;
using System.Security.Cryptography;

Expand Down
10 changes: 5 additions & 5 deletions sources/Jpki.Security.WebAuthn/Format/BigEndian.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ internal static uint ReadGuid(
ReadUInt16(data, offset + 6, out var c);

guid = new Guid(
a, b, c,
data[offset + 8],
data[offset + 9],
a, b, c,
data[offset + 8],
data[offset + 9],
data[offset + 10],
data[offset + 11],
data[offset + 12],
data[offset + 13],
data[offset + 14],
data[offset + 13],
data[offset + 14],
data[offset + 15]);
return 16;
}
Expand Down

0 comments on commit 7adc2ee

Please sign in to comment.