+
    HjP                     L   ^ RI t ^ RIt^ RIt^ RIt^ RI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 ^RIHt ]P$                  ! 4       ^ ,          t]! ]! ]]P/                  R4      4      4      t]R$8  d   ]! R]^ ,           R]^,           24      h]R%8  tR R lt]! R	R
4      t]! RR4      t]t]
t]t ]t!]t"]t#]t$]t%]t&]t']! ]&4      t(]t)]	t*]! ]%4      t+]! ]!4      t,]! ]"4      t-]! ]#4      t.]! ]$4      t/]t0]t1]! ]4      t2]! ]4      t3]! ]4      t4]t5]t6 ])],.]Pn                  n8        ]2]Pn                  n9        ]2.]Pt                  n8        ],]Pt                  n9        ]*].]Pv                  n8        ]-]Pv                  n9        ]4]..]Px                  n8        ]*]Px                  n9        ]4].]Pz                  n8        ]*]Pz                  n9        ]1.]P|                  n8        ]3]P|                  n9        ]]-.]P~                  n8        ]3]P~                  n9        ](](]! ]44      .]P                  n8        ]*]P                  n9        ]4]! ]54      .]P                  n8        ]*]P                  n9        ]4]! ]54      .]P                  n8        ]*]P                  n9        ]4]n4        ]5]n5        ]*]n*        ^tC^tD](.]P                  n8        R]P                  n9        ](.]P                  n8        ]']P                  n9        ])]] .]P                  n8        ]-]P                  n9        ]-] .]P                  n8        ]]P                  n9        ]-]]] .]P                  n8        ]]P                  n9        ])]].]P                  n8        ],]P                  n9        ],.]P                  n8        ]]P                  n9        ],.]P                  n8        ]]P                  n9        ])]! ](4      ]]0.]P                  n8        ].]P                  n9        ])]]0.]P                  n8        ]/]P                  n9        ]/].]P                  n8        R]P                  n9        ]..]P                  n8        ]]P                  n9        ].].]P                  n8        ]]P                  n9        ]+.]P                  n8        ]]P                  n9        ]+.]P                  n8        ]-]P                  n9        ])P                  ]R4      ]nU        ]P                  ! ]R4      ]nV        ](]n(        ].]n.        ]-]n-        ]+]n+        ]'       d,    ]4]! ]+4      .]P                  n8        ]]P                  n9        R R ltZ]Z]P                  n[        ]Z]Px                  n[        ]Z]Pz                  n[        ]Z]P                  n[        ]Z]P                  n[         ! R R4      t\R R lt]R R lt^R R lt_R R lt`] P                  R R l4       tbR&R R lltcR  R! ltdR" R# lteR#   ]W d   tX]! R]X 24      RhRtXAXii ; i  ]W d   tX]! R]X 24      RhRtXAXii ; i)'    N)	CDLLPOINTERc_boolc_char_pc_int32c_longc_uint32c_ulongc_void_p)find_library)_set_ssl_context_verify_mode.z,Only OS X 10.8 and newer are supported, not c                <    V ^8  d   QhR\         R\         R\        /# )   namemacos10_16_pathreturn)strr   )formats   "1lib/python3.14/site-packages/truststore/_macos.py__annotate__r      s&     J JS J3 J4 J    c                     \         R8  d   TpM\        V 4      pV'       g   \        h\        VRR7      #   \         d    \	        RT  R24      Rhi ; i)z:Loads a CDLL by name, falling back to known path on 10.16+T)	use_errnozThe library z failed to loadN)
      )_mac_version_infor   OSErrorr   ImportError)r   r   paths   && r   
_load_cdllr!      s]    J ("D%DMDD)) JLo>?TIJs    6 6 ASecurityz6/System/Library/Frameworks/Security.framework/SecurityCoreFoundationzB/System/Library/Frameworks/CoreFoundation.framework/CoreFoundationkCFAllocatorDefaultkCFTypeArrayCallBackszError initializing ctypes: c                    V ^8  d   QhR\         R\        P                  R\        P                  R\        P                  /# )r   result_argsr   )OSStatustypingAny)r   s   "r   r   r      s4     2  2 X 2 &** 2 FJJ 2 6:: 2 r   c                   \        V 4      ^ 8X  d   V# Rp \        P                  V R4      p\        P                  ! V\        P
                  ! \        P                  4      4      p\        P                  V\        P                  4      pVf\   \        P                  ! R4      p\        P                  VVR\        P                  4      p V '       g   \        R4      hVP                  pVe   \        P                  V4       Te   TR8X  d   RT  2p\         P"                  ! T4      h  Te   \        P                  T4       i i ; i)z4
Raises an error if the OSStatus value is non-zero.
N   'Error copying C string from CFStringRef z8SecureTransport operation returned a non-zero OSStatus: )intr"   SecCopyErrorMessageStringctypescastr   r   r#   CFStringGetCStringPtrCFConstkCFStringEncodingUTF8create_string_bufferCFStringGetCStringr   value	CFReleasesslSSLError)r'   r(   r)   error_message_cfstringerror_message_cfstring_c_void_pmessagebuffers   &&&    r   _handle_osstatusrB      s%    6{a "!=!)!C!CFD!Q +1++"FNN6??$C+
' !66+W-J-J
 ?006F#66/--	F GHHllG "-$$%;< 'R-LVHU
,,w
 "-$$%;< .s   B:D' D' 'Ec                   :    ] tR tRtRt]! R4      tRtRtRt	R	t
RtR# )
r6   i  zCoreFoundation constantsi   Niiii)__name__
__module____qualname____firstlineno____doc__CFStringEncodingr7   #errSecIncompleteCertRevocationCheckerrSecHostNameMismatcherrSecCertificateExpirederrSecNotTrusted__static_attributes__rD   r   r   r6   r6     s(    ",Z8*0'#%r   r6   c                0    V ^8  d   QhR\         R\        /# r   r:   r   )bytes	CFDataRef)r   s   "r   r   r   &  s       9 r   c                 ^    \         P                  \         P                  V \        V 4      4      # N)r#   CFDataCreater$   len)r:   s   &r   _bytes_to_cf_data_refrX   &  s&    &&**E3u: r   c                0    V ^8  d   QhR\         R\        /# rQ   )rR   CFString)r   s   "r   r   r   ,  s      u  r   c                    \         P                  ! V 4      p\        P                  \        P                  V\
        P                  4      pV# )z]
Given a Python binary data, create a CFString.
The string must be CFReleased by the caller.
)r3   r   r#   CFStringCreateWithCStringr$   r6   r7   )r:   c_strcf_strs   &  r   _bytes_to_cf_stringr_   ,  s>    
 OOE"E55**%%F
 Mr   c                >    V ^8  d   QhR\         R\        R,          /# )r   cf_string_refr   N)CFStringRefr   )r   s   "r   r   r   :  s       t r   c                4   \         P                  V \        P                  4      pVf[   \        P
                  ! R4      p\         P                  WR\        P                  4      pV'       g   \        R4      hVP                  pVe   VP                  R4      pV# )z
Creates a Unicode string from a CFString object. Used entirely for error
reporting.
Yes, it annoys me quite a lot that this function is this complex.
r.   r/   zutf-8)
r#   r5   r6   r7   r3   r8   r9   r   r:   decode)ra   stringrA   r'   s   &   r   _cf_string_ref_to_strrf   :  s     11w44F ~,,T2224)F)F
 CDDw'Mr   c                F    V ^8  d   QhR\         \        ,          R\        /# )r   certsr   )listrR   CFMutableArrayRef)r   s   "r   r   r   Q  s      tE{ 7H r   c                V   \         P                  \         P                  ^ \        P                  ! \         P
                  4      4      pV'       g   \        R4      hV  F  pRpRp \        V4      p\        P                  \         P                  V4      p\         P                  W4       V'       d   \         P                  V4       V'       d   \         P                  V4       K  K  	  V#   T'       d   \         P                  T4       T'       d   \         P                  T4       i i ; i)zBuilds a CFArray of SecCertificateRefs from a list of DER-encoded certificates.
Responsibility of the caller to call CoreFoundation.CFRelease on the CFArray.
zUnable to allocate memory!N)r#   CFArrayCreateMutabler$   r3   byrefr%   MemoryErrorrX   r"   SecCertificateCreateWithDataCFArrayAppendValuer;   )rh   cf_array	cert_datacf_datasec_cert_refs   &    r   _der_certs_to_cf_cert_arrayru   Q  s     22**	^99:H
 677	
	7+I6G#@@22GL --hE((1((6   O ((1((6 s   %AC++%D(D(c                f    V ^8  d   QhR\         P                  R\        P                  R,          /# )r   ctxr   N)r<   
SSLContextr+   Iterator)r   s   "r   r   r   p  s'     	7 	7CNN 	7vt/D 	7r   c              #      "   V P                   pV P                  pR V n         \        V \        P                  4        Rx  Wn         \        W4       R#   Yn         \        Y4       i ; i5i)FN)check_hostnameverify_moder   r<   	CERT_NONE)rw   r{   r|   s   &  r   _configure_contextr~   o  sV     ''N//KC cmm47+$S6 ,$S6s   :A*A A*A''A*c                x    V ^8  d   QhR\         P                  R\        \        ,          R\        R,          RR/# )r   ssl_context
cert_chainserver_hostnameNr   )r<   rx   ri   rR   r   )r   s   "r   r   r   |  sB     V, V,V,UV, 4ZV, 
	V,r   c                    R pR pR p Ved   V P                   '       dR   R p \        VP                  R4      4      p\        P	                  RV4      pV'       d   \
        P                  V4       M\        P	                  RR 4      pTpV P                  \        P                  ,          '       d   \
        P                  \
        P                  ^ \        P                  ! \
        P                  4      4      p\
        P                  WG4       \
        P                  V4       \        P!                  \"        \$        ,          4      p\
        P                  WH4       \
        P                  V4       M2V P                  \        P&                  ,          '       d   \)        R4      hR p \+        V4      p\        P-                  4       p\        P/                  W4\        P                  ! V4      4       V'       d   \
        P                  V4       T P1                  RR7      p	T	'       dA   R p
 \+        T	4      p
\        P3                  YZ4       T
'       d   \
        P                  T
4       \        P5                  TR4       \6        '       d   \9        Y4       M\;        Y4       T'       d   \
        P                  T4       T'       d   \
        P                  T4       R # R #   T'       d   \
        P                  T4       i i ; i  T'       d   \
        P                  T4       i i ; i  T
'       d   \
        P                  T
4       i i ; i  T'       d   \
        P                  T4       T'       d   \
        P                  T4       i i ; i)NasciiTz/VERIFY_CRL_CHECK_LEAF not implemented for macOS)binary_formF)r{   r_   encoder"   SecPolicyCreateSSLr#   r;   verify_flagsr<   VERIFY_CRL_CHECK_CHAINrl   r$   r3   rm   r%   rp   SecPolicyCreateRevocation#kSecRevocationUseAnyAvailableMethod%kSecRevocationRequirePositiveResponseVERIFY_CRL_CHECK_LEAFNotImplementedErrorru   SecTrustRefSecTrustCreateWithCertificatesget_ca_certsSecTrustSetAnchorCertificates!SecTrustSetAnchorCertificatesOnly _is_macos_version_10_14_or_later"_verify_peercerts_impl_macos_10_14"_verify_peercerts_impl_macos_10_13)r   r   r   rh   policiestrustcf_str_hostname
ssl_policyrevocation_policyctx_ca_certs_derctx_ca_certss   &&&        r   _verify_peercerts_implr   |  s   
 EHEN, &;+E+E+E"O>"5o6L6LW6U"V%88O
"",,_=!44T4@J##c&@&@@@%::22^AABH
 --hC$$Z0 ( B B378! --hJ$$%67%%(A(AAA%&WXX	0/
;E ((*E33e!4 ((/ 0;/G/G 0H 0
 L;:;KL66uK",,\: 	225%@
 ,+.{B.{B$$X.$$U+ I #",,_= #L ((/   ",,\:   $$X.$$U+ sx   M M 0K AM .C&M M #A	K= ,6M #M & L  >M M  K::M = LM   M  M %N )N c                \    V ^8  d   QhR\         P                  R\        P                  RR/# r   r   sec_trust_refr   Nr<   rx   r+   r,   )r   s   "r   r   r     s,     ) ))06

)	)r   c                   \         P                  4       p\         P                  V\        P                  ! V4      4        \        VP                  4      pV P                  \        P                  8X  dQ   VR
9  dH   ^ R^R^R^R^R^R/pVP                  VRV 24      p\        P                  ! V4      pWVn        W6n        VhR# R#   \        \        3 d    R	p Li ; i)zxVerify using 'SecTrustEvaluate' API for macOS 10.13 and earlier.
macOS 10.14 added the 'SecTrustEvaluateWithError' API.
zInvalid trust result typezUser confirmation requiredz.User specified that certificate is not trustedz"Recoverable trust failure occurredzFatal trust failure occurredz0Other error occurred, certificate may be revokedzUnknown trust result: N)      )r"   SecTrustResultTypeSecTrustEvaluater3   rm   r1   r:   
ValueError	TypeErrorr|   r<   CERT_REQUIREDgetSSLCertVerificationErrorverify_messageverify_code)r   r   sec_trust_result_typesec_trust_result_type_as_int sec_trust_result_type_to_messageerror_messageerrs   &&     r   r   r     s     %779mV\\:O-PQ*'*+@+F+F'G$ 	3#4#44(6 *+?3-A	,
( 9<<($%A$BC

 **=9*6	/ 7 	5 	" *')$*s    C CCc                \    V ^8  d   QhR\         P                  R\        P                  RR/# r   r   )r   s   "r   r   r     s,     :> :>:>06

:>	:>r   c                &   \         P                  4       p\        P                  V\        P
                  ! V4      4      pV^8X  d   RpM$V^ 8X  d   RpM\        P                  ! RV: 24      h^ pV'       ga   \         P                  V4      pV P                  \        P                  8w  d-   V\        P                  8X  g   V\        P                  8X  d   RpV'       g   Rp \         P                  V4      p\        V4      ;'       g    Rp\        P!                  4       p\        P#                  V\        P
                  ! V4      4       \        P$                  ! V4      p	Wyn        WYn        V	hR#   T'       d   \         P+                  T4       i i ; i)z>Verify using 'SecTrustEvaluateWithError' API for macOS 10.14+.TFz8Unknown result from Security.SecTrustEvaluateWithError: NzCertificate verification failed)r#   
CFErrorRefr"   SecTrustEvaluateWithErrorr3   rm   r<   r=   CFErrorGetCoder|   r   r6   rN   rM   CFErrorCopyDescriptionrf   r   SecTrustGetTrustResultr   r   r   r;   )
r   r   cf_errorsec_trust_eval_result
is_trustedcf_error_codecf_error_string_refcf_error_messager   r   s
   &&        r   r   r     sj    ((*H$>>v||H-
 !
	!	#
llFG\F_`
 	
 M&55h?
 ""c&7&77W555 @ @@J "	>"0"G"G"Q &&9: 5 54  %-$?$?$A!++v||,AB ../?@C!1+OI+ . #(()<= #s   "&E0 	A%E0 0 F)r      )r      rU   )f
contextlibr3   platformr<   r+   r   r   r   r   r   r   r	   r
   r   ctypes.utilr   _ssl_constantsr   mac_ver_mac_versiontuplemapr1   splitr   r   r   r!   r"   r#   BooleanCFIndexrJ   CFDatarZ   CFArrayCFMutableArrayCFErrorCFTypeCFTypeID	CFTypeRefCFAllocatorRefr*   r   rS   rb   
CFArrayRefrj   CFArrayCallBacksCFOptionFlagsSecCertificateRefSecPolicyRefr   r   SecTrustOptionFlagsro   argtypesrestypeSecCertificateCopyDatar2   r   r   r   r   r   r   r   r   r   r;   CFGetTypeIDr\   r5   r9   rV   CFDataGetLengthCFDataGetBytePtrCFArrayCreaterl   rp   CFArrayGetCountCFArrayGetValueAtIndexr   r   in_dllr$   r%   AttributeErrorer   rB   errcheckr6   rX   r_   rf   ru   contextmanagerr~   r   r   r   rD   r   r   <module>r      s      
 
 
 
 % 8!!$#c<#5#5c#:;< w

67H7K6LAN_`aNbMcd  $5#@  J" H H
 
 	

	FO	W
FO	hW
N+  H% x h  |C6Di5PH))24EH))10A/BH##,.7H##+3;X2FH&&/1<H&&.7BJ6OH**35=H**2;F:PH..79AH..63@/H&&/1=H&&.,3[+AH(*6H' 	8H++4
 7?H++3 	"#0H##, /7H##+ 	"#*H& )1H%&H"4H H*+',-))2N%'+N$+4+N')1N& 	9N,,5
 8CN,,45@BR4SN((13;N((0 		2N%%. 17N%%-,:Hg+NN(*3N'/8kN""+-4N""*09{N##,.6N##+ 			-N  ) ,6N  ( 	4N''0
 3DN''/2CX1NN%%.04N%%-/9lN""+-4N""*6@'5JN))24<N))1.8\N!!*,3N!!)6@\N))24?N))1)7)>)>-*N& ,4??/,N(  )N *N!,N *N $GJ7
**3 6<**2
2 j 4D ' ' 02B & & /6F * * 3+;   (%5   " .< 	7 	7V,r)X:>c	  C
3A37
8dBC  G7s;<$FGs1   O?W0 *X 0X7XXX#XX#