cryptoparser 0.12.0__tar.gz → 0.12.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/CHANGELOG.rst +26 -0
  2. {CryptoParser-0.12.0 → CryptoParser-0.12.2/CryptoParser.egg-info}/PKG-INFO +3 -3
  3. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/CryptoParser.egg-info/requires.txt +1 -1
  4. {CryptoParser-0.12.0/CryptoParser.egg-info → CryptoParser-0.12.2}/PKG-INFO +3 -3
  5. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/__setup__.py +2 -2
  6. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/base.py +7 -6
  7. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/ssh/key.py +59 -82
  8. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/version.py +3 -1
  9. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/requirements.txt +1 -1
  10. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/CONTRIBUTING.rst +0 -0
  11. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/CryptoParser.egg-info/SOURCES.txt +0 -0
  12. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/CryptoParser.egg-info/dependency_links.txt +0 -0
  13. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/CryptoParser.egg-info/top_level.txt +0 -0
  14. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/LICENSE.txt +0 -0
  15. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/MANIFEST.in +0 -0
  16. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/README.rst +0 -0
  17. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/__init__.py +0 -0
  18. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/__init__.py +0 -0
  19. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/classes.py +0 -0
  20. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/exception.py +0 -0
  21. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/field.py +0 -0
  22. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/parse.py +0 -0
  23. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/utils.py +0 -0
  24. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/common/x509.py +0 -0
  25. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/dnsrec/__init__.py +0 -0
  26. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/dnsrec/record.py +0 -0
  27. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/dnsrec/txt.py +0 -0
  28. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/httpx/__init__.py +0 -0
  29. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/httpx/header.py +0 -0
  30. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/httpx/parse.py +0 -0
  31. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/httpx/version.py +0 -0
  32. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/ssh/__init__.py +0 -0
  33. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/ssh/record.py +0 -0
  34. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/ssh/subprotocol.py +0 -0
  35. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/ssh/version.py +0 -0
  36. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/__init__.py +0 -0
  37. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/algorithm.py +0 -0
  38. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/ciphersuite.py +0 -0
  39. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/extension.py +0 -0
  40. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/grease.py +0 -0
  41. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/ldap.py +0 -0
  42. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/mysql.py +0 -0
  43. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/openvpn.py +0 -0
  44. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/postgresql.py +0 -0
  45. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/rdp.py +0 -0
  46. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/record.py +0 -0
  47. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/cryptoparser/tls/subprotocol.py +0 -0
  48. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/setup.cfg +0 -0
  49. {CryptoParser-0.12.0 → CryptoParser-0.12.2}/setup.py +0 -0
@@ -2,6 +2,32 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
+ -------------------
6
+ 0.12.2 - 2024-01-11
7
+ -------------------
8
+
9
+ Improvements
10
+ ============
11
+
12
+ - Generic
13
+
14
+ - add metadata to documentation
15
+
16
+ -------------------
17
+ 0.12.1 - 2023-12-13
18
+ -------------------
19
+
20
+ Notable fixes
21
+ =============
22
+
23
+ - SSH
24
+
25
+ - add missing host key algorithms to key parser classes (#79)
26
+
27
+ - Generic
28
+
29
+ - fix markdown generation in the case of TLS client versions (#80)
30
+
5
31
  -------------------
6
32
  0.12.0 - 2023-11-23
7
33
  -------------------
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CryptoParser
3
- Version: 0.12.0
4
- Summary: Fast and flexible security protocol parser and generator
3
+ Version: 0.12.2
4
+ Summary: An analysis oriented security protocol parser and generator
5
5
  Author: Szilárd Pfeiffer
6
6
  Author-email: coroner@pfeifferszilard.hu
7
7
  Maintainer: Szilárd Pfeiffer
@@ -48,7 +48,7 @@ Description-Content-Type: text/x-rst
48
48
  License-File: LICENSE.txt
49
49
  Requires-Dist: asn1crypto
50
50
  Requires-Dist: attrs<22.0.1,>=20.3.0
51
- Requires-Dist: cryptodatahub==0.11.2
51
+ Requires-Dist: cryptodatahub==0.12.2
52
52
  Requires-Dist: python-dateutil
53
53
  Requires-Dist: py2-ipaddress; python_version < "3.4"
54
54
  Requires-Dist: typing; python_version < "3.5"
@@ -1,6 +1,6 @@
1
1
  asn1crypto
2
2
  attrs<22.0.1,>=20.3.0
3
- cryptodatahub==0.11.2
3
+ cryptodatahub==0.12.2
4
4
  python-dateutil
5
5
  python-dateutil
6
6
  urllib3
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CryptoParser
3
- Version: 0.12.0
4
- Summary: Fast and flexible security protocol parser and generator
3
+ Version: 0.12.2
4
+ Summary: An analysis oriented security protocol parser and generator
5
5
  Author: Szilárd Pfeiffer
6
6
  Author-email: coroner@pfeifferszilard.hu
7
7
  Maintainer: Szilárd Pfeiffer
@@ -48,7 +48,7 @@ Description-Content-Type: text/x-rst
48
48
  License-File: LICENSE.txt
49
49
  Requires-Dist: asn1crypto
50
50
  Requires-Dist: attrs<22.0.1,>=20.3.0
51
- Requires-Dist: cryptodatahub==0.11.2
51
+ Requires-Dist: cryptodatahub==0.12.2
52
52
  Requires-Dist: python-dateutil
53
53
  Requires-Dist: py2-ipaddress; python_version < "3.4"
54
54
  Requires-Dist: typing; python_version < "3.5"
@@ -2,8 +2,8 @@
2
2
 
3
3
  __title__ = 'CryptoParser'
4
4
  __technical_name__ = __title__.lower()
5
- __version__ = '0.12.0'
6
- __description__ = 'Fast and flexible security protocol parser and generator'
5
+ __version__ = '0.12.2'
6
+ __description__ = 'An analysis oriented security protocol parser and generator'
7
7
  __author__ = 'Szilárd Pfeiffer'
8
8
  __author_email__ = 'coroner@pfeifferszilard.hu'
9
9
  __url__ = 'https://gitlab.com/coroner/' + __technical_name__
@@ -61,7 +61,6 @@ class SerializableTextEncoder(object):
61
61
 
62
62
  class Serializable(object): # pylint: disable=too-few-public-methods
63
63
  _MARKDOWN_RESULT_STRING_CLASSES = (
64
- CryptoDataParamsBase,
65
64
  ipaddress.IPv4Network,
66
65
  ipaddress.IPv6Network,
67
66
  urllib3.util.url.Url,
@@ -143,7 +142,7 @@ class Serializable(object): # pylint: disable=too-few-public-methods
143
142
  ])
144
143
  elif hasattr(obj, '__dict__'):
145
144
  result = Serializable._json_traverse(obj.__dict__, result_func)
146
- elif isinstance(obj, (list, tuple)):
145
+ elif isinstance(obj, (list, tuple, frozenset, set)):
147
146
  result = [Serializable._json_traverse(item, result_func) for item in obj]
148
147
  else:
149
148
  result = result_func(obj)
@@ -227,7 +226,7 @@ class Serializable(object): # pylint: disable=too-few-public-methods
227
226
  return not isinstance(obj, enum.Enum) and isinstance(obj, six.string_types + six.integer_types + (float, ))
228
227
 
229
228
  @classmethod
230
- def _markdown_result(cls, obj, level=0): # pylint: disable=too-many-branches
229
+ def _markdown_result(cls, obj, level=0): # pylint: disable=too-many-branches,too-many-return-statements
231
230
  if obj is None:
232
231
  result = cls.post_text_encoder('n/a', level)
233
232
  elif isinstance(obj, bool):
@@ -245,17 +244,19 @@ class Serializable(object): # pylint: disable=too-few-public-methods
245
244
  return cls.post_text_encoder(obj.value, level)
246
245
 
247
246
  return cls.post_text_encoder(obj.name, level)
248
- elif attr.has(type(obj)):
249
- result = cls._markdown_result_complex(obj, level)
250
247
  elif isinstance(obj, cls._MARKDOWN_RESULT_STRING_CLASSES):
251
248
  return False, str(obj)
252
249
  elif isinstance(obj, datetime.timedelta):
253
250
  return False, str(obj.seconds)
251
+ elif isinstance(obj, CryptoDataParamsBase) and hasattr(obj, '__str__'):
252
+ return False, str(obj)
253
+ elif attr.has(type(obj)):
254
+ result = cls._markdown_result_complex(obj, level)
254
255
  elif hasattr(obj, '_asdict'):
255
256
  result = cls._markdown_result(obj._asdict(), level)
256
257
  elif hasattr(obj, '__dict__') or isinstance(obj, dict):
257
258
  result = cls._markdown_result_complex(obj, level)
258
- elif isinstance(obj, (list, tuple, set, ArrayBase)):
259
+ elif isinstance(obj, (list, tuple, frozenset, set, ArrayBase)):
259
260
  result = cls._markdown_result_list(obj, level)
260
261
  elif isinstance(obj, (bytes, bytearray)):
261
262
  result = cls.post_text_encoder(bytes_to_hex_string(obj, separator=':', lowercase=False), level)
@@ -7,6 +7,7 @@ import binascii
7
7
  import collections
8
8
  import datetime
9
9
  import enum
10
+ import itertools
10
11
  import textwrap
11
12
 
12
13
  from collections import OrderedDict
@@ -26,7 +27,7 @@ from cryptodatahub.common.key import (
26
27
  PublicKeyParamsRsa,
27
28
  )
28
29
  from cryptodatahub.common.utils import hash_bytes
29
- from cryptodatahub.ssh.algorithm import SshHostKeyAlgorithm, SshEllipticCurveIdentifier
30
+ from cryptodatahub.ssh.algorithm import SshHostKeyAlgorithm, SshHostKeyType, SshEllipticCurveIdentifier
30
31
 
31
32
  from cryptoparser.common.base import (
32
33
  FourByteEnumComposer,
@@ -174,13 +175,13 @@ class SshHostKeyDSSBase(SshHostKeyBase):
174
175
 
175
176
  @classmethod
176
177
  def get_host_key_algorithms(cls):
177
- return [
178
- SshHostKeyAlgorithm.SSH_DSS,
179
- SshHostKeyAlgorithm.SSH_DSS_SHA224_SSH_COM,
180
- SshHostKeyAlgorithm.SSH_DSS_SHA256_SSH_COM,
181
- SshHostKeyAlgorithm.SSH_DSS_SHA384_SSH_COM,
182
- SshHostKeyAlgorithm.SSH_DSS_SHA512_SSH_COM,
183
- ]
178
+ return filter(
179
+ lambda host_key_algorithm: (
180
+ host_key_algorithm.value.key_type == SshHostKeyType.HOST_KEY and
181
+ host_key_algorithm.value.signature.value.key_type == Authentication.DSS
182
+ ),
183
+ SshHostKeyAlgorithm
184
+ )
184
185
 
185
186
  @classmethod
186
187
  def _parse_host_key(cls, parser):
@@ -233,13 +234,13 @@ class SshHostKeyRSABase(SshHostKeyBase):
233
234
 
234
235
  @classmethod
235
236
  def get_host_key_algorithms(cls):
236
- return [
237
- SshHostKeyAlgorithm.SSH_RSA,
238
- SshHostKeyAlgorithm.SSH_RSA_SHA224_SSH_COM,
239
- SshHostKeyAlgorithm.SSH_RSA_SHA256_SSH_COM,
240
- SshHostKeyAlgorithm.SSH_RSA_SHA384_SSH_COM,
241
- SshHostKeyAlgorithm.SSH_RSA_SHA512_SSH_COM,
242
- ]
237
+ return filter(
238
+ lambda host_key_algorithm: (
239
+ host_key_algorithm.value.key_type == SshHostKeyType.HOST_KEY and
240
+ host_key_algorithm.value.signature.value.key_type == Authentication.RSA
241
+ ),
242
+ SshHostKeyAlgorithm
243
+ )
243
244
 
244
245
  @classmethod
245
246
  def _parse_host_key(cls, parser):
@@ -279,11 +280,13 @@ class SshHostKeyECDSABase(SshHostKeyBase):
279
280
 
280
281
  @classmethod
281
282
  def get_host_key_algorithms(cls):
282
- return [
283
- SshHostKeyAlgorithm.ECDSA_SHA2_NISTP256,
284
- SshHostKeyAlgorithm.ECDSA_SHA2_NISTP384,
285
- SshHostKeyAlgorithm.ECDSA_SHA2_NISTP521,
286
- ]
283
+ return filter(
284
+ lambda host_key_algorithm: (
285
+ host_key_algorithm.value.key_type == SshHostKeyType.HOST_KEY and
286
+ host_key_algorithm.value.signature.value.key_type == Authentication.ECDSA
287
+ ),
288
+ SshHostKeyAlgorithm
289
+ )
287
290
 
288
291
  @classmethod
289
292
  def _parse_host_key(cls, parser):
@@ -328,7 +331,13 @@ class SshHostKeyEDDSABase(SshHostKeyBase):
328
331
 
329
332
  @classmethod
330
333
  def get_host_key_algorithms(cls):
331
- return [SshHostKeyAlgorithm.SSH_ED25519, ]
334
+ return filter(
335
+ lambda host_key_algorithm: (
336
+ host_key_algorithm.value.key_type == SshHostKeyType.HOST_KEY and
337
+ host_key_algorithm.value.signature.value.key_type == Authentication.EDDSA
338
+ ),
339
+ SshHostKeyAlgorithm
340
+ )
332
341
 
333
342
  @classmethod
334
343
  def _parse_host_key(cls, parser):
@@ -1043,6 +1052,7 @@ class SshHostCertificateV01ECDSA(SshHostCertificateV01ECDSABase, SshHostCertific
1043
1052
  SshHostKeyAlgorithm.ECDSA_SHA2_NISTP256_CERT_V01_OPENSSH_COM,
1044
1053
  SshHostKeyAlgorithm.ECDSA_SHA2_NISTP384_CERT_V01_OPENSSH_COM,
1045
1054
  SshHostKeyAlgorithm.ECDSA_SHA2_NISTP521_CERT_V01_OPENSSH_COM,
1055
+ SshHostKeyAlgorithm.ECDSA_SHA2_SECP256K1_OID_CERT_V01_OPENSSH_COM,
1046
1056
  ]
1047
1057
 
1048
1058
 
@@ -1069,20 +1079,10 @@ class SshX509Certificate(ParsableBase, SshHostKeyBase):
1069
1079
 
1070
1080
  @classmethod
1071
1081
  def get_host_key_algorithms(cls):
1072
- return [
1073
- SshHostKeyAlgorithm.X509V3_SIGN_RSA,
1074
- SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA1,
1075
- SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA224_SSH_COM,
1076
- SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA256_SSH_COM,
1077
- SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA384_SSH_COM,
1078
- SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA512_SSH_COM,
1079
- SshHostKeyAlgorithm.X509V3_SIGN_DSS,
1080
- SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA1,
1081
- SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA224_SSH_COM,
1082
- SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA256_SSH_COM,
1083
- SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA384_SSH_COM,
1084
- SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA512_SSH_COM,
1085
- ]
1082
+ return filter(
1083
+ lambda host_key_algorithm: host_key_algorithm.value.key_type == SshHostKeyType.X509_CERTIFICATE,
1084
+ SshHostKeyAlgorithm
1085
+ )
1086
1086
 
1087
1087
  @property
1088
1088
  def key_bytes(self):
@@ -1142,15 +1142,10 @@ class SshX509CertificateChain(ParsableBase, SshHostKeyBase):
1142
1142
 
1143
1143
  @classmethod
1144
1144
  def get_host_key_algorithms(cls):
1145
- return [
1146
- SshHostKeyAlgorithm.X509V3_SSH_DSS,
1147
- SshHostKeyAlgorithm.X509V3_SSH_RSA,
1148
- SshHostKeyAlgorithm.X509V3_RSA2048_SHA256,
1149
- SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_1_3_132_0_10,
1150
- SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_NISTP256,
1151
- SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_NISTP384,
1152
- SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_NISTP521,
1153
- ]
1145
+ return filter(
1146
+ lambda host_key_algorithm: host_key_algorithm.value.key_type == SshHostKeyType.X509_CERTIFICATE_CHAIN,
1147
+ SshHostKeyAlgorithm
1148
+ )
1154
1149
 
1155
1150
  @property
1156
1151
  def key_bytes(self):
@@ -1199,44 +1194,26 @@ class SshX509CertificateChain(ParsableBase, SshHostKeyBase):
1199
1194
 
1200
1195
 
1201
1196
  class SshHostPublicKeyVariant(VariantParsable):
1202
- _VARIANTS = collections.OrderedDict([
1203
- (SshHostKeyAlgorithm.SSH_ED25519, (SshHostKeyEDDSA, )),
1204
- (SshHostKeyAlgorithm.SSH_RSA, (SshHostKeyRSA, )),
1205
- (SshHostKeyAlgorithm.RSA_SHA2_256, (SshHostKeyRSA, )),
1206
- (SshHostKeyAlgorithm.RSA_SHA2_512, (SshHostKeyRSA, )),
1207
- (SshHostKeyAlgorithm.SSH_DSS, (SshHostKeyDSS, )),
1208
- (SshHostKeyAlgorithm.ECDSA_SHA2_NISTP256, (SshHostKeyECDSA, )),
1209
- (SshHostKeyAlgorithm.ECDSA_SHA2_NISTP384, (SshHostKeyECDSA, )),
1210
- (SshHostKeyAlgorithm.ECDSA_SHA2_NISTP521, (SshHostKeyECDSA, )),
1211
- (SshHostKeyAlgorithm.SSH_DSS_CERT_V00_OPENSSH_COM, (SshHostCertificateV00DSS, )),
1212
- (SshHostKeyAlgorithm.SSH_RSA_CERT_V00_OPENSSH_COM, (SshHostCertificateV00RSA, )),
1213
- (SshHostKeyAlgorithm.SSH_DSS_CERT_V01_OPENSSH_COM, (SshHostCertificateV01DSS, )),
1214
- (SshHostKeyAlgorithm.SSH_RSA_CERT_V01_OPENSSH_COM, (SshHostCertificateV01RSA, )),
1215
- (SshHostKeyAlgorithm.ECDSA_SHA2_NISTP256_CERT_V01_OPENSSH_COM, (SshHostCertificateV01ECDSA, )),
1216
- (SshHostKeyAlgorithm.ECDSA_SHA2_NISTP384_CERT_V01_OPENSSH_COM, (SshHostCertificateV01ECDSA, )),
1217
- (SshHostKeyAlgorithm.ECDSA_SHA2_NISTP521_CERT_V01_OPENSSH_COM, (SshHostCertificateV01ECDSA, )),
1218
- (SshHostKeyAlgorithm.SSH_ED25519_CERT_V01_OPENSSH_COM, (SshHostCertificateV01EDDSA, )),
1219
- (SshHostKeyAlgorithm.X509V3_RSA2048_SHA256, (SshX509CertificateChain, )),
1220
- (SshHostKeyAlgorithm.X509V3_SSH_DSS, (SshX509CertificateChain, )),
1221
- (SshHostKeyAlgorithm.X509V3_SSH_RSA, (SshX509CertificateChain, )),
1222
- (SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_1_3_132_0_10, (SshX509CertificateChain, )),
1223
- (SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_NISTP256, (SshX509CertificateChain, )),
1224
- (SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_NISTP384, (SshX509CertificateChain, )),
1225
- (SshHostKeyAlgorithm.X509V3_ECDSA_SHA2_NISTP521, (SshX509CertificateChain, )),
1226
- (SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA1, (SshX509Certificate, )),
1227
- (SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA1, (SshX509Certificate, )),
1228
- (SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA224_SSH_COM, (SshX509Certificate, )),
1229
- (SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA256_SSH_COM, (SshX509Certificate, )),
1230
- (SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA384_SSH_COM, (SshX509Certificate, )),
1231
- (SshHostKeyAlgorithm.X509V3_SIGN_RSA_SHA512_SSH_COM, (SshX509Certificate, )),
1232
- (SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA1, (SshX509Certificate, )),
1233
- (SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA224_SSH_COM, (SshX509Certificate, )),
1234
- (SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA256_SSH_COM, (SshX509Certificate, )),
1235
- (SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA384_SSH_COM, (SshX509Certificate, )),
1236
- (SshHostKeyAlgorithm.X509V3_SIGN_DSS_SHA512_SSH_COM, (SshX509Certificate, )),
1237
- (SshHostKeyAlgorithm.X509V3_SIGN_RSA, (SshX509Certificate, )),
1238
- (SshHostKeyAlgorithm.X509V3_SIGN_DSS, (SshX509Certificate, )),
1239
- ])
1197
+ _VARIANTS = collections.OrderedDict(itertools.chain.from_iterable([
1198
+ [
1199
+ (host_key_algorithm, (ssh_key_class, ))
1200
+ for host_key_algorithm in ssh_key_class.get_host_key_algorithms()
1201
+ ]
1202
+ for ssh_key_class in [
1203
+ SshHostKeyDSS,
1204
+ SshHostKeyECDSA,
1205
+ SshHostKeyEDDSA,
1206
+ SshHostKeyRSA,
1207
+ SshHostCertificateV00DSS,
1208
+ SshHostCertificateV00RSA,
1209
+ SshHostCertificateV01DSS,
1210
+ SshHostCertificateV01ECDSA,
1211
+ SshHostCertificateV01EDDSA,
1212
+ SshHostCertificateV01RSA,
1213
+ SshX509Certificate,
1214
+ SshX509CertificateChain,
1215
+ ]
1216
+ ]))
1240
1217
 
1241
1218
  @classmethod
1242
1219
  def _get_variants(cls):
@@ -78,8 +78,10 @@ class TlsProtocolVersion(ProtocolVersionBase, GradeableSimple):
78
78
  return self.minor < other.minor
79
79
  if self.is_draft:
80
80
  return other.version == TlsVersion.TLS1_3
81
+ if other.is_draft:
82
+ return self.version != TlsVersion.TLS1_3
81
83
 
82
- return self.version != TlsVersion.TLS1_3
84
+ return self.major < other.major
83
85
 
84
86
  @property
85
87
  def identifier(self):
@@ -1,6 +1,6 @@
1
1
  asn1crypto
2
2
  attrs>=20.3.0,<22.0.1
3
- cryptodatahub==0.11.2
3
+ cryptodatahub==0.12.2
4
4
  python-dateutil
5
5
  py2-ipaddress;python_version<"3.4"
6
6
  typing;python_version<"3.5"
File without changes
File without changes
File without changes
File without changes
File without changes