@@ -414,7 +414,7 @@ class RelyingPartyRegistrationSpec extends FunSpec with Matchers with ScalaCheck
414
414
415
415
it(" Verification succeeds if client data specifies token binding is unsupported, and RP does not use it." ) {
416
416
val steps = finishRegistration(testData = RegistrationTestData .FidoU2f .BasicAttestation
417
- .editClientData(_.without(" tokenBinding" ))
417
+ .editClientData(_.without[ ObjectNode ] (" tokenBinding" ))
418
418
)
419
419
val step : FinishRegistrationSteps # Step6 = steps.begin.next.next.next.next.next
420
420
@@ -435,7 +435,7 @@ class RelyingPartyRegistrationSpec extends FunSpec with Matchers with ScalaCheck
435
435
it(" Verification fails if client data does not specify token binding status and RP specifies token binding ID." ) {
436
436
val steps = finishRegistration(
437
437
callerTokenBindingId = Some (ByteArray .fromBase64Url(" YELLOWSUBMARINE" )),
438
- testData = RegistrationTestData .FidoU2f .BasicAttestation .editClientData(_.without(" tokenBinding" ))
438
+ testData = RegistrationTestData .FidoU2f .BasicAttestation .editClientData(_.without[ ObjectNode ] (" tokenBinding" ))
439
439
)
440
440
val step : FinishRegistrationSteps # Step6 = steps.begin.next.next.next.next.next
441
441
@@ -447,7 +447,7 @@ class RelyingPartyRegistrationSpec extends FunSpec with Matchers with ScalaCheck
447
447
it(" Verification succeeds if client data does not specify token binding status and RP does not specify token binding ID." ) {
448
448
val steps = finishRegistration(
449
449
callerTokenBindingId = None ,
450
- testData = RegistrationTestData .FidoU2f .BasicAttestation .editClientData(_.without(" tokenBinding" ))
450
+ testData = RegistrationTestData .FidoU2f .BasicAttestation .editClientData(_.without[ ObjectNode ] (" tokenBinding" ))
451
451
)
452
452
val step : FinishRegistrationSteps # Step6 = steps.begin.next.next.next.next.next
453
453
@@ -493,7 +493,7 @@ class RelyingPartyRegistrationSpec extends FunSpec with Matchers with ScalaCheck
493
493
it(" Verification fails if RP specifies token binding ID but client does not support it." ) {
494
494
val steps = finishRegistration(
495
495
callerTokenBindingId = Some (ByteArray .fromBase64Url(" YELLOWSUBMARINE" )),
496
- testData = RegistrationTestData .FidoU2f .BasicAttestation .editClientData(_.without(" tokenBinding" ))
496
+ testData = RegistrationTestData .FidoU2f .BasicAttestation .editClientData(_.without[ ObjectNode ] (" tokenBinding" ))
497
497
)
498
498
val step : FinishRegistrationSteps # Step6 = steps.begin.next.next.next.next.next
499
499
@@ -796,7 +796,7 @@ class RelyingPartyRegistrationSpec extends FunSpec with Matchers with ScalaCheck
796
796
it(" a fido-u2f attestation is still rejected if invalid." ) {
797
797
val testData = RegistrationTestData .FidoU2f .BasicAttestation .updateAttestationObject(" attStmt" , { attStmtNode : JsonNode =>
798
798
attStmtNode.asInstanceOf [ObjectNode ]
799
- .set(" sig" , jsonFactory.binaryNode(Array (0 , 0 , 0 , 0 )))
799
+ .set[ ObjectNode ] (" sig" , jsonFactory.binaryNode(Array (0 , 0 , 0 , 0 )))
800
800
})
801
801
val steps = finishRegistration(
802
802
testData = testData,
@@ -1457,33 +1457,33 @@ class RelyingPartyRegistrationSpec extends FunSpec with Matchers with ScalaCheck
1457
1457
describe(" 1. Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract the contained fields." ) {
1458
1458
it(" Fails if attStmt.ver is a number value." ) {
1459
1459
val testData = defaultTestData
1460
- .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].set(" ver" , jsonFactory.numberNode(123 )))
1460
+ .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].set[ ObjectNode ] (" ver" , jsonFactory.numberNode(123 )))
1461
1461
checkFails(testData)
1462
1462
}
1463
1463
1464
1464
it(" Fails if attStmt.ver is missing." ) {
1465
1465
val testData = defaultTestData
1466
- .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].without(" ver" ))
1466
+ .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].without[ ObjectNode ] (" ver" ))
1467
1467
checkFails(testData)
1468
1468
}
1469
1469
1470
1470
it(" Fails if attStmt.response is a text value." ) {
1471
1471
val testData = defaultTestData
1472
- .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].set(" response" , jsonFactory.textNode(new ByteArray (attStmt.get(" response" ).binaryValue()).getBase64Url)))
1472
+ .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].set[ ObjectNode ] (" response" , jsonFactory.textNode(new ByteArray (attStmt.get(" response" ).binaryValue()).getBase64Url)))
1473
1473
checkFails(testData)
1474
1474
}
1475
1475
1476
1476
it(" Fails if attStmt.response is missing." ) {
1477
1477
val testData = defaultTestData
1478
- .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].without(" response" ))
1478
+ .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].without[ ObjectNode ] (" response" ))
1479
1479
checkFails(testData)
1480
1480
}
1481
1481
}
1482
1482
1483
1483
describe(" 2. Verify that response is a valid SafetyNet response of version ver." ) {
1484
1484
it(" Fails if there's a difference in the signature." ) {
1485
1485
val testData = defaultTestData
1486
- .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].set(" response" , jsonFactory.binaryNode(editByte(new ByteArray (attStmt.get(" response" ).binaryValue()), 2000 , b => ((b + 1 ) % 26 + 0x41 ).toByte).getBytes)))
1486
+ .updateAttestationObject(" attStmt" , attStmt => attStmt.asInstanceOf [ObjectNode ].set[ ObjectNode ] (" response" , jsonFactory.binaryNode(editByte(new ByteArray (attStmt.get(" response" ).binaryValue()), 2000 , b => ((b + 1 ) % 26 + 0x41 ).toByte).getBytes)))
1487
1487
1488
1488
val result : Try [Boolean ] = Try (verifier.verifyAttestationSignature(
1489
1489
new AttestationObject (testData.attestationObject),
0 commit comments