Skip to content

Commit 5217bef

Browse files
committed
misc: update algorithm entry in CoseEcPublicKey and clean up CoseEdDsaPublicKey documentation; rename test classes and methods for clarity
1 parent d8e52f7 commit 5217bef

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

Yubico.YubiKey/src/Yubico/YubiKey/Fido2/Cose/CoseEcPublicKey.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,8 @@ public override byte[] Encode()
295295

296296
return new CborMapWriter<int>()
297297
.Entry(TagKeyType, (int)CoseKeyType.Ec2)
298-
299-
// .Entry(TagAlgorithm, (int)Algorithm) // Should be correct, right? Instead of -25
300-
.Entry(
301-
TagAlgorithm, (int)CoseAlgorithmIdentifier.ECDHwHKDF256) // Should be correct, right? Instead of -25
298+
// .Entry(TagAlgorithm, (int)Algorithm) // Should be correct, right? Instead of hardcoding -25
299+
.Entry(TagAlgorithm, (int)CoseAlgorithmIdentifier.ECDHwHKDF256)
302300
.Entry(TagCurve, (int)Curve)
303301
.Entry(TagX, XCoordinate)
304302
.Entry(TagY, YCoordinate)

Yubico.YubiKey/src/Yubico/YubiKey/Fido2/Cose/CoseEdDsaPublicKey.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ namespace Yubico.YubiKey.Fido2.Cose
3131
/// in RFC8152: CBOR Object Signing and Encryption (COSE) standard. Supplementary information can be found in
3232
/// section 6.5.6 of the CTAP2.1 specification (under the heading `getPublicKey()`).
3333
/// </para>
34-
/// <para>
35-
/// This class has multiple constructors. One constructs an empty object and allows the caller to set the key
36-
/// parameters via the properties on this class. Another constructs a key based on the COSE form encoded in CBOR.
37-
/// Lastly, there is a constructor that takes in a .NET representation of an EC public key used for interoperating
38-
/// with the .NET cryptographic library.
39-
/// </para>
4034
/// </remarks>
4135
public class CoseEdDsaPublicKey : CoseKey
4236
{

Yubico.YubiKey/tests/unit/Yubico/YubiKey/Cryptography/EcdsaVerifyTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Yubico.YubiKey.Cryptography
2525
public class EcdsaVerifyTests
2626
{
2727
[Fact]
28-
public void PivKey_VerifDigestedDatay_Succeeds()
28+
public void PivKey_VerifDigestedData_Succeeds()
2929
{
3030
var pubKey = new PivEccPublicKey(GetEncodedPoint());
3131
byte[] digest = GetDigest();
@@ -37,7 +37,7 @@ public void PivKey_VerifDigestedDatay_Succeeds()
3737
}
3838

3939
[Fact]
40-
public void CoseKey_VeriDigestedDatafy_Succeeds()
40+
public void CoseKey_VeriDigestedData_Succeeds()
4141
{
4242
var pubKey = new CoseEcPublicKey(CoseEcCurve.P256, GetX(), GetY());
4343
byte[] digest = GetDigest();

Yubico.YubiKey/tests/unit/Yubico/YubiKey/Fido2/Cose/CosePublicEcKeyTests.cs renamed to Yubico.YubiKey/tests/unit/Yubico/YubiKey/Fido2/Cose/CoseEcPublicKeyTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace Yubico.YubiKey.Fido2.Cose
2121
{
22-
public class CosePublicEcKeyTests
22+
public class CoseEcPublicKeyTests
2323
{
2424
[Theory]
2525
[InlineData(KeyDefinitions.KeyOids.P256)]

Yubico.YubiKey/tests/utilities/Yubico/YubiKey/TestUtilities/IntegrationTestDeviceEnumeration.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ namespace Yubico.YubiKey.TestUtilities
4141
/// </summary>
4242
public sealed class IntegrationTestDeviceEnumeration
4343
{
44-
// 1. Constants (private, then public)
44+
4545
private const string YUBIKEY_INTEGRATIONTEST_ALLOWED_KEYS_VAR_NAME = "YUBIKEY_INTEGRATIONTEST_ALLOWEDKEYS";
4646

47-
// 2. Static Fields
47+
4848
private static readonly Lazy<IntegrationTestDeviceEnumeration> LazyInstance =
4949
new Lazy<IntegrationTestDeviceEnumeration>(() => new IntegrationTestDeviceEnumeration());
5050

51-
// 3. Instance Fields (readonly, then regular)
51+
5252
private readonly string _allowlistFileName = $"{YUBIKEY_INTEGRATIONTEST_ALLOWED_KEYS_VAR_NAME}.txt";
5353
private readonly string? _configDirectory;
5454
public readonly HashSet<string> AllowedSerialNumbers;
5555

56-
// 4. Properties
56+
5757
private string SetupMessage => "In order to prevent you from accidentally wiping your own important keys," +
5858
"you must add your allow-listed Yubikeys serial number to either the environment variable " +
5959
$"'{YUBIKEY_INTEGRATIONTEST_ALLOWED_KEYS_VAR_NAME}' or to the file {_allowlistFileName} at {AllowListFilePath}\n" +

0 commit comments

Comments
 (0)