cryptoparser 0.12.2__tar.gz → 0.12.4__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.
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/CHANGELOG.rst +22 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4/CryptoParser.egg-info}/PKG-INFO +2 -2
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/CryptoParser.egg-info/requires.txt +1 -1
- {CryptoParser-0.12.2/CryptoParser.egg-info → cryptoparser-0.12.4}/PKG-INFO +2 -2
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/__setup__.py +1 -1
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/base.py +49 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/dnsrec/record.py +33 -7
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/requirements.txt +1 -1
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/CONTRIBUTING.rst +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/CryptoParser.egg-info/SOURCES.txt +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/CryptoParser.egg-info/dependency_links.txt +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/CryptoParser.egg-info/top_level.txt +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/LICENSE.txt +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/MANIFEST.in +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/README.rst +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/__init__.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/__init__.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/classes.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/exception.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/field.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/parse.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/utils.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/common/x509.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/dnsrec/__init__.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/dnsrec/txt.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/httpx/__init__.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/httpx/header.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/httpx/parse.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/httpx/version.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/ssh/__init__.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/ssh/key.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/ssh/record.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/ssh/subprotocol.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/ssh/version.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/__init__.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/algorithm.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/ciphersuite.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/extension.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/grease.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/ldap.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/mysql.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/openvpn.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/postgresql.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/rdp.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/record.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/subprotocol.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/cryptoparser/tls/version.py +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/setup.cfg +0 -0
- {CryptoParser-0.12.2 → cryptoparser-0.12.4}/setup.py +0 -0
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
Changelog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
------
|
|
6
|
+
0.12.4
|
|
7
|
+
------
|
|
8
|
+
|
|
9
|
+
Notable fixes
|
|
10
|
+
=============
|
|
11
|
+
|
|
12
|
+
- DNS
|
|
13
|
+
|
|
14
|
+
- handle TXT records that contain multiple string (#84)
|
|
15
|
+
|
|
16
|
+
-------------------
|
|
17
|
+
0.12.3 - 2024-03-05
|
|
18
|
+
-------------------
|
|
19
|
+
|
|
20
|
+
Notable fixes
|
|
21
|
+
=============
|
|
22
|
+
|
|
23
|
+
- DNS
|
|
24
|
+
|
|
25
|
+
- handle private values of RRSIG type (#83)
|
|
26
|
+
|
|
5
27
|
-------------------
|
|
6
28
|
0.12.2 - 2024-01-11
|
|
7
29
|
-------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: CryptoParser
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.4
|
|
4
4
|
Summary: An analysis oriented security protocol parser and generator
|
|
5
5
|
Author: Szilárd Pfeiffer
|
|
6
6
|
Author-email: coroner@pfeifferszilard.hu
|
|
@@ -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.12.
|
|
51
|
+
Requires-Dist: cryptodatahub==0.12.4
|
|
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
|
Metadata-Version: 2.1
|
|
2
2
|
Name: CryptoParser
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.4
|
|
4
4
|
Summary: An analysis oriented security protocol parser and generator
|
|
5
5
|
Author: Szilárd Pfeiffer
|
|
6
6
|
Author-email: coroner@pfeifferszilard.hu
|
|
@@ -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.12.
|
|
51
|
+
Requires-Dist: cryptodatahub==0.12.4
|
|
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,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
__title__ = 'CryptoParser'
|
|
4
4
|
__technical_name__ = __title__.lower()
|
|
5
|
-
__version__ = '0.12.
|
|
5
|
+
__version__ = '0.12.4'
|
|
6
6
|
__description__ = 'An analysis oriented security protocol parser and generator'
|
|
7
7
|
__author__ = 'Szilárd Pfeiffer'
|
|
8
8
|
__author_email__ = 'coroner@pfeifferszilard.hu'
|
|
@@ -1044,3 +1044,52 @@ class OpaqueEnumComposer(enum.Enum):
|
|
|
1044
1044
|
@classmethod
|
|
1045
1045
|
def get_encoding(cls):
|
|
1046
1046
|
return 'utf-8'
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
@attr.s
|
|
1050
|
+
class NumericRangeParsableBase(ParsableBase, Serializable):
|
|
1051
|
+
value = attr.ib(validator=attr.validators.instance_of(six.integer_types))
|
|
1052
|
+
|
|
1053
|
+
@value.validator
|
|
1054
|
+
def _validator_variant(self, _, value):
|
|
1055
|
+
if value < self._get_value_min():
|
|
1056
|
+
raise InvalidValue(value, type(self))
|
|
1057
|
+
|
|
1058
|
+
if value > self._get_value_max():
|
|
1059
|
+
raise InvalidValue(value, type(self))
|
|
1060
|
+
|
|
1061
|
+
@classmethod
|
|
1062
|
+
@abc.abstractmethod
|
|
1063
|
+
def _get_value_min(cls):
|
|
1064
|
+
raise NotImplementedError()
|
|
1065
|
+
|
|
1066
|
+
@classmethod
|
|
1067
|
+
@abc.abstractmethod
|
|
1068
|
+
def _get_value_max(cls):
|
|
1069
|
+
raise NotImplementedError()
|
|
1070
|
+
|
|
1071
|
+
@classmethod
|
|
1072
|
+
@abc.abstractmethod
|
|
1073
|
+
def _get_value_length(cls):
|
|
1074
|
+
raise NotImplementedError()
|
|
1075
|
+
|
|
1076
|
+
@classmethod
|
|
1077
|
+
def _parse(cls, parsable):
|
|
1078
|
+
parser = ParserBinary(parsable)
|
|
1079
|
+
|
|
1080
|
+
parser.parse_numeric('value', cls._get_value_length())
|
|
1081
|
+
|
|
1082
|
+
return cls(**parser), parser.parsed_length
|
|
1083
|
+
|
|
1084
|
+
def compose(self):
|
|
1085
|
+
composer = ComposerBinary()
|
|
1086
|
+
|
|
1087
|
+
composer.compose_numeric(self.value, self._get_value_length())
|
|
1088
|
+
|
|
1089
|
+
return composer.composed
|
|
1090
|
+
|
|
1091
|
+
def __str__(self):
|
|
1092
|
+
return str(self.value)
|
|
1093
|
+
|
|
1094
|
+
def _as_markdown(self, level):
|
|
1095
|
+
return self._markdown_result(str(self), level)
|
|
@@ -20,7 +20,7 @@ from cryptodatahub.common.key import (
|
|
|
20
20
|
|
|
21
21
|
from cryptodatahub.dnsrec.algorithm import DnsRrType, DnsSecAlgorithm, DnsSecDigestType
|
|
22
22
|
|
|
23
|
-
from cryptoparser.common.base import OneByteEnumParsable, Serializable, TwoByteEnumParsable
|
|
23
|
+
from cryptoparser.common.base import NumericRangeParsableBase, OneByteEnumParsable, Serializable, TwoByteEnumParsable
|
|
24
24
|
from cryptoparser.common.exception import NotEnoughData
|
|
25
25
|
from cryptoparser.common.parse import ByteOrder, ComposerBinary, ParsableBase, ParserBinary
|
|
26
26
|
|
|
@@ -318,6 +318,20 @@ class DnsRrTypeFactory(TwoByteEnumParsable):
|
|
|
318
318
|
raise NotImplementedError()
|
|
319
319
|
|
|
320
320
|
|
|
321
|
+
class DnsRrTypePrivate(NumericRangeParsableBase):
|
|
322
|
+
@classmethod
|
|
323
|
+
def _get_value_min(cls):
|
|
324
|
+
return 0xff00
|
|
325
|
+
|
|
326
|
+
@classmethod
|
|
327
|
+
def _get_value_max(cls):
|
|
328
|
+
return 0xfffe
|
|
329
|
+
|
|
330
|
+
@classmethod
|
|
331
|
+
def _get_value_length(cls):
|
|
332
|
+
return 2
|
|
333
|
+
|
|
334
|
+
|
|
321
335
|
@attr.s
|
|
322
336
|
class DnsNameUncompressed(ParsableBase, Serializable):
|
|
323
337
|
labels = attr.ib(
|
|
@@ -373,7 +387,7 @@ class DnsNameUncompressed(ParsableBase, Serializable):
|
|
|
373
387
|
class DnsRecordRrsig(ParsableBase): # pylint: disable=too-many-instance-attributes
|
|
374
388
|
HEADER_SIZE = 24
|
|
375
389
|
|
|
376
|
-
type_covered = attr.ib(validator=attr.validators.instance_of(DnsRrType))
|
|
390
|
+
type_covered = attr.ib(validator=attr.validators.instance_of((DnsRrType, DnsRrTypePrivate)))
|
|
377
391
|
algorithm = attr.ib(validator=attr.validators.instance_of(DnsSecAlgorithm))
|
|
378
392
|
labels = attr.ib(validator=attr.validators.instance_of(six.integer_types))
|
|
379
393
|
original_ttl = attr.ib(
|
|
@@ -387,7 +401,10 @@ class DnsRecordRrsig(ParsableBase): # pylint: disable=too-many-instance-attribu
|
|
|
387
401
|
converter=DnsNameUncompressed.convert,
|
|
388
402
|
validator=attr.validators.instance_of(DnsNameUncompressed)
|
|
389
403
|
)
|
|
390
|
-
signature = attr.ib(
|
|
404
|
+
signature = attr.ib(
|
|
405
|
+
validator=attr.validators.instance_of((bytes, bytearray)),
|
|
406
|
+
metadata={'human_friendly': False}
|
|
407
|
+
)
|
|
391
408
|
|
|
392
409
|
@classmethod
|
|
393
410
|
def _parse(cls, parsable):
|
|
@@ -396,7 +413,10 @@ class DnsRecordRrsig(ParsableBase): # pylint: disable=too-many-instance-attribu
|
|
|
396
413
|
|
|
397
414
|
parser = ParserBinary(parsable)
|
|
398
415
|
|
|
399
|
-
|
|
416
|
+
try:
|
|
417
|
+
parser.parse_parsable('type_covered', DnsRrTypeFactory)
|
|
418
|
+
except InvalidValue:
|
|
419
|
+
parser.parse_parsable('type_covered', DnsRrTypePrivate)
|
|
400
420
|
parser.parse_parsable('algorithm', DnsSecAlgorithmFactory)
|
|
401
421
|
parser.parse_numeric('labels', 1)
|
|
402
422
|
parser.parse_numeric('original_ttl', 4)
|
|
@@ -411,7 +431,10 @@ class DnsRecordRrsig(ParsableBase): # pylint: disable=too-many-instance-attribu
|
|
|
411
431
|
def compose(self):
|
|
412
432
|
composer = ComposerBinary()
|
|
413
433
|
|
|
414
|
-
|
|
434
|
+
if isinstance(self.type_covered, DnsRrType):
|
|
435
|
+
composer.compose_numeric_enum_coded(self.type_covered)
|
|
436
|
+
else:
|
|
437
|
+
composer.compose_parsable(self.type_covered)
|
|
415
438
|
composer.compose_numeric_enum_coded(self.algorithm)
|
|
416
439
|
composer.compose_numeric(self.labels, 1)
|
|
417
440
|
composer.compose_numeric(self.original_ttl, 4)
|
|
@@ -467,10 +490,13 @@ class DnsRecordTxt(ParsableBase):
|
|
|
467
490
|
raise NotEnoughData(cls.HEADER_SIZE - len(parsable))
|
|
468
491
|
|
|
469
492
|
parser = ParserBinary(parsable)
|
|
493
|
+
value = ''
|
|
470
494
|
|
|
471
|
-
parser.
|
|
495
|
+
while parser.unparsed_length:
|
|
496
|
+
parser.parse_string('value', 1, encoding='ascii')
|
|
497
|
+
value += parser['value']
|
|
472
498
|
|
|
473
|
-
return cls(
|
|
499
|
+
return cls(value), parser.parsed_length
|
|
474
500
|
|
|
475
501
|
def compose(self):
|
|
476
502
|
composer = ComposerBinary()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|