Skip to content

Commit 030bc36

Browse files
committed
fix: size calculation for EC keys in Piv
1 parent cb54ca2 commit 030bc36

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Yubico.YubiKey/src/Yubico/YubiKey/Piv/PivEccPublicKey.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,13 @@ private static int GetExpectedSize([DisallowNull] PivAlgorithm? algorithm)
231231
}
232232

233233
int expectedSize = algorithm.Value.GetPivKeyDefinition().KeyDefinition.LengthInBytes;
234-
if (algorithm.Value is PivAlgorithm.EccP256 or PivAlgorithm.EccP384)
234+
if (algorithm.Value is PivAlgorithm.EccEd25519 or PivAlgorithm.EccX25519)
235235
{
236-
return (expectedSize * 2) + 1;
236+
return expectedSize;
237237
}
238238

239-
return expectedSize;
239+
return (expectedSize * 2) + 1;
240+
240241
}
241242
}
242243
}

0 commit comments

Comments
 (0)