Skip to content

Commit

Permalink
Merge branch 'devel-0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
etingof committed Nov 21, 2017
2 parents 620874b + 5d61d1c commit bb8afab
Show file tree
Hide file tree
Showing 9 changed files with 418 additions and 337 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

Revision 0.2.1, released 21-11-2017
-----------------------------------

- Allow ANY DEFINED BY objects expanding automatically if requested

Revision 0.1.5, released 10-10-2017
-----------------------------------

Expand Down
2 changes: 1 addition & 1 deletion pyasn1_modules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# http://www.python.org/dev/peps/pep-0396/
__version__ = '0.1.5'
__version__ = '0.2.1'
32 changes: 27 additions & 5 deletions pyasn1_modules/rfc2315.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class Attribute(univ.Sequence):
class AttributeValueAssertion(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('attributeType', AttributeType()),
namedtype.NamedType('attributeValue', AttributeValue())
namedtype.NamedType('attributeValue', AttributeValue(),
openType=opentype.OpenType('type', certificateAttributesMap))
)


Expand All @@ -50,12 +51,19 @@ class EncryptedContent(univ.OctetString):
pass


contentTypeMap = {}


class EncryptedContentInfo(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('contentType', ContentType()),
namedtype.NamedType('contentEncryptionAlgorithm', ContentEncryptionAlgorithmIdentifier()),
namedtype.OptionalNamedType('encryptedContent', EncryptedContent().subtype(
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
namedtype.OptionalNamedType(
'encryptedContent', EncryptedContent().subtype(
implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)
),
openType=opentype.OpenType('contentType', contentTypeMap)
)
)


Expand Down Expand Up @@ -85,8 +93,11 @@ class Digest(univ.OctetString):
class ContentInfo(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('contentType', ContentType()),
namedtype.OptionalNamedType('content', univ.Any().subtype(
explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
namedtype.OptionalNamedType(
'content',
univ.Any().subtype(explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)),
openType=opentype.OpenType('contentType', contentTypeMap)
)
)


Expand Down Expand Up @@ -270,3 +281,14 @@ class SignedData(univ.Sequence):

class Data(univ.OctetString):
pass

_contentTypeMapUpdate = {
data: Data(),
signedData: SignedData(),
envelopedData: EnvelopedData(),
signedAndEnvelopedData: SignedAndEnvelopedData(),
digestedData: DigestedData(),
encryptedData: EncryptedData()
}

contentTypeMap.update(_contentTypeMapUpdate)
Loading

0 comments on commit bb8afab

Please sign in to comment.