Skip to content

Support PKCS#7 definition for ContentType content ANY#6769

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
cconlon:pkcs7ContentType
Sep 14, 2023
Merged

Support PKCS#7 definition for ContentType content ANY#6769
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
cconlon:pkcs7ContentType

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Sep 12, 2023

Description

This PR adds support to wolfCrypt's PKCS#7 to support the older PKCS#7 RFC (RFC 2315) encoding of the SignedData ContentInfo content as ANY. The newer CMS RFC (RFC 5652) defines that the content will be wrapped in an OCTET STRING, which our code was assuming would be the case.

PKCS#7 RFC 2315 definition of SignedData ContentInfo:

ContentInfo ::= SEQUENCE {
  contentType ContentType,
  content
    [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }

CMS RFC 5652 definition of the same thing:

EncapsulatedContentInfo ::= SEQUENCE {
  eContentType ContentType,
  eContent [0] EXPLICIT OCTET STRING OPTIONAL }

Related to ZD #16645.

Testing

Tested using customer PKCS#7 SignedData bundle, fed into wolfCrypt's PKCS#7 routines using the sample app being added to our wolfssl-examples repository: wolfSSL/wolfssl-examples#400

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@cconlon cconlon self-assigned this Sep 12, 2023
@cconlon
Copy link
Copy Markdown
Member Author

cconlon commented Sep 12, 2023

Retest this please

@cconlon cconlon assigned wolfSSL-Bot and unassigned cconlon Sep 14, 2023
Copy link
Copy Markdown
Contributor

@JacobBarthelmeh JacobBarthelmeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Chris, tested it against the known bundle. Looks good.

@JacobBarthelmeh JacobBarthelmeh merged commit 7d85e39 into wolfSSL:master Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants