+
     hG  c                  s  a  0 t $ ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHtH	t	 ^RI
Ht ^RIHtHtHtHtHtHtHt ^RIHtHt ^RIHtHtHtHtHtHtHtHtH t H!t!H"t"H#t#H$t$ ^R	I%H&t&H't'H(t(H)t)H*t* ^R
I+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t>H?t?H@t@HAtAHBtBHCtCHDtDHEtE ]P                  ! ]G4      tHR]R]R]R]/tIR]JR&   R tK ! R R]4      tL ! R R])4      tMR# )    )annotationsN)Thread)AnySequence)AssertionResponse)&AuthenticatorExtensionsLargeBlobInputs'AuthenticatorExtensionsLargeBlobOutputs AuthenticatorExtensionsPRFInputs!AuthenticatorExtensionsPRFOutputsCredentialPropertiesOutputHMACGetSecretInputHMACGetSecretOutput)_JsonDataObjectwebsafe_decode)AttestationConveyancePreferenceAttestationObject%AuthenticationExtensionsClientOutputsAuthenticatorAttachment AuthenticatorAttestationResponseAuthenticatorDataAuthenticatorSelectionCriteria"PublicKeyCredentialCreationOptions!PublicKeyCredentialRequestOptionsPublicKeyCredentialTypeRegistrationResponseResidentKeyRequirement_as_cbor)AssertionSelectionClientDataCollectorClientErrorWebAuthnClient
_cbor_list)BOOLGUIDWEBAUTHNWEBAUTHN_API_VERSIONWebAuthNAssertion'WebAuthNAttestationConveyancePreferenceWebAuthNAuthenticatorAttachmentWebAuthNClientData WebAuthNCoseCredentialParametersWebAuthNCredBlobExtensionWebAuthNCredentialAttestationWebAuthNCredProtectExtensionInWebAuthNCredWithHmacSecretSaltWebAuthNEnterpriseAttestationWebAuthNExtensionWebAuthNGetAssertionOptionsWebAuthNHmacSecretSaltWebAuthNHmacSecretSaltValuesWebAuthNLargeBlobOperationWebAuthNLargeBlobSupportWebAuthNMakeCredentialOptionsWebAuthNRpEntityInformationWebAuthNUserEntityInformationWebAuthNUserVerification#WebAuthNUserVerificationRequirementwindllhmacGetSecretprf	largeBlob	credPropsz dict[str, type[_JsonDataObject]]_extension_output_typesc                sT    V \         9   d   \         V ,          P                  V4      # V# N)r?   	from_dict)Zkeyvalues   &&9/usr/lib/python3.14/site-packages/fido2/client/windows.py	_wrap_extrD   k   s&    
%%&s+55e<<L    c                  s4   a  ] tR t^qtV 3R ltR tR tRtV ;t# )CancelThreadc                	s   < \         SV `  4        R V n        RV n        Wn        \        4       V n        \        P                  ! \        P                  ! V P                  4      4       R# )TFN)Zsuper__init__daemon
_completedeventr"   guidr#   ZWebAuthNGetCancellationIdctypesbyref)selfrJ   	__class__s   &&rC   rG   ZCancelThread.__init__r   sE    
F	**6<<		+BCrE   c                	s    V P                   P                  4        V P                  '       g7   \        P                  ! \
        P                  ! V P                  4      4       R # R # r@   )rJ   ZwaitrI   r#   ZWebAuthNCancelCurrentOperationrL   rM   rK   rN      &rC   runZCancelThread.runz   s9    

33FLL4KL rE   c                	sh    R V n         V P                  P                  4        V P                  4        R# )TN)rI   rJ   ZsetZjoinrP   rQ   rC   completeZCancelThread.complete   s     

		rE   )rI   rH   rJ   rK   )	__name__
__module____qualname____firstlineno__rG   rR   rS   __static_attributes__Z__classcell__)rO      @rC   rF   rF   q   s    DM
 rE   rF   c                  sT    ] tR t^tRtR
R R llt]R R l4       tRR ltRR lt	R	t
R# )WindowsClienta  Fido2Client-like class using the Windows WebAuthn API.

Note: This class only works on Windows 10 19H1 or later. This is also when Windows
started restricting access to FIDO devices, causing the standard client classes to
require admin priveleges to run (unlike this one).

:param str origin: The origin to use.
:param verify: Function to verify an RP ID for a given origin.
:param ctypes.wintypes.HWND handle: (optional) Window reference to use.
Nc                   V ^8  d   QhRR/# )   client_data_collectorr    Zformat   "rC   __annotate__WindowsClient.__annotate__   s     @ @2@rE   c                	s    T;'       g    \         P                  P                  4       V n        Wn        W0n        R V n        R # r@   )r:   Zuser32ZGetForegroundWindowhandle_client_data_collector_allow_hmac_secret_enterprise_rpid_list)rN   r]   rc   Zallow_hmac_secrets   &&&&rC   rG   ZWindowsClient.__init__   s7     CC A A C&;#"3 <@"rE   c               r[   )r\   Zreturnboolr^   r_   r`   rC   ra   rb      s     ( ($ (rE   c                 	s    \         ^ 8  # )r    )r$   r^   rE   rC   is_availableZWindowsClient.is_available   s    #a''rE   c                s>   \         P                  ! V4      pV P                  P                  V4      w  r4\        P                  RV 24       VP                  ;'       g    \        4       pVP                  ;'       g    \        P                  p\        P                  pVP                  \        P                  8X  df   \         P"                  pV P$                  e7   VP&                  P(                  V P$                  9   d   \        P*                  pM;\        P,                  pM*\         P.                  ! VP                  ;'       g    R4      p. p	\0        P                  p
RpVP2                  '       Ed   RVP2                  9   de   V	P5                  \7        R\9        \:        P.                  ! VP2                  R,          4      VP2                  P=                  RR4      4      4      4       RVP2                  9   d6   V	P5                  \7        R\?        VP2                  R,          4      4      4       R	VP2                  9   d8   \0        P.                  ! VP2                  R	,          P=                  R
R4      4      p
VP2                  P=                  RR4      '       d%   V	P5                  \7        R\A        R4      4      4       RVP2                  9   d(   RpV	P5                  \7        R\A        R4      4      4       MGRVP2                  9   d7   V PB                  '       d%   V	P5                  \7        R\A        R4      4      4       V'       d   \E        V4      pVPG                  4        MRp\H        PJ                  ! \L        4      ! 4       p \N        PP                  ! V PR                  \H        PT                  ! \W        \Y        VP&                  4      4      4      \H        PT                  ! \[        \Y        VP\                  4      4      4      \H        PT                  ! \_        \a        VPb                  4      4      4      \H        PT                  ! \e        V4      4      \H        PT                  ! \g        VPh                  ;'       g    ^ V\        Pj                  8H  \l        P.                  ! VPn                  ;'       g    R4      \p        P.                  ! VPr                  ;'       g    R4      T\a        VPt                  4      ;'       g    . V'       d   VPv                  MRVV
V\        Px                  8H  VV	4      4      \H        PT                  ! V4      4       T'       d   TP                  4        TP                  p\        TP                  4      p/ pTP2                  '       d   TP                  P2                  ;'       g    / pTP2                  P=                  R4      '       d   R\        TP                  4      /TR&   RT9   d$   T'       d   RTR,          /TR&   MTR,          TR&   R	TP2                  9   d   R\        TP                  4      /TR	&   \        P                  R4       TP                  P                  p\        TP                  \        TTR7      \        P                  \        TP                  4        UUu/ uF  w  ppT\        TT4      bK  	  upp4      \        P                  R7      #   \z         d%   p\|        P~                  P                  T4      hRp?ii ; iu uppi )zCreate a credential using Windows WebAuthN APIs.

:param options: PublicKeyCredentialCreationOptions data.
:param threading.Event event: (optional) Signal to abort the operation.
z%Register a new credential for RP ID: NZnoneFZcredentialProtectionPolicyZcredProtectZ!enforceCredentialProtectionPolicycredBlobr=   ZsupportZminPinLengthTr<   zhmac-secretZhmacCreateSecretZanydiscouragedr>   ZrkZenabledZ	supportedzNew credential registered)client_dataattestation_object)Zraw_idZresponseauthenticator_attachmentZclient_extension_resultstype)Ur   rA   rd   collect_client_dataloggerdebugZauthenticator_selectionr   resident_keyr   ZDISCOURAGEDr.   NONEattestationr   Z
ENTERPRISEr&   ANYrf   ZrpidZPLATFORM_MANAGEDZVENDOR_FACILITATEDfrom_stringr4   
extensionsappendr/   r,   r8   getr*   r!   re   rF   startrL   POINTERr+   r#   Z#WebAuthNAuthenticatorMakeCredentialrc   rM   r6   r   r7   userr)   r    Zpub_key_cred_paramsr(   r5   timeoutZREQUIREDr'   rm   r9   user_verificationZexclude_credentialsrK   Z	PREFERREDOSErrorr   ERROTHER_ERRORrS   contentsr   rl   	auth_datarg   ZbResidentKeyZbLargeBlobSupportedZinfoZcredential_datar   Zcredential_idr   r   CROSS_PLATFORMr   itemsrD   r   Z
PUBLIC_KEY)rN   optionsrJ   rk   rp_idZ	selectionrr   Zenterprise_attestationrt   win_extensionsZlarge_blob_supportZ
enable_prftimerZattestation_pointereobjZatt_objextension_outputsZextensions_out
credentialkvs   &&&                   rC   make_credentialZWindowsClient.make_credential   s    5>>wG "88LLWU<UGDE33WW7U7W	 --SS1G1S1S!>!C!C"A"L"LLAEEK))5::==D$>$>>5FF + 2DD ' BMM##--vK 5::
+w/A/AA%%%%64@@ ' 2 23O P $..22 CU	
 W///%%%"1'2D2DZ2PQ g000%=%I%I&&{377	6J&" !!%%nd;;%%&7T
&ST***!
%%&7tDz&RS#w'9'99d>U>U>U%%&7tDz&RS 'EKKME$nn-JKM"	1888'**9MNO:8GLL;QRS4"7#>#>?
 /<=1,,1$(>(G(GG7CC%>>GG% <GG%77HH= $"7#>#>?EE2&+

.*$(>(H(HH"&!( 01=F NN!**#C$:$:;$..99??RN!!%%k2226S=M=M8N1O!+..!>-#@0%e, =K%=%&89 g000c&=&=!>2!+. 	/0&&66
 $++5'G &=%K%K%J0A0G0G0IJ0I1IaO#0IJ& )33

 
	
E  	1//--a00	1R Ks8   D*[' ,([' "[' 8	[' A[' 2\'\2\\c                s   \         P                  ! V4      pV P                  P                  V4      w  r4\        P                  RV 24       \        P                  pVP                  ;'       g    .  F7  pT;R8X  d    \        P                  pMR8X  d   \        P                  pM K7   M	  ^ pRp\        P                  p	Rp
. pRp\        R4      pVP                  '       Ed`   VP                  P                  R4      '       d   VP                  R,          pVP                  P                  R4      '       d%   VP!                  \#        R\        R	4      4      4       \$        P                  ! VP                  P                  R
4      4      pV'       d@   VP&                  '       d   \        P(                  p	MVP*                  p\        P,                  p	\.        P                  ! VP                  P                  R4      4      pV'       d   VP0                  ;'       g    / p\3        VP4                  '       d5   \7        VP4                  P8                  VP4                  P:                  4      MRVP=                  4        UUu. uF9  w  pp\?        \A        V4      \7        VP8                  VP:                  4      4      NK;  	  upp4      p
M|RVP                  9   dl   V PB                  '       dZ   VR,          p\D        P                  ! VP                  R,          4      p\3        \7        VPF                  VPH                  4      4      p
V'       d   \K        V4      pVPM                  4        MRp\N        PP                  ! \R        4      ! 4       p \T        PV                  ! V PX                  VPZ                  \N        P\                  ! \_        V4      4      \N        P\                  ! \a        VPb                  ;'       g    ^ T\d        Pf                  ! VPh                  ;'       g    R4      \k        VPl                  4      ;'       g    . V'       d   VPn                  MRV	VV
VVVV4      4      \N        P\                  ! V4      4       T'       d   TPy                  4        TPz                  p\}        TP~                  4      p/ pT'       d*   TP                  ^8  d   \        TP                  4      TR&   TP                  '       Ed   T
'       d   TP                  ^8  d   TP                  Pz                  pRTP                  9   d8   RTP8                  /pTP:                  '       d   TP:                  TR&   RT/TR&   M4RTP8                  /pTP:                  '       d   TP:                  TR&   TTR&   TP                  ^ 8w  dP   TP                  R
,          P                  RR4      '       d   RTP                  /TR
&   MRTP                  ^8H  /TR
&   RTP                  P                  RTP                  P                  /p\        T\        TTTP                  TP                  '       d   RTP                  /MRR7      .TP=                  4        UUu/ uF  w  ppT\        TT4      bK  	  upp4      # u uppi   \p         d%   p\r        Pt                  Pw                  T4      hRp?ii ; iu uppi )zGet assertion using Windows WebAuthN APIs.

:param options: PublicKeyCredentialRequestOptions data.
:param threading.Event event: (optional) Signal to abort the operation.
zAssert a credential for RP ID: zsecurity-keyzclient-deviceNFZappidZgetCredBlobri   Tr=   r<   r;   i   rj   firstsecondZresultsZoutput1Zoutput2readZblobZwrittenrn   rv   )r   r   	signaturer}   )Nr   rA   rd   ro   rp   rq   r'   ru   Zhintsr   ZPLATFORMr3   rs   r!   rx   rz   ry   r/   r   r   ZGETZwriteZSETr   Zeval_by_credentialr2   Zevalr1   r   r   r   r-   r   re   r   Zsalt1Zsalt2rF   r{   rL   r|   r%   r#   Z!WebAuthNAuthenticatorGetAssertionrc   r   rM   r(   r0   r~   r9   rw   r   r    Zallow_credentialsrK   r   r   r   r   rS   r   r   r   Z	dwVersionrg   rB   ZpHmacSecretZdwCredLargeBlobStatusZcred_large_blobZ
CredentialZpwszCredentialTyperv   r   r   r   Zuser_idrD   )rN   r   rJ   rk   r   Z
attachmentZhintZflagsZ
large_blobZlarge_blob_operationZhmac_secret_saltsr   Z	u2f_appidZu2f_appid_usedZlg_blobr<   Z
cred_saltsZcred_idZsaltsr   Zassertion_pointerr   r   r   r   ZsecretZresultr   r   r   s   &&&                           rC   get_assertionZWindowsClient.get_assertionA  s    4==gF "88LLWU6ug>?488
MM''R'D#!@!O!OJ$!@!I!IJ ( 
9>> 	e!!%%g..#..w7	!!%%m44%%&7
DJ&OP<FF""&&{3G <<<+E+I+I(!(J+E+I+I(2<<""&&u-C  3399r
$@ 888 /sxx~~sxxO! /9.>.>.@
 /ANGU	 7*7325;;M /A%! !G$6$664;R;R;R#*44&&7 %A*5;;D%!  'EKKME"NN+<=?	166/<=/,,1";GG#55FF #7#<#<=CC&+

,")&!&$ ./-6 NN((%cmm4	,.!+)-n.B.B)Cg& S]]a%711G...%v||4F}}}+1==x(096/B%e,'6F}}},2MMy)9?%o6((A-%%k266vuEE6<c>Q>Q5R%k2 "3#<#<#A6%k2
 CNN55#..##

 "!)'!mm03$,	 ->,C,C,EF,EDAqQ	!Q,EF
 	
sb  	1//--a00	1d Gs=    ?Z)
A+Z/ 6%Z/ !Z/ >	Z/ 6Z/ [!/[:[[)re   rd   rf   rc   )NFr@   )rT   rU   rV   rW   Z__doc__rG   Zstaticmethodrh   r   r   rX   r^   rE   rC   rZ   rZ      s4    	@ ( (\
|\
 \
rE   rZ   )N__conditional_annotations__Z
__future__r   rL   ZloggingZ	threadingr   Ztypingr   r   Zctap2r   Zctap2.extensionsr   r   r   r	   r
   r   r   Zutilsr   r   Zwebauthnr   r   r   r   r   r   r   r   r   r   r   r   r   Z r   r   r   r   r    Zwin_apir!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   Z	getLoggerrT   rp   r?   Z__annotations__rD   rF   rZ   )r   rY   rC   <module>r      s   8 # "      %   4          : 
		8	$ (	,8+	= 9 6 (X
N X
rE   