pyasn1-alt-modules 0.4.3__py2.py3-none-any.whl → 0.4.4__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of pyasn1-alt-modules might be problematic. Click here for more details.

@@ -1,2 +1,2 @@
1
1
  # http://www.python.org/dev/peps/pep-0396/
2
- __version__ = '0.4.3'
2
+ __version__ = '0.4.4'
@@ -0,0 +1,238 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Online Certificate Status Protocol (OCSP) with nonce size constraints
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc6960.txt
13
+ # https://www.rfc-editor.org/rfc/rfc8954.txt
14
+ #
15
+
16
+ from pyasn1.type import char
17
+ from pyasn1.type import constraint
18
+ from pyasn1.type import namedtype
19
+ from pyasn1.type import tag
20
+ from pyasn1.type import univ
21
+ from pyasn1.type import useful
22
+
23
+ from pyasn1_alt_modules import rfc2560
24
+ from pyasn1_alt_modules import rfc5280
25
+ from pyasn1_alt_modules import opentypemap
26
+
27
+ certificateExtensionsMap = opentypemap.get('certificateExtensionsMap')
28
+
29
+ ocspResponseMap = opentypemap.get('ocspResponseMap')
30
+
31
+ MAX = float('inf')
32
+
33
+
34
+ # Imports from RFC 5280
35
+
36
+ AlgorithmIdentifier = rfc5280.AlgorithmIdentifier
37
+ AuthorityInfoAccessSyntax = rfc5280.AuthorityInfoAccessSyntax
38
+ Certificate = rfc5280.Certificate
39
+ CertificateSerialNumber = rfc5280.CertificateSerialNumber
40
+ CRLReason = rfc5280.CRLReason
41
+ Extensions = rfc5280.Extensions
42
+ GeneralName = rfc5280.GeneralName
43
+ Name = rfc5280.Name
44
+
45
+ id_kp = rfc5280.id_kp
46
+
47
+ id_ad_ocsp = rfc5280.id_ad_ocsp
48
+
49
+
50
+ # Imports from the original OCSP module in RFC 2560
51
+
52
+ AcceptableResponses = rfc2560.AcceptableResponses
53
+ ArchiveCutoff = rfc2560.ArchiveCutoff
54
+ CertStatus = rfc2560.CertStatus
55
+ KeyHash = rfc2560.KeyHash
56
+ OCSPResponse = rfc2560.OCSPResponse
57
+ OCSPResponseStatus = rfc2560.OCSPResponseStatus
58
+ ResponseBytes = rfc2560.ResponseBytes
59
+ RevokedInfo = rfc2560.RevokedInfo
60
+ UnknownInfo = rfc2560.UnknownInfo
61
+ Version = rfc2560.Version
62
+
63
+ id_kp_OCSPSigning = rfc2560.id_kp_OCSPSigning
64
+
65
+ id_pkix_ocsp = rfc2560.id_pkix_ocsp
66
+ id_pkix_ocsp_archive_cutoff = rfc2560.id_pkix_ocsp_archive_cutoff
67
+ id_pkix_ocsp_basic = rfc2560.id_pkix_ocsp_basic
68
+ id_pkix_ocsp_crl = rfc2560.id_pkix_ocsp_crl
69
+ id_pkix_ocsp_nocheck = rfc2560.id_pkix_ocsp_nocheck
70
+ id_pkix_ocsp_nonce = rfc2560.id_pkix_ocsp_nonce
71
+ id_pkix_ocsp_response = rfc2560.id_pkix_ocsp_response
72
+ id_pkix_ocsp_service_locator = rfc2560.id_pkix_ocsp_service_locator
73
+
74
+
75
+ # Additional object identifiers
76
+
77
+ id_pkix_ocsp_pref_sig_algs = id_pkix_ocsp + (8, )
78
+ id_pkix_ocsp_extended_revoke = id_pkix_ocsp + (9, )
79
+
80
+
81
+ # Updated structures (mostly to improve openTypes support)
82
+
83
+ class CertID(univ.Sequence):
84
+ componentType = namedtype.NamedTypes(
85
+ namedtype.NamedType('hashAlgorithm', AlgorithmIdentifier()),
86
+ namedtype.NamedType('issuerNameHash', univ.OctetString()),
87
+ namedtype.NamedType('issuerKeyHash', univ.OctetString()),
88
+ namedtype.NamedType('serialNumber', CertificateSerialNumber())
89
+ )
90
+
91
+
92
+ class SingleResponse(univ.Sequence):
93
+ componentType = namedtype.NamedTypes(
94
+ namedtype.NamedType('certID', CertID()),
95
+ namedtype.NamedType('certStatus', CertStatus()),
96
+ namedtype.NamedType('thisUpdate', useful.GeneralizedTime()),
97
+ namedtype.OptionalNamedType('nextUpdate', useful.GeneralizedTime().subtype(
98
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
99
+ namedtype.OptionalNamedType('singleExtensions', Extensions().subtype(
100
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
101
+ )
102
+
103
+
104
+ class ResponderID(univ.Choice):
105
+ componentType = namedtype.NamedTypes(
106
+ namedtype.NamedType('byName', Name().subtype(
107
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
108
+ namedtype.NamedType('byKey', KeyHash().subtype(
109
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
110
+ )
111
+
112
+
113
+ class ResponseData(univ.Sequence):
114
+ componentType = namedtype.NamedTypes(
115
+ namedtype.DefaultedNamedType('version', Version('v1').subtype(
116
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
117
+ namedtype.NamedType('responderID', ResponderID()),
118
+ namedtype.NamedType('producedAt', useful.GeneralizedTime()),
119
+ namedtype.NamedType('responses', univ.SequenceOf(
120
+ componentType=SingleResponse())),
121
+ namedtype.OptionalNamedType('responseExtensions', Extensions().subtype(
122
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1)))
123
+ )
124
+
125
+
126
+ class BasicOCSPResponse(univ.Sequence):
127
+ componentType = namedtype.NamedTypes(
128
+ namedtype.NamedType('tbsResponseData', ResponseData()),
129
+ namedtype.NamedType('signatureAlgorithm', AlgorithmIdentifier()),
130
+ namedtype.NamedType('signature', univ.BitString()),
131
+ namedtype.OptionalNamedType('certs', univ.SequenceOf(
132
+ componentType=Certificate()).subtype(explicitTag=tag.Tag(
133
+ tag.tagClassContext, tag.tagFormatSimple, 0)))
134
+ )
135
+
136
+
137
+ class Request(univ.Sequence):
138
+ componentType = namedtype.NamedTypes(
139
+ namedtype.NamedType('reqCert', CertID()),
140
+ namedtype.OptionalNamedType('singleRequestExtensions', Extensions().subtype(
141
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
142
+ )
143
+
144
+
145
+ class Signature(univ.Sequence):
146
+ componentType = namedtype.NamedTypes(
147
+ namedtype.NamedType('signatureAlgorithm', AlgorithmIdentifier()),
148
+ namedtype.NamedType('signature', univ.BitString()),
149
+ namedtype.OptionalNamedType('certs', univ.SequenceOf(
150
+ componentType=Certificate()).subtype(explicitTag=tag.Tag(
151
+ tag.tagClassContext, tag.tagFormatSimple, 0)))
152
+ )
153
+
154
+
155
+ class TBSRequest(univ.Sequence):
156
+ componentType = namedtype.NamedTypes(
157
+ namedtype.DefaultedNamedType('version', Version('v1').subtype(
158
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
159
+ namedtype.OptionalNamedType('requestorName', GeneralName().subtype(
160
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
161
+ namedtype.NamedType('requestList', univ.SequenceOf(
162
+ componentType=Request())),
163
+ namedtype.OptionalNamedType('requestExtensions', Extensions().subtype(
164
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
165
+ )
166
+
167
+
168
+ class OCSPRequest(univ.Sequence):
169
+ componentType = namedtype.NamedTypes(
170
+ namedtype.NamedType('tbsRequest', TBSRequest()),
171
+ namedtype.OptionalNamedType('optionalSignature', Signature().subtype(
172
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0)))
173
+ )
174
+
175
+
176
+ # Previously omitted structure
177
+
178
+ class ServiceLocator(univ.Sequence):
179
+ componentType = namedtype.NamedTypes(
180
+ namedtype.NamedType('issuer', Name()),
181
+ namedtype.NamedType('locator', AuthorityInfoAccessSyntax())
182
+ )
183
+
184
+
185
+ # Additional structures
186
+
187
+ class CrlID(univ.Sequence):
188
+ componentType = namedtype.NamedTypes(
189
+ namedtype.OptionalNamedType('crlUrl', char.IA5String().subtype(
190
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
191
+ namedtype.OptionalNamedType('crlNum', univ.Integer().subtype(
192
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
193
+ namedtype.OptionalNamedType('crlTime', useful.GeneralizedTime().subtype(
194
+ explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2)))
195
+ )
196
+
197
+
198
+ class PreferredSignatureAlgorithm(univ.Sequence):
199
+ componentType = namedtype.NamedTypes(
200
+ namedtype.NamedType('sigIdentifier', AlgorithmIdentifier()),
201
+ namedtype.OptionalNamedType('certIdentifier', AlgorithmIdentifier())
202
+ )
203
+
204
+
205
+ class PreferredSignatureAlgorithms(univ.SequenceOf):
206
+ componentType = PreferredSignatureAlgorithm()
207
+
208
+
209
+ class Nonce(univ.OctetString):
210
+ subtypeSpec = constraint.ValueSizeConstraint(1, 32)
211
+
212
+
213
+ # Update the OCSP Response Map
214
+
215
+ _ocspResponseMapUpdate = {
216
+ id_pkix_ocsp_basic: BasicOCSPResponse(),
217
+ }
218
+
219
+ ocspResponseMap.update(_ocspResponseMapUpdate)
220
+
221
+
222
+ # Update the Certificate Extension Extensions Map
223
+
224
+ _certificateExtensionsMapUpdate = {
225
+ # Certificate Extension
226
+ id_pkix_ocsp_nocheck: univ.Null(""),
227
+ # OCSP Request Extensions
228
+ id_pkix_ocsp_nonce: Nonce(),
229
+ id_pkix_ocsp_response: AcceptableResponses(),
230
+ id_pkix_ocsp_service_locator: ServiceLocator(),
231
+ id_pkix_ocsp_pref_sig_algs: PreferredSignatureAlgorithms(),
232
+ # OCSP Response Extensions
233
+ id_pkix_ocsp_crl: CrlID(),
234
+ id_pkix_ocsp_archive_cutoff: ArchiveCutoff(),
235
+ id_pkix_ocsp_extended_revoke: univ.Null(""),
236
+ }
237
+
238
+ certificateExtensionsMap.update(_certificateExtensionsMapUpdate)
@@ -2,8 +2,9 @@
2
2
  # This file is part of pyasn1_alt_modules software.
3
3
  #
4
4
  # Created by Russ Housley with minor assistance from asn1ate v.0.6.0.
5
+ # Modified by Russ Housley to make InfoTypeAndValue['infoType'] optional.
5
6
  #
6
- # Copyright (c) 2021-2024, Vigil Security, LLC
7
+ # Copyright (c) 2021, Vigil Security, LLC
7
8
  # License: http://vigilsec.com/pyasn1_alt_modules_license.txt
8
9
  #
9
10
  # Updates to the Certificate Management Protocol (CMP)
@@ -143,7 +144,7 @@ RevReqContent = rfc4210.RevReqContent
143
144
  class InfoTypeAndValue(univ.Sequence):
144
145
  componentType = namedtype.NamedTypes(
145
146
  namedtype.NamedType('infoType', univ.ObjectIdentifier()),
146
- namedtype.NamedType('infoValue', univ.Any(),
147
+ namedtype.OptionalNamedType('infoValue', univ.Any(),
147
148
  openType=opentype.OpenType('infoType', cmpInfoTypeAndValueMap))
148
149
  )
149
150
 
@@ -0,0 +1,23 @@
1
+ #
2
+ # This file is part of pyasn1-alt-modules software.
3
+ #
4
+ # Created by Russ Housley.
5
+ #
6
+ # Copyright (c) 2024, Vigil Security, LLC
7
+ # License: http://vigilsec.com/pyasn1-alt-modules-license.txt
8
+ #
9
+ # Generating Transport Key Containers Using the GOST Algorithms
10
+ #
11
+ # ASN.1 source from:
12
+ # https://www.rfc-editor.org/rfc/rfc9548.txt
13
+ #
14
+
15
+ from pyasn1_alt_modules import rfc9215
16
+
17
+
18
+ # Import from RFC 9215
19
+
20
+ GostR3410_2012_PublicKey = rfc9215.GostR3410_2012_PublicKey
21
+
22
+
23
+ # The Algorithm Identifier Map update was done by importing rfc9215.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyasn1-alt-modules
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: A alternate collection of ASN.1-based protocols modules.
5
5
  Home-page: https://github.com/russhousley/pyasn1-alt-modules
6
6
  Author: Russ Housley
@@ -21,18 +21,18 @@ Classifier: Operating System :: OS Independent
21
21
  Classifier: Programming Language :: Python :: 2
22
22
  Classifier: Programming Language :: Python :: 2.7
23
23
  Classifier: Programming Language :: Python :: 3
24
- Classifier: Programming Language :: Python :: 3.5
25
24
  Classifier: Programming Language :: Python :: 3.6
26
25
  Classifier: Programming Language :: Python :: 3.7
27
26
  Classifier: Programming Language :: Python :: 3.8
28
27
  Classifier: Programming Language :: Python :: 3.9
29
28
  Classifier: Programming Language :: Python :: 3.10
30
29
  Classifier: Programming Language :: Python :: 3.11
30
+ Classifier: Programming Language :: Python :: 3.12
31
31
  Classifier: Topic :: Communications
32
32
  Classifier: Topic :: System :: Monitoring
33
33
  Classifier: Topic :: System :: Networking :: Monitoring
34
34
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
35
- Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
35
+ Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
36
36
  Description-Content-Type: text/plain
37
37
  License-File: LICENSE.txt
38
38
  Requires-Dist: pyasn1 >=0.4.7
@@ -1,4 +1,4 @@
1
- pyasn1_alt_modules/__init__.py,sha256=u9WPG0pKKTbs8kj8x0-Gzkq13qU3i37wDkIRvsM40Hg,65
1
+ pyasn1_alt_modules/__init__.py,sha256=R5AujzMhS5EDF6EOD-KovQxq3sEW8ezuFu1-xNcezP0,65
2
2
  pyasn1_alt_modules/opentypemap.py,sha256=6Z-NY-mf7sp0kPndmCVrQ0zNOEeyb4JcpDlYcBO4OMY,517
3
3
  pyasn1_alt_modules/pem.py,sha256=c-3lij6mTNWEXndSY-oKKDQw_wgV_ndbMC-ySJ2HVHw,2120
4
4
  pyasn1_alt_modules/rfc1155.py,sha256=WKxBJfYB4-bubjPp277FVYYpjn8IE41ALEM_MlvFuuo,2745
@@ -159,6 +159,7 @@ pyasn1_alt_modules/rfc8737.py,sha256=UoF03X06rhcGJBBQ6SEErzbtaQscfyrliXZsXiQbu_M
159
159
  pyasn1_alt_modules/rfc8769.py,sha256=9-krCfH8annRFPUk71sSPrCtgxggBNUMOIEjMjSNXlo,461
160
160
  pyasn1_alt_modules/rfc8894.py,sha256=3peY9iyW1BKnCW4Ou4ipzJc1dRQu73AgmiyV7mf4Nqg,1117
161
161
  pyasn1_alt_modules/rfc8951.py,sha256=XBFQce0AbKf5iqmKo2Ru4fk_Cz3W3aiBI1dvNQFueZs,967
162
+ pyasn1_alt_modules/rfc8954.py,sha256=UmMhmTF0pozM6ArIhflP0A7W3W5_SvK63Bj1Cutuogo,8371
162
163
  pyasn1_alt_modules/rfc8994.py,sha256=Iu6AOUFaOSIfobBO82V9Knnug3dqfy7m6AaiJWcGyvU,1176
163
164
  pyasn1_alt_modules/rfc8995.py,sha256=luGJiaD2vmqmrl8s4QDNmz74gVCmII3LuF-q-H59ifE,862
164
165
  pyasn1_alt_modules/rfc9044.py,sha256=CSw7_POQuNFL137FfHuXc9P1Y-yKk7g3AgRVY47SDxA,2309
@@ -176,12 +177,13 @@ pyasn1_alt_modules/rfc9337.py,sha256=miqpySAcEpzFdZR7H98rbsu-nY9nYJvFHZu6qx5khzE
176
177
  pyasn1_alt_modules/rfc9345.py,sha256=8pVTYX0QAhtITQB7YZN55pwrxjoTY22r1K2AHtZAQ_M,827
177
178
  pyasn1_alt_modules/rfc9385.py,sha256=aWTi8CFSvDV48y2YMDU1q93Axl3WlXxYSji1_FGhAEU,554
178
179
  pyasn1_alt_modules/rfc9399.py,sha256=_LNS6F61VpnVCtiP6pilV76n-WWOvGDLPHEFgXl75J0,1306
179
- pyasn1_alt_modules/rfc9480.py,sha256=5bSOHiK1qFeCeE3nEcanODwit2etlQUm9fT0s6EHsKU,20442
180
+ pyasn1_alt_modules/rfc9480.py,sha256=bgyNS3tFhMMXUe998BjjOay9QOtZAzP8wFPLhVb_X8I,20519
180
181
  pyasn1_alt_modules/rfc9481.py,sha256=Pynt79CcXab0dt7TjDTzakcEj5xWmBbtF9_MLe4xlNg,5125
181
182
  pyasn1_alt_modules/rfc9509.py,sha256=dOG1pqpco2lFPIC4f7TBc4G237uevN_F12bg6vRgeWY,510
182
- pyasn1_alt_modules-0.4.3.dist-info/LICENSE.txt,sha256=l7yNsFxZ6wGRhZS3Ev61Y4qKqhwCe9MIZ5YE6QQOB5A,1402
183
- pyasn1_alt_modules-0.4.3.dist-info/METADATA,sha256=8OmQ36iUlaws1wh6_2adtveiieabpEGvDqCyP0aQPe4,1877
184
- pyasn1_alt_modules-0.4.3.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
185
- pyasn1_alt_modules-0.4.3.dist-info/top_level.txt,sha256=GLxbt54_9pWn-TXLirWGJ2PH7_RnEfi3V8TL0bsJIp8,19
186
- pyasn1_alt_modules-0.4.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
187
- pyasn1_alt_modules-0.4.3.dist-info/RECORD,,
183
+ pyasn1_alt_modules/rfc9548.py,sha256=vNBxmJcFMeUv3_B_EnhwmvB7tVTxzJ_L6rrmaqVcnHU,522
184
+ pyasn1_alt_modules-0.4.4.dist-info/LICENSE.txt,sha256=l7yNsFxZ6wGRhZS3Ev61Y4qKqhwCe9MIZ5YE6QQOB5A,1402
185
+ pyasn1_alt_modules-0.4.4.dist-info/METADATA,sha256=ypv3EuxzbcZCFeHcXqXH1t1yf9OQHC_IWa1aQkz3_Fs,1887
186
+ pyasn1_alt_modules-0.4.4.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
187
+ pyasn1_alt_modules-0.4.4.dist-info/top_level.txt,sha256=GLxbt54_9pWn-TXLirWGJ2PH7_RnEfi3V8TL0bsJIp8,19
188
+ pyasn1_alt_modules-0.4.4.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
189
+ pyasn1_alt_modules-0.4.4.dist-info/RECORD,,