+
    :i  c                   s   ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt ^ RI H!t! ^ RI"H#t#H$t$ ^ RI%H&t& ^RI'H(t) ^RI*H+t+H,t, ^RI-H.t. ^RI/H0t0 ^RI1H2t3 ^RI1H4t4 ^RI5H6t6 ^RI7H8t8 R t9R t:R t;R t<R t=R t>R  t?R! t@R" tAR# tBR# )$i    N)asdict)datetime)Any)	CtapError)	ClientPinCtap2)Tlv_override_version)FidoConnection)OtpConnection)SmartCardConnection)HsmAuthSession)RELEASE_TYPEManagementSession)OathSession)OpenPgpSession)
PivSession)get_name	read_info)YubiOtpSession)__version__)list_ctap_deviceslist_otp_devices)get_hsmauth_info)get_openpgp_info)list_devices)list_readers)get_piv_info)get_windows_versionc                  s   R \         R\        P                  R\        P                  R\        P                  ! 4       R\
        P                  ! 4       P                  R4      /p \        P                  R8X  dO   V P                  R\        \        P                  P                  P                  4       4      R\        4       /4       V # \        P                   ! 4       ^ 8H  V R&   V # )	ZykmanZPythonZPlatformZArchzSystem datez%Y-%m-%dZwin32zRunning as adminzWindows version)ykman_versionsysversionplatformZmachiner   ZtodayZstrftimeZupdateZboolctypesZwindllZshell32ZIsUserAnAdminr   osZgetuid)infos    6/usr/lib/python3.14/site-packages/ykman/diagnostics.pysys_infor%   "   s    #++CLL  "x~~'00<D ||w"D)>)>)L)L)N$O!#6#8	
 K $&99;!#3 K    c           	      s   . p \        V4      pVP                  P                  4       R ,          p\        P                  ! V4      P                  ^4      R8X  d)   WCP                  P                  ^4      R ,          ,          pVP                  RV/4        \        W4      pVP                  P                  \        P                  8w  d    \        VP                  P                  4       VP                  R\        V4      R\!        W`P"                  4      /4       V#   \         d    pTP                  RT: 24        Rp?LRp?ii ; i  \         d!   pTP                  RT: 24        Rp?T# Rp?ii ; i):i   NNs   zRaw Infoz+Failed to read device info via Management: NZ
DeviceInfoZNamezFailed to read device info: )r   ZbackendZread_configr   Z
parse_dictgetappend	Exceptionr   Zversion_qualifierZtyper   ZFINALr   r   r    r   Zyubikey_type)pidconnZdataZmZraw_infoer#   s   &&     r$   	mgmt_infor-   9   sB   DId#99((*2.>>(#''-6		--a044HH	
:#!!&&,*<*<<d44<<=fTl'7'78	
 K%  IA!GHHI  :21%899K:s1   BD BE	 E'EE	E4E//E4c                 l     \        V 4      p\        V4      #   \         d   pR T: 2u Rp?# Rp?ii ; i)zPIV not accessible N)r   r   r)   )r+   pivr,      &  r$   piv_infor1   Z   s9    +C   +$QE**+    3.33c                 r.   )zOpenPGP not accessible N)r   r   r)   )r+   openpgpr,   r0   r$   openpgp_infor4   b   s9    / &(( /(../r2   c                 s     \        V 4      pR RP                  R VP                   4       4      RVP                  /#   \         d   pRT: 2u Rp?# Rp?ii ; i)zOath versionZ.c              3   s4   "   T F  pR V,          x  K  	  R# 5i)z%dN )Z.0Zds   & r$   Z	<genexpr>Zoath_info.<locals>.<genexpr>n   s     $D|!TAXX|s   zPassword protectedzOATH not accessible N)r   Zjoinr   Zlockedr)   )r+   Zoathr,   r0   r$   	oath_infor6   j   s[    ,4 CHH$Dt||$DD $++
 	
  ,%aU++,s   := AAAAc                 r.   )zYubiHSM Auth not accessible N)r   r   r)   )r+   hsmauthr,   r0   r$   hsmauth_infor8   u   s9    4 &(( 4-aU334r2   c                  s    / p \        4        Ff  p VP                  4       pVP                  4        VP                  4        \	        VR 4      '       d   VP                  4        RpW0VP                  &   Kh  	  / p\        4        Fr  p VP                  \        4      ;_uu_ 4       pR\        VP                  V4      R\        V4      R\!        V4      R\#        V4      R	\%        V4      /WV: &   RRR4       Kt  	  RV RV/#   \         d%   pRTP                  P                   R2p Rp?LRp?ii ; i  + '       g   i     K  ; i  \         d   pR
T: 2YV: &    Rp?K  Rp?ii ; i  \         d   pRT: 2u Rp?# Rp?ii ; i)releaseZSuccessZ<Z>N
ManagementZPIVZOATHZOpenPGPzYubiHSM AuthzPC/SC connection failure: zDetected PC/SC readerszDetected YubiKeys over PC/SCzPC/SC failure: )r   ZcreateConnectionZconnectZ
disconnectZhasattrr9   r)   Z	__class__Z__name__Znamelist_ccid_devicesopen_connectionr
   r-   r*   r1   r6   r4   r8   )ZreadersZreaderZcZresultr,   yubikeysdevr+   s           r$   	ccid_infor?   }   sm   !'"nF5++-		1i((IIK" $*FKK  % $&$&C
J(()<==$i&>x~	$!<#5&T(:,Hw( >= ' %g*H
 	
%  5Q[[112!45 >==  J)CA5'I7$J  ' &&'s   E) AD &!E) E%A	D2.E6	E)  D/D*%E) *D//E) 2E=EE) EE&
E!E) !E&&E) )F4E?9F?Fc            
      sF    / p \        4        F  p . pVP                  \        4      ;_uu_ 4       pVP                  R \	        VP
                  V4      /4       \        V4      p VP                  4       pVP                  RV ./4       RRR4       W V: &   K  	  RV /#   \         d"   pTP                  RRT: 2/4        Rp?L=Rp?ii ; i  + '       g   i     LM; i  \         d   pRT: 2Y: &    Rp?K  Rp?ii ; i  \         d   pRT: 2u Rp?# Rp?ii ; i)r:   ZOTPzCouldn't read OTP state: NzOTP connection failure: zDetected YubiKeys over HID OTPzHID OTP backend failure: )
r   r<   r	   r(   r-   r*   r   Zget_config_state
ValueErrorr)   )r=   r>   dev_infor+   ZotpZconfigr,   s          r$   otp_inforB      s*   1#%#%CH((774OO()CGGT*B
 ).CT!$!5!5!7 F8(>? 8 (0C7$ &( -h
 	
 & T 2KA50Q(RSST 87  H)A!'G7$H  1*1%001s   D C"3C%%B 
C"D  C	+C	CC	CCC""D-
C=7D =DD D DD D c                  s    / p \        4        EFT  p . pVP                  \        4      ;_uu_ 4       pVP                  R RVP                  ,          RVP
                  RVP                  R\        VP                  V4      /4        \        V4      pR\        VP                  4      /pVP                  P                  P                  R4      '       dl   \        V4      pVP                  4       VR&   VP                  P                  P                  R4      pV'       d   VP!                  4       VR	&   MVR
J d   RVR&   MRVR&   VP                  V4       RRR4       W V: &   EKW  	  RV /#   \"        \$        3 d    pTP                  RT: 24        Rp?LBRp?ii ; i  + '       g   i     LR; i  \&         d   pRT: 2Y: &    Rp?EK  Rp?ii ; i  \&         d   pRT: 2u Rp?# Rp?ii ; i)zCTAP device versionz%d.%d.%dzCTAPHID protocol versionZCapabilitiesr:   Z	Ctap2InfoZ	clientPinzPIN retriesZ	bioEnrollzFingerprint retriesFzNot configuredZFingerprintsZPINzCouldn't get CTAP2 info: NzFIDO connection failure: zDetected YubiKeys over HID FIDOzHID FIDO backend failure: )r   r<   r   r(   Zdevice_versionr   Zcapabilitiesr-   r*   r   r    r#   Zoptionsr'   r   Zget_pin_retriesZget_uv_retriesr@   r   r)   )	r=   r>   rA   r+   Zctap2Z	ctap_dataZ
client_pinZ
bio_enrollr,   s	            r$   	fido_inforC      s   )2#%$&C I&(((88DOO1:@S@S3S6*D,=,=()CGGT*B	K %d5@&BT4U	 ::--11+>>)25)9J7A7Q7Q7SIm4).););)?)?)LJ)$.$=$=$? !**? @ ",u!4<L	. 9/?Ie, 	23 98 (0C7$? 'F .x
 	
 '	2 K *CA5(IJJK5 98:  I)B1%'H7$$I  2+A5112s   G F1AFCE+F1"G +F	<F	FF	FF.)F11G<
GG GG G0 G+%G0+G0c                 sP    \        4       \        4       \        4       \        4       R.# )zIRuns diagnostics.

The result of this can be printed using pretty_print.
zEnd of diagnostics)r%   r?   rB   rC   r5   r&   r$   get_diagnosticsrD      s%     	

 r&   )Cr!   r"   r    r   Zdataclassesr    r   Ztypingr   Z
fido2.ctapr   Zfido2.ctap2r   r   Zyubikit.corer   r   Zyubikit.core.fidor   Zyubikit.core.otpr	   Zyubikit.core.smartcardr
   Zyubikit.hsmauthr   Zyubikit.managementr   r   Zyubikit.oathr   Zyubikit.openpgpr   Zyubikit.pivr   Zyubikit.supportr   r   Zyubikit.yubiotpr   Z r   r   Zhidr   r   r7   r   r3   r   Zpcscr   r;   r   r/   r   Zutilr   r%   r-   r1   r4   r6   r8   r?   rB   rC   rD   r5   r&   r$   <module>rE      s     	  
      ( / , * 6 * > $ * " / * * 4 % % 3   %.B+/,4"'J1:*2Zr&   