1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/src/pip/_vendor/urllib3/contrib/_securetransport/bindings.py

520 lines
17 KiB
Python
Raw Normal View History

2017-05-19 13:57:33 +02:00
"""
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 <will@wbond.net>
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.
"""
from __future__ import absolute_import
import platform
from ctypes import (
2020-11-19 15:20:52 +01:00
CDLL,
CFUNCTYPE,
POINTER,
c_bool,
c_byte,
2019-10-09 16:16:37 +02:00
c_char_p,
2020-11-19 15:20:52 +01:00
c_int32,
c_long,
2019-10-09 16:16:37 +02:00
c_size_t,
c_uint32,
c_ulong,
2020-11-19 15:20:52 +01:00
c_void_p,
2017-05-19 13:57:33 +02:00
)
2020-11-19 15:20:52 +01:00
from ctypes.util import find_library
2017-05-19 13:57:33 +02:00
2020-11-19 15:20:52 +01:00
from pip._vendor.urllib3.packages.six import raise_from
2017-05-19 13:57:33 +02:00
2020-11-19 15:20:52 +01:00
if platform.system() != "Darwin":
raise ImportError("Only macOS is supported")
2017-05-19 13:57:33 +02:00
version = platform.mac_ver()[0]
2019-10-09 16:16:37 +02:00
version_info = tuple(map(int, version.split(".")))
2017-05-19 13:57:33 +02:00
if version_info < (10, 8):
raise OSError(
2019-10-09 16:16:37 +02:00
"Only OS X 10.8 and newer are supported, not %s.%s"
% (version_info[0], version_info[1])
2017-05-19 13:57:33 +02:00
)
2020-11-19 15:20:52 +01:00
def load_cdll(name, macos10_16_path):
"""Loads a CDLL by name, falling back to known path on 10.16+"""
try:
# Big Sur is technically 11 but we use 10.16 due to the Big Sur
# beta being labeled as 10.16.
if version_info >= (10, 16):
path = macos10_16_path
else:
path = find_library(name)
if not path:
raise OSError # Caught and reraised as 'ImportError'
return CDLL(path, use_errno=True)
except OSError:
raise_from(ImportError("The library %s failed to load" % name), None)
Security = load_cdll(
"Security", "/System/Library/Frameworks/Security.framework/Security"
)
CoreFoundation = load_cdll(
"CoreFoundation",
"/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation",
)
2017-05-19 13:57:33 +02:00
Boolean = c_bool
CFIndex = c_long
CFStringEncoding = c_uint32
CFData = c_void_p
CFString = c_void_p
CFArray = c_void_p
CFMutableArray = c_void_p
CFDictionary = c_void_p
CFError = c_void_p
CFType = c_void_p
CFTypeID = c_ulong
CFTypeRef = POINTER(CFType)
CFAllocatorRef = c_void_p
OSStatus = c_int32
CFDataRef = POINTER(CFData)
CFStringRef = POINTER(CFString)
CFArrayRef = POINTER(CFArray)
CFMutableArrayRef = POINTER(CFMutableArray)
CFDictionaryRef = POINTER(CFDictionary)
CFArrayCallBacks = c_void_p
CFDictionaryKeyCallBacks = c_void_p
CFDictionaryValueCallBacks = c_void_p
SecCertificateRef = POINTER(c_void_p)
SecExternalFormat = c_uint32
SecExternalItemType = c_uint32
SecIdentityRef = POINTER(c_void_p)
SecItemImportExportFlags = c_uint32
SecItemImportExportKeyParameters = c_void_p
SecKeychainRef = POINTER(c_void_p)
SSLProtocol = c_uint32
SSLCipherSuite = c_uint32
SSLContextRef = POINTER(c_void_p)
SecTrustRef = POINTER(c_void_p)
SSLConnectionRef = c_uint32
SecTrustResultType = c_uint32
SecTrustOptionFlags = c_uint32
SSLProtocolSide = c_uint32
SSLConnectionType = c_uint32
SSLSessionOption = c_uint32
try:
Security.SecItemImport.argtypes = [
CFDataRef,
CFStringRef,
POINTER(SecExternalFormat),
POINTER(SecExternalItemType),
SecItemImportExportFlags,
POINTER(SecItemImportExportKeyParameters),
SecKeychainRef,
POINTER(CFArrayRef),
]
Security.SecItemImport.restype = OSStatus
Security.SecCertificateGetTypeID.argtypes = []
Security.SecCertificateGetTypeID.restype = CFTypeID
Security.SecIdentityGetTypeID.argtypes = []
Security.SecIdentityGetTypeID.restype = CFTypeID
Security.SecKeyGetTypeID.argtypes = []
Security.SecKeyGetTypeID.restype = CFTypeID
2019-10-09 16:16:37 +02:00
Security.SecCertificateCreateWithData.argtypes = [CFAllocatorRef, CFDataRef]
2017-05-19 13:57:33 +02:00
Security.SecCertificateCreateWithData.restype = SecCertificateRef
2019-10-09 16:16:37 +02:00
Security.SecCertificateCopyData.argtypes = [SecCertificateRef]
2017-05-19 13:57:33 +02:00
Security.SecCertificateCopyData.restype = CFDataRef
2019-10-09 16:16:37 +02:00
Security.SecCopyErrorMessageString.argtypes = [OSStatus, c_void_p]
2017-05-19 13:57:33 +02:00
Security.SecCopyErrorMessageString.restype = CFStringRef
Security.SecIdentityCreateWithCertificate.argtypes = [
CFTypeRef,
SecCertificateRef,
2019-10-09 16:16:37 +02:00
POINTER(SecIdentityRef),
2017-05-19 13:57:33 +02:00
]
Security.SecIdentityCreateWithCertificate.restype = OSStatus
Security.SecKeychainCreate.argtypes = [
c_char_p,
c_uint32,
c_void_p,
Boolean,
c_void_p,
2019-10-09 16:16:37 +02:00
POINTER(SecKeychainRef),
2017-05-19 13:57:33 +02:00
]
Security.SecKeychainCreate.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SecKeychainDelete.argtypes = [SecKeychainRef]
2017-05-19 13:57:33 +02:00
Security.SecKeychainDelete.restype = OSStatus
Security.SecPKCS12Import.argtypes = [
CFDataRef,
CFDictionaryRef,
2019-10-09 16:16:37 +02:00
POINTER(CFArrayRef),
2017-05-19 13:57:33 +02:00
]
Security.SecPKCS12Import.restype = OSStatus
SSLReadFunc = CFUNCTYPE(OSStatus, SSLConnectionRef, c_void_p, POINTER(c_size_t))
2019-10-09 16:16:37 +02:00
SSLWriteFunc = CFUNCTYPE(
OSStatus, SSLConnectionRef, POINTER(c_byte), POINTER(c_size_t)
)
2017-05-19 13:57:33 +02:00
2019-10-09 16:16:37 +02:00
Security.SSLSetIOFuncs.argtypes = [SSLContextRef, SSLReadFunc, SSLWriteFunc]
2017-05-19 13:57:33 +02:00
Security.SSLSetIOFuncs.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLSetPeerID.argtypes = [SSLContextRef, c_char_p, c_size_t]
2017-05-19 13:57:33 +02:00
Security.SSLSetPeerID.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLSetCertificate.argtypes = [SSLContextRef, CFArrayRef]
2017-05-19 13:57:33 +02:00
Security.SSLSetCertificate.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLSetCertificateAuthorities.argtypes = [SSLContextRef, CFTypeRef, Boolean]
2017-05-19 13:57:33 +02:00
Security.SSLSetCertificateAuthorities.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLSetConnection.argtypes = [SSLContextRef, SSLConnectionRef]
2017-05-19 13:57:33 +02:00
Security.SSLSetConnection.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLSetPeerDomainName.argtypes = [SSLContextRef, c_char_p, c_size_t]
2017-05-19 13:57:33 +02:00
Security.SSLSetPeerDomainName.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLHandshake.argtypes = [SSLContextRef]
2017-05-19 13:57:33 +02:00
Security.SSLHandshake.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLRead.argtypes = [SSLContextRef, c_char_p, c_size_t, POINTER(c_size_t)]
2017-05-19 13:57:33 +02:00
Security.SSLRead.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLWrite.argtypes = [SSLContextRef, c_char_p, c_size_t, POINTER(c_size_t)]
2017-05-19 13:57:33 +02:00
Security.SSLWrite.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLClose.argtypes = [SSLContextRef]
2017-05-19 13:57:33 +02:00
Security.SSLClose.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLGetNumberSupportedCiphers.argtypes = [SSLContextRef, POINTER(c_size_t)]
2017-05-19 13:57:33 +02:00
Security.SSLGetNumberSupportedCiphers.restype = OSStatus
Security.SSLGetSupportedCiphers.argtypes = [
SSLContextRef,
POINTER(SSLCipherSuite),
2019-10-09 16:16:37 +02:00
POINTER(c_size_t),
2017-05-19 13:57:33 +02:00
]
Security.SSLGetSupportedCiphers.restype = OSStatus
Security.SSLSetEnabledCiphers.argtypes = [
SSLContextRef,
POINTER(SSLCipherSuite),
2019-10-09 16:16:37 +02:00
c_size_t,
2017-05-19 13:57:33 +02:00
]
Security.SSLSetEnabledCiphers.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLGetNumberEnabledCiphers.argtype = [SSLContextRef, POINTER(c_size_t)]
2017-05-19 13:57:33 +02:00
Security.SSLGetNumberEnabledCiphers.restype = OSStatus
Security.SSLGetEnabledCiphers.argtypes = [
SSLContextRef,
POINTER(SSLCipherSuite),
2019-10-09 16:16:37 +02:00
POINTER(c_size_t),
2017-05-19 13:57:33 +02:00
]
Security.SSLGetEnabledCiphers.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLGetNegotiatedCipher.argtypes = [SSLContextRef, POINTER(SSLCipherSuite)]
2017-05-19 13:57:33 +02:00
Security.SSLGetNegotiatedCipher.restype = OSStatus
Security.SSLGetNegotiatedProtocolVersion.argtypes = [
SSLContextRef,
2019-10-09 16:16:37 +02:00
POINTER(SSLProtocol),
2017-05-19 13:57:33 +02:00
]
Security.SSLGetNegotiatedProtocolVersion.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLCopyPeerTrust.argtypes = [SSLContextRef, POINTER(SecTrustRef)]
2017-05-19 13:57:33 +02:00
Security.SSLCopyPeerTrust.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SecTrustSetAnchorCertificates.argtypes = [SecTrustRef, CFArrayRef]
2017-05-19 13:57:33 +02:00
Security.SecTrustSetAnchorCertificates.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SecTrustSetAnchorCertificatesOnly.argstypes = [SecTrustRef, Boolean]
2017-05-19 13:57:33 +02:00
Security.SecTrustSetAnchorCertificatesOnly.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SecTrustEvaluate.argtypes = [SecTrustRef, POINTER(SecTrustResultType)]
2017-05-19 13:57:33 +02:00
Security.SecTrustEvaluate.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SecTrustGetCertificateCount.argtypes = [SecTrustRef]
2017-05-19 13:57:33 +02:00
Security.SecTrustGetCertificateCount.restype = CFIndex
2019-10-09 16:16:37 +02:00
Security.SecTrustGetCertificateAtIndex.argtypes = [SecTrustRef, CFIndex]
2017-05-19 13:57:33 +02:00
Security.SecTrustGetCertificateAtIndex.restype = SecCertificateRef
Security.SSLCreateContext.argtypes = [
CFAllocatorRef,
SSLProtocolSide,
2019-10-09 16:16:37 +02:00
SSLConnectionType,
2017-05-19 13:57:33 +02:00
]
Security.SSLCreateContext.restype = SSLContextRef
2019-10-09 16:16:37 +02:00
Security.SSLSetSessionOption.argtypes = [SSLContextRef, SSLSessionOption, Boolean]
2017-05-19 13:57:33 +02:00
Security.SSLSetSessionOption.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLSetProtocolVersionMin.argtypes = [SSLContextRef, SSLProtocol]
2017-05-19 13:57:33 +02:00
Security.SSLSetProtocolVersionMin.restype = OSStatus
2019-10-09 16:16:37 +02:00
Security.SSLSetProtocolVersionMax.argtypes = [SSLContextRef, SSLProtocol]
2017-05-19 13:57:33 +02:00
Security.SSLSetProtocolVersionMax.restype = OSStatus
2020-11-19 15:20:52 +01:00
try:
Security.SSLSetALPNProtocols.argtypes = [SSLContextRef, CFArrayRef]
Security.SSLSetALPNProtocols.restype = OSStatus
except AttributeError:
# Supported only in 10.12+
pass
2019-10-09 16:16:37 +02:00
Security.SecCopyErrorMessageString.argtypes = [OSStatus, c_void_p]
2017-05-19 13:57:33 +02:00
Security.SecCopyErrorMessageString.restype = CFStringRef
Security.SSLReadFunc = SSLReadFunc
Security.SSLWriteFunc = SSLWriteFunc
Security.SSLContextRef = SSLContextRef
Security.SSLProtocol = SSLProtocol
Security.SSLCipherSuite = SSLCipherSuite
Security.SecIdentityRef = SecIdentityRef
Security.SecKeychainRef = SecKeychainRef
Security.SecTrustRef = SecTrustRef
Security.SecTrustResultType = SecTrustResultType
Security.SecExternalFormat = SecExternalFormat
Security.OSStatus = OSStatus
Security.kSecImportExportPassphrase = CFStringRef.in_dll(
2019-10-09 16:16:37 +02:00
Security, "kSecImportExportPassphrase"
2017-05-19 13:57:33 +02:00
)
Security.kSecImportItemIdentity = CFStringRef.in_dll(
2019-10-09 16:16:37 +02:00
Security, "kSecImportItemIdentity"
2017-05-19 13:57:33 +02:00
)
# CoreFoundation time!
2019-10-09 16:16:37 +02:00
CoreFoundation.CFRetain.argtypes = [CFTypeRef]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFRetain.restype = CFTypeRef
2019-10-09 16:16:37 +02:00
CoreFoundation.CFRelease.argtypes = [CFTypeRef]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFRelease.restype = None
2019-10-09 16:16:37 +02:00
CoreFoundation.CFGetTypeID.argtypes = [CFTypeRef]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFGetTypeID.restype = CFTypeID
CoreFoundation.CFStringCreateWithCString.argtypes = [
CFAllocatorRef,
c_char_p,
2019-10-09 16:16:37 +02:00
CFStringEncoding,
2017-05-19 13:57:33 +02:00
]
CoreFoundation.CFStringCreateWithCString.restype = CFStringRef
2019-10-09 16:16:37 +02:00
CoreFoundation.CFStringGetCStringPtr.argtypes = [CFStringRef, CFStringEncoding]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFStringGetCStringPtr.restype = c_char_p
CoreFoundation.CFStringGetCString.argtypes = [
CFStringRef,
c_char_p,
CFIndex,
2019-10-09 16:16:37 +02:00
CFStringEncoding,
2017-05-19 13:57:33 +02:00
]
CoreFoundation.CFStringGetCString.restype = c_bool
2019-10-09 16:16:37 +02:00
CoreFoundation.CFDataCreate.argtypes = [CFAllocatorRef, c_char_p, CFIndex]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFDataCreate.restype = CFDataRef
2019-10-09 16:16:37 +02:00
CoreFoundation.CFDataGetLength.argtypes = [CFDataRef]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFDataGetLength.restype = CFIndex
2019-10-09 16:16:37 +02:00
CoreFoundation.CFDataGetBytePtr.argtypes = [CFDataRef]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFDataGetBytePtr.restype = c_void_p
CoreFoundation.CFDictionaryCreate.argtypes = [
CFAllocatorRef,
POINTER(CFTypeRef),
POINTER(CFTypeRef),
CFIndex,
CFDictionaryKeyCallBacks,
2019-10-09 16:16:37 +02:00
CFDictionaryValueCallBacks,
2017-05-19 13:57:33 +02:00
]
CoreFoundation.CFDictionaryCreate.restype = CFDictionaryRef
2019-10-09 16:16:37 +02:00
CoreFoundation.CFDictionaryGetValue.argtypes = [CFDictionaryRef, CFTypeRef]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFDictionaryGetValue.restype = CFTypeRef
CoreFoundation.CFArrayCreate.argtypes = [
CFAllocatorRef,
POINTER(CFTypeRef),
CFIndex,
CFArrayCallBacks,
]
CoreFoundation.CFArrayCreate.restype = CFArrayRef
CoreFoundation.CFArrayCreateMutable.argtypes = [
CFAllocatorRef,
CFIndex,
2019-10-09 16:16:37 +02:00
CFArrayCallBacks,
2017-05-19 13:57:33 +02:00
]
CoreFoundation.CFArrayCreateMutable.restype = CFMutableArrayRef
2019-10-09 16:16:37 +02:00
CoreFoundation.CFArrayAppendValue.argtypes = [CFMutableArrayRef, c_void_p]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFArrayAppendValue.restype = None
2019-10-09 16:16:37 +02:00
CoreFoundation.CFArrayGetCount.argtypes = [CFArrayRef]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFArrayGetCount.restype = CFIndex
2019-10-09 16:16:37 +02:00
CoreFoundation.CFArrayGetValueAtIndex.argtypes = [CFArrayRef, CFIndex]
2017-05-19 13:57:33 +02:00
CoreFoundation.CFArrayGetValueAtIndex.restype = c_void_p
CoreFoundation.kCFAllocatorDefault = CFAllocatorRef.in_dll(
2019-10-09 16:16:37 +02:00
CoreFoundation, "kCFAllocatorDefault"
)
CoreFoundation.kCFTypeArrayCallBacks = c_void_p.in_dll(
CoreFoundation, "kCFTypeArrayCallBacks"
2017-05-19 13:57:33 +02:00
)
CoreFoundation.kCFTypeDictionaryKeyCallBacks = c_void_p.in_dll(
2019-10-09 16:16:37 +02:00
CoreFoundation, "kCFTypeDictionaryKeyCallBacks"
2017-05-19 13:57:33 +02:00
)
CoreFoundation.kCFTypeDictionaryValueCallBacks = c_void_p.in_dll(
2019-10-09 16:16:37 +02:00
CoreFoundation, "kCFTypeDictionaryValueCallBacks"
2017-05-19 13:57:33 +02:00
)
CoreFoundation.CFTypeRef = CFTypeRef
CoreFoundation.CFArrayRef = CFArrayRef
CoreFoundation.CFStringRef = CFStringRef
CoreFoundation.CFDictionaryRef = CFDictionaryRef
except (AttributeError):
2019-10-09 16:16:37 +02:00
raise ImportError("Error initializing ctypes")
2017-05-19 13:57:33 +02:00
class CFConst(object):
"""
A class object that acts as essentially a namespace for CoreFoundation
constants.
"""
2019-10-09 16:16:37 +02:00
2017-05-19 13:57:33 +02:00
kCFStringEncodingUTF8 = CFStringEncoding(0x08000100)
class SecurityConst(object):
"""
A class object that acts as essentially a namespace for Security constants.
"""
2019-10-09 16:16:37 +02:00
2017-05-19 13:57:33 +02:00
kSSLSessionOptionBreakOnServerAuth = 0
kSSLProtocol2 = 1
kSSLProtocol3 = 2
kTLSProtocol1 = 4
kTLSProtocol11 = 7
kTLSProtocol12 = 8
2020-01-21 08:49:56 +01:00
# SecureTransport does not support TLS 1.3 even if there's a constant for it
2019-07-20 05:59:46 +02:00
kTLSProtocol13 = 10
kTLSProtocolMaxSupported = 999
2017-05-19 13:57:33 +02:00
kSSLClientSide = 1
kSSLStreamType = 0
kSecFormatPEMSequence = 10
kSecTrustResultInvalid = 0
kSecTrustResultProceed = 1
# This gap is present on purpose: this was kSecTrustResultConfirm, which
# is deprecated.
kSecTrustResultDeny = 3
kSecTrustResultUnspecified = 4
kSecTrustResultRecoverableTrustFailure = 5
kSecTrustResultFatalTrustFailure = 6
kSecTrustResultOtherError = 7
errSSLProtocol = -9800
errSSLWouldBlock = -9803
errSSLClosedGraceful = -9805
errSSLClosedNoNotify = -9816
errSSLClosedAbort = -9806
errSSLXCertChainInvalid = -9807
errSSLCrypto = -9809
errSSLInternal = -9810
errSSLCertExpired = -9814
errSSLCertNotYetValid = -9815
errSSLUnknownRootCert = -9812
errSSLNoRootCert = -9813
errSSLHostNameMismatch = -9843
errSSLPeerHandshakeFail = -9824
errSSLPeerUserCancelled = -9839
errSSLWeakPeerEphemeralDHKey = -9850
errSSLServerAuthCompleted = -9841
errSSLRecordOverflow = -9847
errSecVerifyFailed = -67808
errSecNoTrustSettings = -25263
errSecItemNotFound = -25300
errSecInvalidTrustSettings = -25262
# Cipher suites. We only pick the ones our default cipher string allows.
2019-07-20 05:59:46 +02:00
# Source: https://developer.apple.com/documentation/security/1550981-ssl_cipher_suite_values
2017-05-19 13:57:33 +02:00
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F
2019-07-20 05:59:46 +02:00
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA9
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA8
2017-05-19 13:57:33 +02:00
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B
TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067
TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033
TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D
TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C
TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D
TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C
TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035
TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F
2017-09-07 18:32:59 +02:00
TLS_AES_128_GCM_SHA256 = 0x1301
TLS_AES_256_GCM_SHA384 = 0x1302
2019-07-20 05:59:46 +02:00
TLS_AES_128_CCM_8_SHA256 = 0x1305
TLS_AES_128_CCM_SHA256 = 0x1304