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e _@e;e _;e>e _>eBe _BeDe _De9e _9e/e _/e1we de _xe1we de _ye-ge!jz_Je-e!jz_Ke-ge!j{_Jde!j{_Ke-ge!j|_Je,e!j|_Ke.e
e$ge!j}_Je1e!j}_Ke1e$ge!j~_Je
e!j~_Ke1e
e#e$ge!j_Jee!j_Ke.e
e#ge!j_Je0e!j_Ke0ge!j_Je#e!j_Ke0ge!j_Jee!j_Ke.ee-ee-e#e6e7ge!j_Je4e!j_Ke4e-ge!j_Je-e!j_Ke.ee-e#e5ge!j_Je2e!j_Ke.e#e5ge!j_Je3e!j_Ke3ege!j_Jde!j_Ke2ge!j_Je#e!j_Ke2e#ge!j_Jee!j_Ke.we!de!_ewe!de!_ewe!de!_ewe!de!_e-e!_-e2e!_2e1e!_1e4e!_4W n evy edY n0 G dd deZG dd deZdS )ay
This module uses ctypes to bind a whole bunch of functions and constants from
SecureTransport. The goal here is to provide the low-level API to
SecureTransport. These are essentially the C-level functions and constants, and
they're pretty gross to work with.
This code is a bastardised version of the code found in Will Bond's oscrypto
library. An enormous debt is owed to him for blazing this trail for us. For
that reason, this code should be considered to be covered both by urllib3's
license and by oscrypto's:
Copyright (c) 2015-2016 Will Bond
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
)absolute_importN)CDLL CFUNCTYPEPOINTERc_boolc_bytec_char_pc_int32c_longc_size_tc_uint32c_ulongc_void_p)find_library)
raise_fromZDarwinzOnly macOS is supported.)
z1Only OS X 10.8 and newer are supported, not %s.%s c C sV z,t dkr|}nt| }|s tt|ddW S tyP ttd| d Y n0 dS )z:Loads a CDLL by name, falling back to known path on 10.16+)r T)Z use_errnozThe library %s failed to loadN)version_infor OSErrorr r ImportError)nameZmacos10_16_pathpath r M/usr/lib/python3.9/site-packages/urllib3/contrib/_securetransport/bindings.py load_cdllA s r Securityz6/System/Library/Frameworks/Security.framework/SecurityCoreFoundationzB/System/Library/Frameworks/CoreFoundation.framework/CoreFoundationkSecImportExportPassphrasekSecImportItemIdentitykCFAllocatorDefaultkCFTypeArrayCallBackskCFTypeDictionaryKeyCallBackskCFTypeDictionaryValueCallBackszError initializing ctypesc @ s e Zd ZdZedZdS )CFConstz_
A class object that acts as essentially a namespace for CoreFoundation
constants.
i N)__name__
__module____qualname____doc__CFStringEncodingZkCFStringEncodingUTF8r r r r r&