aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Housley <housley@vigilsec.com>2019-11-08 12:59:50 -0500
committerIlya Etingof <etingof@gmail.com>2019-11-08 18:59:50 +0100
commit883def9ff53b949f76014a0b1dc61594e813009b (patch)
tree23684415806be27a147d95bb89aa70fc35b957a3
parent0db0db806489e1fe968b0c22bf614b76ff55361a (diff)
downloadpyasn1-modules-883def9ff53b949f76014a0b1dc61594e813009b.tar.gz
Update to RFC 8226 for ComponentPresentConstraint (#100)
-rw-r--r--CHANGES.txt2
-rw-r--r--pyasn1_modules/rfc8226.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 9b38f43..a20bcc2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -24,6 +24,8 @@ Revision 0.2.8, released XX-XX-2019
- Added RFC5924 providing Extended Key Usage for Session Initiation
Protocol (SIP) in X.509 certificates
- Added RFC5916 providing Device Owner Attribute
+- Update RFC8226 to use ComponentPresentConstraint() instead of the
+ previous work around
Revision 0.2.7, released 09-10-2019
-----------------------------------
diff --git a/pyasn1_modules/rfc8226.py b/pyasn1_modules/rfc8226.py
index a5eb211..e7fe946 100644
--- a/pyasn1_modules/rfc8226.py
+++ b/pyasn1_modules/rfc8226.py
@@ -75,8 +75,12 @@ JWTClaimConstraints.componentType = namedtype.NamedTypes(
tag.tagFormatSimple, 1)))
)
-
-JWTClaimConstraints.sizeSpec = univ.Sequence.sizeSpec + constraint.ValueSizeConstraint(1, 2)
+JWTClaimConstraints.subtypeSpec = constraint.ConstraintsUnion(
+ constraint.WithComponentsConstraint(
+ ('mustInclude', constraint.ComponentPresentConstraint())),
+ constraint.WithComponentsConstraint(
+ ('permittedValues', constraint.ComponentPresentConstraint()))
+)
id_pe_JWTClaimConstraints = _OID(1, 3, 6, 1, 5, 5, 7, 1, 27)