aboutsummaryrefslogtreecommitdiff
path: root/pyasn1_modules/rfc2986.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-07-31 10:36:45 +0200
committerGitHub <noreply@github.com>2019-07-31 10:36:45 +0200
commit3e2e4419553287df3f6a4071b49c6049f78be4be (patch)
tree5385178e4699ee2fe1b1c4ce446564aefde5a1f2 /pyasn1_modules/rfc2986.py
parenta2a8bbbcf2dff6e625ce6d601f1af9e84270c049 (diff)
downloadpyasn1-modules-3e2e4419553287df3f6a4071b49c6049f78be4be.tar.gz
Make SIZE OF constraint operational (#46)
Changes `ValueSizeConstraint` erroneously applied to `SequenceOf` and `SetOf` objects via `subtypeConstraint` attribute to be applied via `sizeSpec` attribute. Although `sizeSpec` takes the same constraint objects as `subtypeConstraint`, the former is only verified on de/serialization i.e. when the [constructed] object at hand is fully populated, while the latter is applied to [scalar] types at the moment of instantiation. This change also bumps pyasn1 requirement to 0.4.6.
Diffstat (limited to 'pyasn1_modules/rfc2986.py')
-rw-r--r--pyasn1_modules/rfc2986.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pyasn1_modules/rfc2986.py b/pyasn1_modules/rfc2986.py
index c3ccf04..34acbd5 100644
--- a/pyasn1_modules/rfc2986.py
+++ b/pyasn1_modules/rfc2986.py
@@ -45,12 +45,14 @@ SubjectPublicKeyInfo = rfc5280.SubjectPublicKeyInfo
class Attributes(univ.SetOf):
pass
+
Attributes.componentType = Attribute()
class CertificationRequestInfo(univ.Sequence):
pass
+
CertificationRequestInfo.componentType = namedtype.NamedTypes(
namedtype.NamedType('version', univ.Integer()),
namedtype.NamedType('subject', Name()),
@@ -65,6 +67,7 @@ CertificationRequestInfo.componentType = namedtype.NamedTypes(
class CertificationRequest(univ.Sequence):
pass
+
CertificationRequest.componentType = namedtype.NamedTypes(
namedtype.NamedType('certificationRequestInfo', CertificationRequestInfo()),
namedtype.NamedType('signatureAlgorithm', AlgorithmIdentifier()),