+
    :i>  c                   sv   ^ RI 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 ^RIHt ^RIHtHtHt ^RIHtHtHtHtHtHtHtHtHt ^RIHt ] P>                  ! ] 4      t!]"PG                  R	4      t$]PJ                  ]PL                  3]$]PL                  3]PN                  ]PN                  3]PP                  ]PP                  3]PR                  ]PR                  33t*]PV                  ]PR                  ,          ]PN                  ,          ]PP                  ,          t,R
 t-R t.R t/RR R llt0R t1R t2R R lt3R# )    N)replace)PID	TRANSPORTYUBIKEYApplicationNotAvailableError
ConnectionNotSupportedErrorVersion)FidoConnection)OtpConnection)AIDSmartCardConnectionSmartCardProtocol)	
CAPABILITYDEVICE_FLAGFORM_FACTORUSB_INTERFACEDeviceConfig
DeviceInfoManagementSessionModeVersionQualifier)YubiOtpSessionZa0000005271002c                 st   R p \        V 4      pVP                  p VP                  4       #   \         d;    TP                  ^8X  d'   \
        P                  R4       T P                  R4        M*i ; i  \         d    \
        P                  R4        Mi ; i\        ^ 4      pR p \        T 4      pTf   TP                  p TP                  4       pM(  \         d    \
        P                  RRR7        Mi ; iT\        P                  ,          pM&  \         d    \
        P                  R4        Mi ; iTf#   \
        P                  R4       \        ^^ ^ 4      p\
        P                  R	4       \        T 4      p\          F  w  r TP#                  T	4       YZ,          p\
        P                  R
Y4       K7    \         d    \
        P                  RY4        K[  \         d    \
        P%                  RYRR7        K  i ; i	  T'       g   T'       g   \'        R4      h\(        P*                  T9   g   TR8  d   T\        P,                  ,          p\/        \1        / ^ ^ \3        ^ 4      R7      TT\4        P6                  \8        P:                  T\8        P<                  T/R\?        T4      R7      # )Nz Send NEO de-select workaround...s    z4Couldn't select Management application, use fallbackz)Unable to read serial over OTP, no serialT)Zexc_infoz/Couldn't select OTP application, serial unknownz3Firmware version unknown, using 3.0.0 as a baselinez"Scan for available applications...z%Found applet: aid: %s, capability: %sz'Missing applet: aid: %s, capability: %sz'Error selecting aid: %s, capability: %sz$Device does not seem to be a YubiKeyenabled_capabilitiesZauto_eject_timeoutZchallenge_response_timeoutZdevice_flagsFconfigserialversionform_factorsupported_capabilitiesZ	is_lockedZversion_qualifier   r!   r    ) r   r   read_device_infor   ZmajorloggerdebugZsend_and_receiver   r   r   
get_serial	ExceptionOTPr   r   _SCAN_APPLETSselectZwarning
ValueErrorr   FIDOU2Fr   r   r   r   UNKNOWNr   USBNFCr   )connkey_type
interfacesr   mgmtcapabilitiesr   otpprotocolZaidZcodes   &&&        4/usr/lib/python3.14/site-packages/yubikit/support.py_read_info_ccidr8   N   s]   "GM &,,	;((**  	;}}!?@%%&9:		;
 ( MKLM a=L FHT"?kkG	U^^%F 	ULLDtLT	U 	
&' HFGH JK!Q" LL56 &H"			OOC  LLL@#L+ 	OLLBCN 	NN93t  	 # ?@@ Z'7i+?
&!# '($Q	
 ''MM<MM< 
 *73 s   A4 , AA1.A4 0A11A4 4 BB(D C D "C:7D 9C::D  D87D8/F>>!H"H+HHc                 s2    \        V 4      pVP                  4       #   \        \        3 d    \        P                  R 4        Mi ; i\        T 4      pTP                  4       pTP                  pT\        P                  8X  d]   \        p\        P                  T9   g   TR8  d   T\        P                  ,          p\         P"                  T\         P$                  T/pMkT\        P&                  8X  d7   \         P"                  \        P(                  \        P                  ,          /pM \         P"                  \        P(                  /p\+        \-        / ^ ^ \/        ^ 4      R7      TT\0        P2                  TP5                  4       R\7        T4      R7      # );Unable to get info via Management application, use fallbackr   Fr   r    )r   r"   r   r   r#   r$   r   r%   r   r   NEO_BASE_NEO_APPSr   r+   r   r,   r   r.   r/   YKPr'   r   r   r   r   r-   Zcopyr   )	r0   r1   r2   r3   r5   r   r   usb_supportedr4   s	   &&&      r7   _read_info_otpr>      sC   T &$$&&(*;< TRST 
C^^FkkG7;;&+w)/CZ^^+MMM=MM=
 
W[[	 MM:>>JNN:

 MM:>>
 !# '($Q	
 ''+002*73 s    &AAc                 sn    \        V 4      pVP                  4       #   \         Ed    \        P	                  R 4       T\
        P                  8X  d   \        ^^ ^ 4      pM\        ^^ ^ 4      p\        P                  \        P                  /pT\
        P                  8X  dP   T\        P                  ;;,          \        ,          uu&   T\        P                  ,          T\        P                  &   \        \!        / ^ ^ \#        ^ 4      R7      RT\$        P&                  TR\)        T4      R7      u # i ; i)r9   r   NFr   )r   r"   r&   r#   r$   r   r<   r   r   r.   r   r,   r:   r;   r/   r   r   r   r   USB_A_KEYCHAINr   )r0   r1   r2   r3   r   Zsupported_appss   &&&   r7   _read_info_ctapr@      s    
 &$$&& 
RS w{{"aA&GaA&G#--8w{{"9==)^;),:9==,IN9==)%'#$+,(^	 #22#1.w7
 	

s    DD43D4c                J    V ^8  d   QhR\         R\        R,          R\        /# )   r0   pidNreturn)r   r   r   Zformat   "r7   __annotate__rG      s*     e eJ eS4Z e: e    c                s
   \         P                  R\        V 4      P                   24       V'       d   VP                  pVP
                  pM\        V \        4      '       d   V P                  \        P                  8X  d   Rp\        ^ 4      p\        V 4      p VP                  \        P                  4      pV^ ,          ^8X  d8   \!        V4      ^8  d(   \"        P$                  ! V^,          4      P&                  pM\+        R4      h\        V \        4      '       d   \-        WV4      pMQ\        V \.        4      '       d   \1        WV4      pM.\        V \2        4      '       d   \5        WV4      pM\7        R4      h\         P                  RV4       VP9                  \        P:                  4      '       Ed   \        P:                  VP<                  P>                  9  Ed   VP@                  \        P:                  ,          pV\B        P                  \B        PD                  ,          \        PF                  ,          8X  d;   \        P:                  \B        P                  \B        PD                  ,          /Vn         \        P                  V9  d   V\B        P                  ( ,          p\        PH                  V9  d.   V\B        PD                  \B        PJ                  ,          ( ,          p\        PF                  V9  dX   V\        PF                  \B        PL                  ,          \B        PN                  ,          \B        PP                  ,          ( ,          pWvP<                  P>                  \        P:                  &   V\R        PT                  8X  d   RVn+        R	VPX                  u;8:  d   R
8  d   M MRVn-        VP9                  \        P                  4      '       Ed4   \        P                  VP<                  P>                  9  dG   VP@                  \        P                  ,          VP<                  P>                  \        P                  &   VP\                  \^        P`                  \^        Pb                  \^        Pd                  39   g0   VP\                  \^        Pf                  J di   VPX                  R8  dX   \i        VP@                  4      pV\        P                   \k        WhR7       VP<                  P>                  \        P                   \         P                  RV4       V#   \(         d     EL3i ; i)a  Reads out DeviceInfo from a YubiKey, or attempts to synthesize the data.

Reading DeviceInfo from a ManagementSession is only supported for newer YubiKeys.
This function attempts to read that information, but will fall back to gathering the
data using other mechanisms if needed. It will also make adjustments to the data if
required, for example to "fix" known bad values.

The *pid* parameter must be provided whenever the YubiKey is connected via USB.

:param conn: A connection to a YubiKey.
:param pid: The USB Product ID.
z&Attempting to read device info, using Nz,PID must be provided for non-NFC connectionszInvalid connection typezRead info: %sT)r   zDevice info, after tweaks: %s)   rI   r    )rI      r    )rJ   rB   rI   )6r#   r$   Ztype__name__Zyubikey_typeZusb_interfacesZ
isinstancer   Z	transportr   r/   r   r   r)   r   r'   Zlenr   Z	from_coder2   r   r*   r8   r
   r>   r	   r@   Z	TypeErrorhas_transportr.   r   r   r   r   r,   ZCCIDr+   FIDO2OATHOPENPGPPIVr   SKYis_skyr   is_fipsr   r   
USB_A_NANO
USB_C_NANOUSB_C_LIGHTNINGUSB_C_KEYCHAINZdictr   )	r0   rC   r1   r2   r6   ZrespinfoZusb_enabledZ	supported	   &&       r7   	read_inforZ      s    LL9$t*:M:M9NOP
#&#3#3''
	D-	.	.4>>Y]]3R"1%
$T*	??377+DAw!|D	A!^^DG4??
 GHH$+,,tz:	D-	(	(dj9	D.	)	)tz:122
LL$' 	9==))MM!A!AA11)--@:>>JNN:]=O=OOP z~~
>+D' J.JNN?*KZ/Z^^j.>.>>??KZ/""//"$$% ..! K ;F((7 7;; DLL,9, )--((== @ @@++IMM: KK,,Y]]; """"'' 
 

  : ::t||i?W T889I)--(D;00?
LL0$7KS , 		s   A$T0 0T?>T?c                 sb    V \         P                  \         P                  ,          ( ,          ^ 8H  # )r    )r   r,   rM   )r4   s   &r7   
_fido_onlyr[   T  s$    JNNZ-=-==>>!CCrH   c                 sJ    RpV F  w  r#Y u;8:  d   V8  g   K    R#  K  	  R# )rJ   TF)))rJ   r    r    rJ   i   r    ))rJ   rB   r    )rJ   rB   r!   ))rJ   rJ   r    )rJ   rJ   rB    )r   Z_PREVIEW_RANGESZstartZends   &   r7   _is_previewr^   X  s/    O
 &
!c! " & rH   c                rA   )rB   rX   r1   NrD   )r   r   ZstrrE   rF   r7   rG   rG   d  s*     _ _: _4 _C _rH   c                s	   V P                   \        P                  ,          pV'       g   V P                  ^ ,          ^8X  d   \        P
                  pMaV P                  fD   \        V4      '       d3   V P                  R8  d   \        P                  M\        P                  pM\        P                  pVP                  pV\        P                  8X  dA   \        P                  V9  d   RpV P                  \        P                  4      '       d   RpV# V\        P                  8X  Ed_   V P                  ^ ,          pV^8  d+   V P                  ^ ,          ^ 8X  d   RV P                   R2# R# V^8X  dE   V P                  '       d   RpM/V\        P                   \        P"                  ,          8X  d   RpMRp\%        V P                  4      '       d   R	pV# V P                  R8  Ed   V P&                  \(        P*                  \(        P,                  39   pV P.                  pV P&                  \(        P0                  \(        P,                  \(        P2                  39   pV P4                  '       d   R
.pMR.pV'       g   VP7                  R4       V'       d   VP7                  R4       M0V P&                  \(        P8                  8X  d   VP7                  R4       V'       d   VP7                  R4       MV P                  \        P                  4      '       d   VP7                  R4       MJV P&                  \(        P:                  8X  d   VP7                  R4       MV'       d   VP7                  R4       V P                  '       d   VP7                  R4       MV'       dK   \        V4      '       d   VP7                  R4       M\        P<                  V9   d   VP7                  R4       MkV P4                  '       d%   V P                  '       d   VP7                  R4       M5V P>                  '       d$   V P4                  '       g   VP7                  R4       RPA                  V4      PC                  RR4      PC                  RR4      pV# )zwDetermine the product name of a YubiKey

:param info: The device info.
:param key_type: The YubiKey hardware platform.
zFIDO U2F Security KeyzSecurity Key NFCz	YubiKey (Z)ZYubiKeyzYubiKey FIPS (4 Series)zYubiKey Edgez	YubiKey 4zYubiKey PreviewzSecurity KeyZ5ZCZCiZNanor/   ZAZBioZFIPSz- FIDO Editionz- Multi-protocol Editionz- Enterprise Editionz- Enhanced PINZ z5 CZ5Cz5 AZ5A)rJ   rB   i   r\   )"r   r   r.   r   r   r:   r   r[   rQ   ZYK4Zvaluer   rM   rL   r/   rS   r'   r,   r^   r   r   rT   rU   Z_is_biorW   Z	USB_C_BIOrR   ZappendrV   r?   rP   Zpin_complexityZjoinr   )	rX   r1   r=   Zdevice_nameZmajor_versionZis_nanoZis_bioZis_cZ
name_partsrY   r7   get_namer_   d  sV    //	>M <<?a{{H[[ Z%>%>&*llY&>w{{GKKH{{H ..K 7;;=01Kimm,,,KL K 
W[[	 Q1||A!#"4<<.22 a|||7*..:>>"AA,)t||$$+Kj i \\Y&&&&&&&+ G \\F##**&&%%( D {{{,-
'[
%%c* !!#&!![%@%@@!!$'!!&)##IMM22!!%(!![%?%??!!#&!!%( |||!!&)m,,%%&67^^}4%%&@A!!"89$$$T[[[!!"23 ((:.66udCKKESWXKrH   )N)4ZloggingZdataclassesr   Zcorer   r   r   r   r   r   r   Z	core.fidor	   Zcore.otpr
   Zcore.smartcardr   r   r   Z
managementr   r   r   r   r   r   r   r   r   Zyubiotpr   Z	getLoggerrK   r#   ZbytesZfromhexZ_AID_U2F_YUBICOr+   r,   rP   rO   rN   r(   r'   r;   r8   r>   r@   rZ   r[   r^   r_   r]   rH   r7   <module>r`      s  8     & # 

 
 
 $			8	$ -- 01 	XXz~~jnn%WWjnn[[*$$%XXz *//1JNNBZEWEWWL^*Z
DePD	_rH   