@@ -211,7 +211,7 @@ def test_extensions(self,):
211
211
assert "hmac-secret" in reg .auth_data .extensions
212
212
assert reg .auth_data .extensions ["hmac-secret" ] == True
213
213
214
- reg = self .testMC (
214
+ self .testMC (
215
215
"Send MC with fake extension set to true, expect SUCCESS" ,
216
216
cdh ,
217
217
rp ,
@@ -278,6 +278,10 @@ def get_salt_params(salts):
278
278
assert shannon_entropy (ext ["hmac-secret" ]) > 5.4
279
279
assert shannon_entropy (key ) > 5.4
280
280
281
+ with Test ("Check that the assertion is valid" ):
282
+ credential_data = AttestedCredentialData (reg .auth_data .credential_data )
283
+ auth .verify (cdh , credential_data .public_key )
284
+
281
285
salt_enc , salt_auth = get_salt_params ((salt3 ,))
282
286
283
287
auth = self .testGA (
@@ -743,6 +747,40 @@ def test_get_assertion(self,):
743
747
expectedError = CtapError .ERR .SUCCESS ,
744
748
)
745
749
750
+ with Test ("Check assertion is correct" ):
751
+ credential_data = AttestedCredentialData (prev_reg .auth_data .credential_data )
752
+ prev_auth .verify (cdh , credential_data .public_key )
753
+ assert (
754
+ prev_auth .credential ["id" ]
755
+ == prev_reg .auth_data .credential_data .credential_id
756
+ )
757
+
758
+ self .reboot ()
759
+
760
+ prev_auth = self .testGA (
761
+ "Send GA request after reboot, expect success" ,
762
+ rp ["id" ],
763
+ cdh ,
764
+ allow_list ,
765
+ expectedError = CtapError .ERR .SUCCESS ,
766
+ )
767
+
768
+ with Test ("Check assertion is correct" ):
769
+ credential_data = AttestedCredentialData (prev_reg .auth_data .credential_data )
770
+ prev_auth .verify (cdh , credential_data .public_key )
771
+ assert (
772
+ prev_auth .credential ["id" ]
773
+ == prev_reg .auth_data .credential_data .credential_id
774
+ )
775
+
776
+ prev_auth = self .testGA (
777
+ "Send GA request, expect success" ,
778
+ rp ["id" ],
779
+ cdh ,
780
+ allow_list ,
781
+ expectedError = CtapError .ERR .SUCCESS ,
782
+ )
783
+
746
784
with Test ("Test auth_data is 37 bytes" ):
747
785
assert len (prev_auth .auth_data ) == 37
748
786
0 commit comments