Skip to content

Commit

Permalink
Test that 1023 bytes long credential IDs are supported
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Aug 2, 2022
1 parent b3cc7fc commit 76119b9
Showing 1 changed file with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3553,8 +3553,57 @@ class RelyingPartyRegistrationSpec
}

describe("RelyingParty.finishRegistration") {
it("throws RegistrationFailedException in case of errors.") {
it("supports 1023 bytes long credential IDs.") {
val rp = RelyingParty
.builder()
.identity(
RelyingPartyIdentity
.builder()
.id("localhost")
.name("Test party")
.build()
)
.credentialRepository(Helpers.CredentialRepository.empty)
.build()

val pkcco = rp.startRegistration(
StartRegistrationOptions
.builder()
.user(
UserIdentity
.builder()
.name("test")
.displayName("Test Testsson")
.id(new ByteArray(Array()))
.build()
)
.build()
)

forAll(byteArray(1023)) { credId =>
val credential = TestAuthenticator
.createUnattestedCredential(challenge = pkcco.getChallenge)
._1
.toBuilder()
.id(credId)
.build()

val result = Try(
rp.finishRegistration(
FinishRegistrationOptions
.builder()
.request(pkcco)
.response(credential)
.build()
)
)
result shouldBe a[Success[_]]
result.get.getKeyId.getId should equal(credId)
result.get.getKeyId.getId.size should be(1023)
}
}

it("throws RegistrationFailedException in case of errors.") {
val rp = RelyingParty
.builder()
.identity(
Expand Down

1 comment on commit 76119b9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutation test results

Package Coverage Stats Prev Prev
Overall 69 % 🔹 951 🔹 / 1374 🔹 69 % 951 / 1374
com.yubico.fido.metadata 42 % 🔹 129 🔻 / 306 🔹 42 % 130 / 306
com.yubico.internal.util 37 % 🔹 36 🔹 / 97 🔹 37 % 36 / 97
com.yubico.webauthn 71 % 🔹 367 🔹 / 512 🔹 71 % 367 / 512
com.yubico.webauthn.attestation 100 % 🏆 5 🔹 / 5 🔹 100 % 5 / 5
com.yubico.webauthn.data 93 % 🔹 380 🔺 / 407 🔹 93 % 379 / 407
com.yubico.webauthn.extension.appid 100 % 🏆 13 🔹 / 13 🔹 100 % 13 / 13
com.yubico.webauthn.extension.uvm 87 % 🔹 21 🔹 / 24 🔹 87 % 21 / 24
com.yubico.webauthn.meta 0 % 🔹 0 🔹 / 10 🔹 0 % 0 / 10

Previous run: 5242b83

Detailed reports: workflow run #168

Please sign in to comment.