diff options
author | 2016-03-22 17:20:13 +0200 | |
---|---|---|
committer | 2016-03-23 13:01:06 +0200 | |
commit | 46f110d0c728ba9299156cf92a59c27c2d0348fa (patch) | |
tree | 9053af8b721a79378cea8ee4401d029b5a23d4b6 /scripts/external_libs/dpkt-1.8.6/dpkt/ssl_ciphersuites.py | |
parent | 9c03844bea5c9fc4423ed4c6ddf9376a9cdd7ac5 (diff) |
removed dpkt
Diffstat (limited to 'scripts/external_libs/dpkt-1.8.6/dpkt/ssl_ciphersuites.py')
-rw-r--r-- | scripts/external_libs/dpkt-1.8.6/dpkt/ssl_ciphersuites.py | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/scripts/external_libs/dpkt-1.8.6/dpkt/ssl_ciphersuites.py b/scripts/external_libs/dpkt-1.8.6/dpkt/ssl_ciphersuites.py deleted file mode 100644 index 49148a34..00000000 --- a/scripts/external_libs/dpkt-1.8.6/dpkt/ssl_ciphersuites.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2012 Google Inc. All rights reserved. - -""" -Nicely formatted cipher suite definitions for TLS - -A list of cipher suites in the form of CipherSuite objects. -These are supposed to be immutable; don't mess with them. -""" - - -class CipherSuite(object): - """ - Encapsulates a cipher suite. - - Members/args: - * code: two-byte ID code, as int - * name: as in 'TLS_RSA_WITH_RC4_40_MD5' - * kx: key exchange algorithm, string - * auth: authentication algorithm, string - * encoding: encoding algorithm - * mac: message authentication code algorithm - """ - - def __init__(self, code, name, kx, auth, encoding, mac): - self.code = code - self.name = name - self.kx = kx - self.auth = auth - self.encoding = encoding - self.mac = mac - - def __repr__(self): - return 'CipherSuite(%s)' % self.name - - MAC_SIZES = { - 'MD5': 16, - 'SHA': 20, - 'SHA256': 32, # I guess - } - - BLOCK_SIZES = { - 'AES_256_CBC': 16, - } - - @property - def mac_size(self): - """In bytes. Default to 0.""" - return self.MAC_SIZES.get(self.mac, 0) - - @property - def block_size(self): - """In bytes. Default to 1.""" - return self.BLOCK_SIZES.get(self.encoding, 1) - - -# master list of CipherSuite Objects -CIPHERSUITES = [ - # not a real cipher suite, can be ignored, see RFC5746 - CipherSuite(0xff, 'TLS_EMPTY_RENEGOTIATION_INFO', - 'NULL', 'NULL', 'NULL', 'NULL'), - CipherSuite(0x00, 'TLS_NULL_WITH_NULL_NULL', - 'NULL', 'NULL', 'NULL', 'NULL'), - CipherSuite(0x01, 'TLS_RSA_WITH_NULL_MD5', 'RSA', 'RSA', 'NULL', 'MD5'), - CipherSuite(0x02, 'TLS_RSA_WITH_NULL_SHA', 'RSA', 'RSA', 'NULL', 'SHA'), - CipherSuite(0x0039, 'TLS_DHE_RSA_WITH_AES_256_CBC_SHA', - 'DHE', 'RSA', 'AES_256_CBC', 'SHA'), # not sure I got the kx/auth thing right. - CipherSuite(0xffff, 'UNKNOWN_CIPHER', '', '', '', '') -] - -BY_CODE = dict( - (cipher.code, cipher) for cipher in CIPHERSUITES) - -BY_NAME = dict( - (suite.name, suite) for suite in CIPHERSUITES) - -NULL_SUITE = BY_CODE[0x00] |