@@ -543,13 +543,13 @@ def make_credential(self, ctap, options, pin_protocol):
543543@dataclass (eq = False , frozen = True )
544544class _SignGenerateKeyInputs (_JsonDataObject ):
545545 algorithms : Sequence [int ]
546- ph_data : bytes | None = None
546+ tbs : bytes | None = None
547547
548548
549549@dataclass (eq = False , frozen = True )
550550class _SignSignInputs (_JsonDataObject ):
551- ph_data : bytes
552551 key_handle_by_credential : Mapping [str , bytes ]
552+ tbs : bytes
553553
554554
555555@dataclass (eq = False , frozen = True )
@@ -561,7 +561,8 @@ class _SignInputs(_JsonDataObject):
561561@dataclass (eq = False , frozen = True )
562562class _SignGeneratedKey (_JsonDataObject ):
563563 public_key : bytes
564- key_handle : bytes
564+ algorithm : int
565+ attestation_object : bytes
565566
566567
567568@dataclass (eq = False , frozen = True )
@@ -604,8 +605,8 @@ def prepare_inputs(self, pin_token):
604605 )
605606 outputs = {3 : gk .algorithms , 4 : flags }
606607
607- if gk .ph_data :
608- outputs [0 ] = gk .ph_data
608+ if gk .tbs :
609+ outputs [6 ] = gk .tbs
609610
610611 return {SignExtension .NAME : outputs }
611612
@@ -614,8 +615,11 @@ def prepare_outputs(self, response, pin_token):
614615 data = extensions .get (SignExtension .NAME )
615616 if not data :
616617 return None
618+ att_obj_bytes = response .unsigned_extension_outputs [SignExtension .NAME ][
619+ 7
620+ ]
617621 att_obj = AttestationResponse .from_dict (
618- cbor .decode (data [ 7 ] ) # type: ignore
622+ cbor .decode (att_obj_bytes ) # type: ignore
619623 )
620624 cred_data = att_obj .auth_data .credential_data
621625 assert cred_data is not None # nosec
@@ -625,7 +629,8 @@ def prepare_outputs(self, response, pin_token):
625629 SignExtension .NAME : _SignOutputs (
626630 generated_key = _SignGeneratedKey (
627631 public_key = cbor .encode (pk ),
628- key_handle = cbor .encode (pk .get_ref ()),
632+ algorithm = data .get (3 ),
633+ attestation_object = att_obj_bytes ,
629634 ),
630635 signature = data .get (6 ),
631636 )
@@ -658,8 +663,8 @@ def prepare_inputs(self, selected, pin_token):
658663
659664 return {
660665 SignExtension .NAME : {
661- 0 : sign . ph_data ,
662- 5 : [ kh ] ,
666+ 5 : kh ,
667+ 6 : sign . tbs ,
663668 }
664669 }
665670
0 commit comments