cryptoparser 0.10.2__tar.gz → 0.11.0__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.10.2 → CryptoParser-0.11.0}/CHANGELOG.rst +71 -27
  2. {CryptoParser-0.10.2 → CryptoParser-0.11.0/CryptoParser.egg-info}/PKG-INFO +11 -6
  3. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/CryptoParser.egg-info/SOURCES.txt +3 -0
  4. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/CryptoParser.egg-info/requires.txt +1 -1
  5. {CryptoParser-0.10.2/CryptoParser.egg-info → CryptoParser-0.11.0}/PKG-INFO +11 -6
  6. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/README.rst +8 -3
  7. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/__setup__.py +1 -1
  8. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/base.py +27 -7
  9. CryptoParser-0.11.0/cryptoparser/dnsrec/record.py +480 -0
  10. CryptoParser-0.11.0/cryptoparser/dnsrec/txt.py +911 -0
  11. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/ssh/key.py +4 -3
  12. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/ssh/version.py +9 -1
  13. CryptoParser-0.11.0/cryptoparser/tls/__init__.py +0 -0
  14. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/version.py +13 -1
  15. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/requirements.txt +1 -1
  16. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/setup.py +2 -1
  17. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/CONTRIBUTING.rst +0 -0
  18. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/CryptoParser.egg-info/dependency_links.txt +0 -0
  19. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/CryptoParser.egg-info/top_level.txt +0 -0
  20. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/LICENSE.txt +0 -0
  21. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/MANIFEST.in +0 -0
  22. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/__init__.py +0 -0
  23. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/__init__.py +0 -0
  24. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/classes.py +0 -0
  25. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/exception.py +0 -0
  26. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/field.py +0 -0
  27. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/parse.py +0 -0
  28. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/utils.py +0 -0
  29. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/common/x509.py +0 -0
  30. {CryptoParser-0.10.2/cryptoparser/httpx → CryptoParser-0.11.0/cryptoparser/dnsrec}/__init__.py +0 -0
  31. {CryptoParser-0.10.2/cryptoparser/ssh → CryptoParser-0.11.0/cryptoparser/httpx}/__init__.py +0 -0
  32. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/httpx/header.py +0 -0
  33. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/httpx/parse.py +0 -0
  34. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/httpx/version.py +0 -0
  35. {CryptoParser-0.10.2/cryptoparser/tls → CryptoParser-0.11.0/cryptoparser/ssh}/__init__.py +0 -0
  36. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/ssh/record.py +0 -0
  37. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/ssh/subprotocol.py +0 -0
  38. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/algorithm.py +0 -0
  39. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/ciphersuite.py +0 -0
  40. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/extension.py +0 -0
  41. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/grease.py +0 -0
  42. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/ldap.py +0 -0
  43. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/mysql.py +0 -0
  44. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/openvpn.py +0 -0
  45. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/postgresql.py +0 -0
  46. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/rdp.py +0 -0
  47. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/record.py +0 -0
  48. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/cryptoparser/tls/subprotocol.py +0 -0
  49. {CryptoParser-0.10.2 → CryptoParser-0.11.0}/setup.cfg +0 -0
@@ -1,11 +1,36 @@
1
+ =========
1
2
  Changelog
2
3
  =========
3
4
 
5
+ -------------------
6
+ 0.11.0 - 2023-10-28
7
+ -------------------
8
+
9
+ Features
10
+ ========
11
+
12
+ - Generic
13
+
14
+ - add post processing capability to Markdown output (#73)
15
+ - use class give grade for public keys (#73)
16
+
17
+ -------------------
18
+ 0.10.3 - 2023-10-12
19
+ -------------------
20
+
21
+ Notable fixes
22
+ =============
23
+
24
+ - Generic
25
+
26
+ - add missing dnsrec module to the packaging (#75)
27
+
28
+ -------------------
4
29
  0.10.2 - 2023-08-28
5
30
  -------------------
6
31
 
7
32
  Features
8
- ~~~~~~~~
33
+ ========
9
34
 
10
35
  - DNS
11
36
 
@@ -18,11 +43,12 @@ Features
18
43
  - `SMTP MTA Strict Transport Security <https://www.rfc-editor.org/rfc/rfc8461>`__ (MTA-STS)
19
44
  - `SMTP TLS Reporting <https://www.rfc-editor.org/rfc/rfc8460>`__ (TLSRPT)
20
45
 
46
+ -------------------
21
47
  0.10.1 - 2023-08-29
22
48
  -------------------
23
49
 
24
50
  Features
25
- ~~~~~~~~
51
+ ========
26
52
 
27
53
  - DNS
28
54
 
@@ -32,21 +58,23 @@ Features
32
58
  - `DS <https://www.rfc-editor.org/rfc/rfc4034#section-5>`__
33
59
  - `RRSIG <https://www.rfc-editor.org/rfc/rfc4034#section-3>`__
34
60
 
61
+ -------------------
35
62
  0.10.0 - 2023-08-03
36
63
  -------------------
37
64
 
38
65
  Notable fixes
39
- ~~~~~~~~~~~~~
66
+ =============
40
67
 
41
68
  - Generic
42
69
 
43
70
  - Markdown output of attr-based classes
44
71
 
72
+ ------------------
45
73
  0.9.1 - 2022-06-22
46
74
  ------------------
47
75
 
48
76
  Features
49
- ~~~~~~~~
77
+ ========
50
78
 
51
79
  - TLS (``tls``)
52
80
 
@@ -55,11 +83,12 @@ Features
55
83
  - add parser for `signed certificate timestamp <https://www.rfc-editor.org/rfc/rfc6962.html#section-3.3.1>`__
56
84
  entries (#52)
57
85
 
86
+ ------------------
58
87
  0.9.0 - 2023-04-29
59
88
  ------------------
60
89
 
61
90
  Features
62
- ~~~~~~~~
91
+ ========
63
92
 
64
93
  - TLS (``tls``)
65
94
 
@@ -67,21 +96,23 @@ Features
67
96
 
68
97
  - protocol item classes for `OpenVPN <https://en.wikipedia.org/wiki/OpenVPN>`__ support (#62)
69
98
 
99
+ ------------------
70
100
  0.8.5 - 2023-04-02
71
101
  ------------------
72
102
 
73
103
  Features
74
- ~~~~~~~~
104
+ ========
75
105
 
76
106
  - Generic
77
107
 
78
108
  - move data classes to `CryptoDataHub repository <https://gitlab.com/coroner/cryptodatahub>`__ (#67)
79
109
 
110
+ ------------------
80
111
  0.8.4 - 2023-01-22
81
112
  ------------------
82
113
 
83
114
  Features
84
- ~~~~~~~~
115
+ ========
85
116
 
86
117
  - TLS (``tls``)
87
118
 
@@ -89,11 +120,12 @@ Features
89
120
 
90
121
  - protocol item classes for MySQL support (#61)
91
122
 
123
+ ------------------
92
124
  0.8.2 - 2022-10-10
93
125
  ------------------
94
126
 
95
127
  Features
96
- ~~~~~~~~
128
+ ========
97
129
 
98
130
  - TLS (``tls``)
99
131
 
@@ -110,11 +142,12 @@ Features
110
142
  - add `host certificate <https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.certkeys>`__ related
111
143
  classes (#53)
112
144
 
145
+ ------------------
113
146
  0.8.0 - 2022-01-18
114
147
  ------------------
115
148
 
116
149
  Features
117
- ~~~~~~~~
150
+ ========
118
151
 
119
152
  - SSH (``ssh``)
120
153
 
@@ -126,40 +159,44 @@ Features
126
159
 
127
160
  - add `software version <https://tools.ietf.org/html/rfc4253#section-4.2>`__ related classes (#46)
128
161
 
162
+ ------------------
129
163
  0.7.3 - 2021-12-26
130
164
  ------------------
131
165
 
132
166
  Notable fixes
133
- ~~~~~~~~~~~~~
167
+ =============
134
168
 
135
169
  - Generic
136
170
 
137
171
  - Fix time zone handlind in datetime parser
138
172
 
173
+ ------------------
139
174
  0.7.2 - 2021-10-07
140
175
  ------------------
141
176
 
142
177
  Other
143
- ~~~~~
178
+ =====
144
179
 
145
180
  - switch to Markdown format in changelog, readme and contributing
146
181
  - update contributing to the latest version from contribution-guide.org
147
182
 
183
+ ------------------
148
184
  0.7.1 - 2021-09-20
149
185
  ------------------
150
186
 
151
187
  Features
152
- ~~~~~~~~
188
+ ========
153
189
 
154
190
  - TLS (``tls``)
155
191
 
156
192
  - protocol item classes for PostgreSQL support (#44)
157
193
 
194
+ ------------------
158
195
  0.7.0 - 2021-09-02
159
196
  ------------------
160
197
 
161
198
  Features
162
- ~~~~~~~~
199
+ ========
163
200
 
164
201
  - TLS (``tls``)
165
202
 
@@ -174,11 +211,12 @@ Features
174
211
  - add `renegotiation indication <https://www.rfc-editor.org/rfc/rfc5746.html>`__ extension related messages (#40)
175
212
  - add `session ticket <https://www.rfc-editor.org/rfc/rfc5077.html>`__ extension related messages (#40)
176
213
 
214
+ ------------------
177
215
  0.6.0 - 2021-05-27
178
216
  ------------------
179
217
 
180
218
  Features
181
- ~~~~~~~~
219
+ ========
182
220
 
183
221
  - HTTP(S) (``http``)
184
222
 
@@ -225,11 +263,12 @@ Features
225
263
 
226
264
  - add `signature algorithms <https://tools.ietf.org/html/rfc8446#section-4.2.3>`__ relate to version 1.3 (#20)
227
265
 
266
+ ------------------
228
267
  0.5.0 - 2021-04-08
229
268
  ------------------
230
269
 
231
270
  Features
232
- ~~~~~~~~
271
+ ========
233
272
 
234
273
  - Generic
235
274
 
@@ -248,7 +287,7 @@ Features
248
287
  - add `algorithm negotiation <https://tools.ietf.org/html/rfc4253#section-7.1>`__ related messages (#21)
249
288
 
250
289
  Usability
251
- ~~~~~~~~~
290
+ =========
252
291
 
253
292
  - Generic
254
293
 
@@ -256,11 +295,12 @@ Usability
256
295
  - use human readable algorithms names in Markdown output (#32)
257
296
  - add human readable descriptions for exceptions (#33)
258
297
 
298
+ ------------------
259
299
  0.4.0 - 2021-01-30
260
300
  ------------------
261
301
 
262
302
  Features
263
- ~~~~~~~~
303
+ ========
264
304
 
265
305
  - TLS (``tls``)
266
306
 
@@ -273,24 +313,25 @@ Features
273
313
  - add `client public key request <https://tools.ietf.org/html/rfc2246#section-7.4.4>`__ related messages (#24)
274
314
 
275
315
  Improvements
276
- ~~~~~~~~~~~~
316
+ ============
277
317
 
278
318
  - Generic
279
319
 
280
320
  - add `OID <https://en.wikipedia.org/wiki/Object_identifier>`__ to algorithms
281
321
 
322
+ ------------------
282
323
  0.3.1 - 2020-09-15
283
324
  ------------------
284
325
 
285
326
  Features
286
- ~~~~~~~~
327
+ ========
287
328
 
288
329
  - Generic
289
330
 
290
331
  - `Markdown <https://en.wikipedia.org/wiki/Markdown>`__ serializable format (#19)
291
332
 
292
333
  Improvements
293
- ~~~~~~~~~~~~
334
+ ============
294
335
 
295
336
  - TLS (``tls``)
296
337
 
@@ -306,7 +347,7 @@ Improvements
306
347
  - add missing SSLv3 cipher suites (#15)
307
348
 
308
349
  Notable fixes
309
- ~~~~~~~~~~~~~
350
+ =============
310
351
 
311
352
  - Generic
312
353
 
@@ -318,11 +359,12 @@ Notable fixes
318
359
 
319
360
  - fix some cipher suite names and parameters (#7, #10)
320
361
 
362
+ ------------------
321
363
  0.3.0 - 2020-04-30
322
364
  ------------------
323
365
 
324
366
  Features
325
- ~~~~~~~~
367
+ ========
326
368
 
327
369
  - TLS (``tls``)
328
370
 
@@ -331,31 +373,33 @@ Features
331
373
  calculation for TLS client hello (#2)
332
374
 
333
375
  Notable fixes
334
- ~~~~~~~~~~~~~
376
+ =============
335
377
 
336
378
  - TLS (``tls``)
337
379
 
338
380
  - compose all the messages in case of a TLS record (#1)
339
381
 
340
382
  Refactor
341
- ~~~~~~~~
383
+ ========
342
384
 
343
385
  - use attrs to avoid boilerplates (#3)
344
386
 
387
+ ------------------
345
388
  0.2.0 - 2019-12-02
346
389
  ------------------
347
390
 
348
391
  Notable fixes
349
- ~~~~~~~~~~~~~
392
+ =============
350
393
 
351
394
  - clarify TLS related parameter names
352
395
  - several packaging fixes
353
396
 
397
+ ------------------
354
398
  0.1.0 - 2019-03-20
355
399
  ------------------
356
400
 
357
401
  Features
358
- ~~~~~~~~
402
+ ========
359
403
 
360
404
  - added TLS record protocol support
361
405
  - added TLS ChangeCipherSpec message support
@@ -365,7 +409,7 @@ Features
365
409
  - added SSL support
366
410
 
367
411
  Improvements
368
- ~~~~~~~~~~~~
412
+ ============
369
413
 
370
414
  - added serialization support for classes
371
415
  - added elliptic-curve related descriptive classes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CryptoParser
3
- Version: 0.10.2
3
+ Version: 0.11.0
4
4
  Summary: Fast and flexible security protocol parser and generator
5
5
  Author: Szilárd Pfeiffer
6
6
  Author-email: coroner@pfeifferszilard.hu
@@ -12,7 +12,7 @@ Project-URL: Changelog, https://cryptoparser.readthedocs.io/en/latest/changelog
12
12
  Project-URL: Documentation, https://cryptoparser.readthedocs.io/en/latest/
13
13
  Project-URL: Issues, https://gitlab.com/coroner/cryptoparser/-/issues
14
14
  Project-URL: Source, https://gitlab.com/coroner/cryptoparser
15
- Keywords: ssl tls gost ja3 ldap rdp ssh hsts
15
+ Keywords: ssl tls gost ja3 ldap rdp ssh hsts dns
16
16
  Classifier: Development Status :: 4 - Beta
17
17
  Classifier: Environment :: Console
18
18
  Classifier: Framework :: tox
@@ -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.10.0
51
+ Requires-Dist: cryptodatahub>=0.11.0
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"
@@ -70,38 +70,42 @@ is neither a comprehensive nor a secure implementation of any cryptographic prot
70
70
  testing cryptographic libraries or analysing cryptography-realted settings of application servers such as
71
71
  `CryptoLyzer <https://cryptolyzer.readthedocs.io/>`__ does.
72
72
 
73
+ -----
73
74
  Usage
74
75
  -----
75
76
 
76
77
  Pip
77
- ^^^
78
+ ===
78
79
 
79
80
  .. code:: shell
80
81
 
81
82
  pip install cryptoparser
82
83
 
84
+ -------
83
85
  Support
84
86
  -------
85
87
 
86
88
  Python implementation
87
- ^^^^^^^^^^^^^^^^^^^^^
89
+ =====================
88
90
 
89
91
  - CPython (2.7, 3.3+)
90
92
  - PyPy (2.7, 3.5+)
91
93
 
92
94
  Operating systems
93
- ^^^^^^^^^^^^^^^^^
95
+ =================
94
96
 
95
97
  - Linux
96
98
  - macOS
97
99
  - Windows
98
100
 
101
+ -------------
99
102
  Documentation
100
103
  -------------
101
104
 
102
105
  Detailed `documentation <https://cryptoparser.readthedocs.io>`__ is available on the project's
103
106
  `Read the Docs <https://readthedocs.com>`__ site.
104
107
 
108
+ -------
105
109
  License
106
110
  -------
107
111
 
@@ -111,6 +115,7 @@ The `code <https://gitlab.com/coroner/cryptoparser>`__ is available under the te
111
115
  A non-comprehensive, but straightforward description of MPL 2.0 can be found at
112
116
  `Choose an open source license <https://choosealicense.com/licenses#mpl-2.0>`__ website.
113
117
 
118
+ -------
114
119
  Credits
115
120
  -------
116
121
 
@@ -20,6 +20,9 @@ cryptoparser/common/field.py
20
20
  cryptoparser/common/parse.py
21
21
  cryptoparser/common/utils.py
22
22
  cryptoparser/common/x509.py
23
+ cryptoparser/dnsrec/__init__.py
24
+ cryptoparser/dnsrec/record.py
25
+ cryptoparser/dnsrec/txt.py
23
26
  cryptoparser/httpx/__init__.py
24
27
  cryptoparser/httpx/header.py
25
28
  cryptoparser/httpx/parse.py
@@ -1,6 +1,6 @@
1
1
  asn1crypto
2
2
  attrs<22.0.1,>=20.3.0
3
- cryptodatahub>=0.10.0
3
+ cryptodatahub>=0.11.0
4
4
  python-dateutil
5
5
  python-dateutil
6
6
  urllib3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CryptoParser
3
- Version: 0.10.2
3
+ Version: 0.11.0
4
4
  Summary: Fast and flexible security protocol parser and generator
5
5
  Author: Szilárd Pfeiffer
6
6
  Author-email: coroner@pfeifferszilard.hu
@@ -12,7 +12,7 @@ Project-URL: Changelog, https://cryptoparser.readthedocs.io/en/latest/changelog
12
12
  Project-URL: Documentation, https://cryptoparser.readthedocs.io/en/latest/
13
13
  Project-URL: Issues, https://gitlab.com/coroner/cryptoparser/-/issues
14
14
  Project-URL: Source, https://gitlab.com/coroner/cryptoparser
15
- Keywords: ssl tls gost ja3 ldap rdp ssh hsts
15
+ Keywords: ssl tls gost ja3 ldap rdp ssh hsts dns
16
16
  Classifier: Development Status :: 4 - Beta
17
17
  Classifier: Environment :: Console
18
18
  Classifier: Framework :: tox
@@ -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.10.0
51
+ Requires-Dist: cryptodatahub>=0.11.0
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"
@@ -70,38 +70,42 @@ is neither a comprehensive nor a secure implementation of any cryptographic prot
70
70
  testing cryptographic libraries or analysing cryptography-realted settings of application servers such as
71
71
  `CryptoLyzer <https://cryptolyzer.readthedocs.io/>`__ does.
72
72
 
73
+ -----
73
74
  Usage
74
75
  -----
75
76
 
76
77
  Pip
77
- ^^^
78
+ ===
78
79
 
79
80
  .. code:: shell
80
81
 
81
82
  pip install cryptoparser
82
83
 
84
+ -------
83
85
  Support
84
86
  -------
85
87
 
86
88
  Python implementation
87
- ^^^^^^^^^^^^^^^^^^^^^
89
+ =====================
88
90
 
89
91
  - CPython (2.7, 3.3+)
90
92
  - PyPy (2.7, 3.5+)
91
93
 
92
94
  Operating systems
93
- ^^^^^^^^^^^^^^^^^
95
+ =================
94
96
 
95
97
  - Linux
96
98
  - macOS
97
99
  - Windows
98
100
 
101
+ -------------
99
102
  Documentation
100
103
  -------------
101
104
 
102
105
  Detailed `documentation <https://cryptoparser.readthedocs.io>`__ is available on the project's
103
106
  `Read the Docs <https://readthedocs.com>`__ site.
104
107
 
108
+ -------
105
109
  License
106
110
  -------
107
111
 
@@ -111,6 +115,7 @@ The `code <https://gitlab.com/coroner/cryptoparser>`__ is available under the te
111
115
  A non-comprehensive, but straightforward description of MPL 2.0 can be found at
112
116
  `Choose an open source license <https://choosealicense.com/licenses#mpl-2.0>`__ website.
113
117
 
118
+ -------
114
119
  Credits
115
120
  -------
116
121
 
@@ -3,38 +3,42 @@ is neither a comprehensive nor a secure implementation of any cryptographic prot
3
3
  testing cryptographic libraries or analysing cryptography-realted settings of application servers such as
4
4
  `CryptoLyzer <https://cryptolyzer.readthedocs.io/>`__ does.
5
5
 
6
+ -----
6
7
  Usage
7
8
  -----
8
9
 
9
10
  Pip
10
- ^^^
11
+ ===
11
12
 
12
13
  .. code:: shell
13
14
 
14
15
  pip install cryptoparser
15
16
 
17
+ -------
16
18
  Support
17
19
  -------
18
20
 
19
21
  Python implementation
20
- ^^^^^^^^^^^^^^^^^^^^^
22
+ =====================
21
23
 
22
24
  - CPython (2.7, 3.3+)
23
25
  - PyPy (2.7, 3.5+)
24
26
 
25
27
  Operating systems
26
- ^^^^^^^^^^^^^^^^^
28
+ =================
27
29
 
28
30
  - Linux
29
31
  - macOS
30
32
  - Windows
31
33
 
34
+ -------------
32
35
  Documentation
33
36
  -------------
34
37
 
35
38
  Detailed `documentation <https://cryptoparser.readthedocs.io>`__ is available on the project's
36
39
  `Read the Docs <https://readthedocs.com>`__ site.
37
40
 
41
+ -------
38
42
  License
39
43
  -------
40
44
 
@@ -44,6 +48,7 @@ The `code <https://gitlab.com/coroner/cryptoparser>`__ is available under the te
44
48
  A non-comprehensive, but straightforward description of MPL 2.0 can be found at
45
49
  `Choose an open source license <https://choosealicense.com/licenses#mpl-2.0>`__ website.
46
50
 
51
+ -------
47
52
  Credits
48
53
  -------
49
54
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  __title__ = 'CryptoParser'
4
4
  __technical_name__ = __title__.lower()
5
- __version__ = '0.10.2'
5
+ __version__ = '0.11.0'
6
6
  __description__ = 'Fast and flexible security protocol parser and generator'
7
7
  __author__ = 'Szilárd Pfeiffer'
8
8
  __author_email__ = 'coroner@pfeifferszilard.hu'
@@ -1,4 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
+ # pylint: disable=too-many-lines
2
3
 
3
4
  import abc
4
5
  import enum
@@ -19,6 +20,7 @@ import attr
19
20
  import six
20
21
 
21
22
  from cryptodatahub.common.exception import InvalidValue
23
+ from cryptodatahub.common.grade import Gradeable
22
24
  from cryptodatahub.common.types import CryptoDataEnumCodedBase, CryptoDataParamsBase
23
25
 
24
26
  from cryptoparser.common.parse import (
@@ -45,7 +47,19 @@ _default.default = json.JSONEncoder().default
45
47
  json.JSONEncoder.default = _default
46
48
 
47
49
 
50
+ class SerializableTextEncoder(object):
51
+ def __call__(self, obj, level):
52
+ if isinstance(obj, six.string_types):
53
+ string_result = obj
54
+ else:
55
+ string_result = str(obj)
56
+
57
+ return False, string_result
58
+
59
+
48
60
  class Serializable(object): # pylint: disable=too-few-public-methods
61
+ post_text_encoder = SerializableTextEncoder()
62
+
49
63
  @staticmethod
50
64
  def _filter_out_non_human_friendly(obj, dict_value, human_friendly_only):
51
65
  if not attr.has(type(obj)) or not human_friendly_only:
@@ -143,7 +157,11 @@ class Serializable(object): # pylint: disable=too-few-public-methods
143
157
  else:
144
158
  human_readable_name = ' '.join(name.split('_')).title()
145
159
  else:
160
+ post_text_encoder = cls.post_text_encoder
161
+ cls.post_text_encoder = SerializableTextEncoder()
146
162
  _, human_readable_name = cls._markdown_result(name)
163
+ cls.post_text_encoder = post_text_encoder
164
+
147
165
  name_dict[name] = human_readable_name
148
166
 
149
167
  return name_dict
@@ -200,20 +218,22 @@ class Serializable(object): # pylint: disable=too-few-public-methods
200
218
  @classmethod
201
219
  def _markdown_result(cls, obj, level=0): # pylint: disable=too-many-branches
202
220
  if obj is None:
203
- result = False, 'n/a'
221
+ result = cls.post_text_encoder('n/a', level)
204
222
  elif isinstance(obj, bool):
205
- result = False, 'yes' if obj else 'no'
223
+ result = cls.post_text_encoder('yes' if obj else 'no', level)
206
224
  elif Serializable._markdown_is_directly_printable(obj):
207
- result = False, str(obj)
225
+ result = cls.post_text_encoder(obj, level)
226
+ elif isinstance(obj, Gradeable):
227
+ result = cls.post_text_encoder(obj, level)
208
228
  elif isinstance(obj, Serializable):
209
229
  result = obj._as_markdown(level) # pylint: disable=protected-access
210
230
  elif isinstance(obj, enum.Enum):
211
231
  if isinstance(obj.value, Serializable):
212
232
  return obj.value._as_markdown(level) # pylint: disable=protected-access
213
233
  if isinstance(obj.value, CryptoDataParamsBase):
214
- return False, str(obj.value)
234
+ return cls.post_text_encoder(obj.value, level)
215
235
 
216
- return False, obj.name
236
+ return cls.post_text_encoder(obj.name, level)
217
237
  elif isinstance(obj, (ipaddress.IPv4Network, ipaddress.IPv6Network)):
218
238
  return False, str(obj)
219
239
  elif attr.has(type(obj)):
@@ -225,9 +245,9 @@ class Serializable(object): # pylint: disable=too-few-public-methods
225
245
  elif isinstance(obj, (list, tuple, set, ArrayBase)):
226
246
  result = cls._markdown_result_list(obj, level)
227
247
  elif isinstance(obj, (bytes, bytearray)):
228
- result = False, bytes_to_hex_string(obj, separator=':', lowercase=False)
248
+ result = cls.post_text_encoder(bytes_to_hex_string(obj, separator=':', lowercase=False), level)
229
249
  else:
230
- result = False, str(obj)
250
+ result = cls.post_text_encoder(obj, level)
231
251
 
232
252
  return result
233
253