aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_rfc5652.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_rfc5652.py')
-rw-r--r--tests/test_rfc5652.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/tests/test_rfc5652.py b/tests/test_rfc5652.py
index eac4262..be18914 100644
--- a/tests/test_rfc5652.py
+++ b/tests/test_rfc5652.py
@@ -108,27 +108,21 @@ xicQmJP+VoMHo/ZpjFY9fYCjNZUArgKsEwK/s+p9yrVVeB1Nf8Mn
namedtype.NamedType('Signature', univ.BitString())
)
- attributesMapUpdate = {
+ openTypeMap = {
+ # attributes
univ.ObjectIdentifier('1.3.6.1.4.1.311.13.2.3'): char.IA5String(),
univ.ObjectIdentifier('1.3.6.1.4.1.311.13.2.2'): EnrollmentCSP(),
univ.ObjectIdentifier('1.3.6.1.4.1.311.21.20'): ClientInformation(),
- }
-
- rfc5652.cmsAttributesMap.update(rfc6402.cmcControlAttributesMap)
- rfc5652.cmsAttributesMap.update(attributesMapUpdate)
-
- algorithmIdentifierMapUpdate = {
+ # algorithm identifier parameters
univ.ObjectIdentifier('1.2.840.113549.1.1.1'): univ.Null(""),
univ.ObjectIdentifier('1.2.840.113549.1.1.5'): univ.Null(""),
univ.ObjectIdentifier('1.2.840.113549.1.1.11'): univ.Null(""),
}
- rfc5280.algorithmIdentifierMap.update(algorithmIdentifierMapUpdate)
-
- rfc5652.cmsContentTypesMap.update(rfc6402.cmsContentTypesMapUpdate)
+ openTypeMap.update(rfc5652.cmsAttributesMap)
+ openTypeMap.update(rfc6402.cmcControlAttributesMap)
substrate = pem.readBase64fromText(self.pem_text)
-
asn1Object, rest = der_decoder.decode(substrate,
asn1Spec=rfc5652.ContentInfo(), decodeOpenTypes=True)
assert not rest
@@ -140,6 +134,7 @@ xicQmJP+VoMHo/ZpjFY9fYCjNZUArgKsEwK/s+p9yrVVeB1Nf8Mn
assert eci['eContentType'] == rfc6402.id_cct_PKIData
pkid, rest = der_decoder.decode(eci['eContent'],
asn1Spec=rfc5652.cmsContentTypesMap[eci['eContentType']],
+ openTypes=openTypeMap,
decodeOpenTypes=True)
assert not rest
assert pkid.prettyPrint()
@@ -149,17 +144,17 @@ xicQmJP+VoMHo/ZpjFY9fYCjNZUArgKsEwK/s+p9yrVVeB1Nf8Mn
cr = req['tcr']['certificationRequest']
sig_alg = cr['signatureAlgorithm']
- assert sig_alg['algorithm'] in rfc5280.algorithmIdentifierMap.keys()
+ assert sig_alg['algorithm'] in openTypeMap.keys()
assert sig_alg['parameters'] == univ.Null("")
cri = cr['certificationRequestInfo']
spki_alg = cri['subjectPublicKeyInfo']['algorithm']
- assert spki_alg['algorithm'] in rfc5280.algorithmIdentifierMap.keys()
+ assert spki_alg['algorithm'] in openTypeMap.keys()
assert spki_alg['parameters'] == univ.Null("")
attrs = cr['certificationRequestInfo']['attributes']
for attr in attrs:
- assert attr['attrType'] in rfc5652.cmsAttributesMap.keys()
+ assert attr['attrType'] in openTypeMap.keys()
if attr['attrType'] == univ.ObjectIdentifier('1.3.6.1.4.1.311.13.2.3'):
assert attr['attrValues'][0] == "6.2.9200.2"
else: