# PR #5251 adds support for CMS (RFC5662)

- Thread: https://externals.io/message/110127
- Original archive: https://news-web.php.net/php.internals/110127
- Started by Eliot Lear on 2020-05-11T09:59:27+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #110127 — Eliot Lear — 2020-05-11T09:59:27+00:00

URL: https://externals.io/message/110127#110127

Hi everyone,

I am new to the PHP development process, so please forgive me if I have
this wrong.

In PR #5251[1] I’ve created OpenSSL CMS functions that are nearly direct
analogues to the openssl PKCS#7 functions.  Cryptographic Message Syntax
is defined in RFC 5652[2], and is a follow-on to PKCS#7.  These
functions are useful to developers who are creating or verifying
PKI-based signatures (this is the case for me or anyone else who is
implementing or deploying RFC 8520[3]), and there are other IoT services
that are using CMS as well (not to mention certain modern mailing systems).

There are one or two changes- one can specify the encoding format as an
argument, for instance, and error out out the use of DETACHED with
S/MIME encoding, as nobody seems to know what that would mean.

I’ve been working with Jakub and others who have been very generous with
their time on code reviews.  I would be grateful for any additional
feedback you would have, with an eye toward merging this PR.  The PR is
already marked as RFC I have not yet formalized that.(*)

Best regards,

Eliot

(*) I tried adding an RFC page on the wiki, but sensibly, as I just
created the account, the system did not permit me to do so.

[1] https://github.com/php/php-src/pull/5251
[2] https://www.rfc-editor.org/rfc/rfc5652.html
[3] https://www.rfc-editor.org/rfc/rfc8520.html

---

## #110130 — Christoph M. Becker — 2020-05-11T10:45:14+00:00

URL: https://externals.io/message/110127#110130 · In reply to: #110127

> Hi everyone,
>
> I am new to the PHP development process, so please forgive me if I have
> this wrong.
>
> In PR #5251[1] I’ve created OpenSSL CMS functions that are nearly direct
> analogues to the openssl PKCS#7 functions.  Cryptographic Message Syntax
> is defined in RFC 5652[2], and is a follow-on to PKCS#7.  These
> functions are useful to developers who are creating or verifying
> PKI-based signatures (this is the case for me or anyone else who is
> implementing or deploying RFC 8520[3]), and there are other IoT services
> that are using CMS as well (not to mention certain modern mailing systems).
>
> There are one or two changes- one can specify the encoding format as an
> argument, for instance, and error out out the use of DETACHED with
> S/MIME encoding, as nobody seems to know what that would mean.
>
> I’ve been working with Jakub and others who have been very generous with
> their time on code reviews.  I would be grateful for any additional
> feedback you would have, with an eye toward merging this PR.  The PR is
> already marked as RFC I have not yet formalized that.(*)
>
> Best regards,
>
> Eliot
>
> (*) I tried adding an RFC page on the wiki, but sensibly, as I just
> created the account, the system did not permit me to do so.
>
> [1] https://github.com/php/php-src/pull/5251
> [2] https://www.rfc-editor.org/rfc/rfc5652.html
> [3] https://www.rfc-editor.org/rfc/rfc8520.html

Thanks for working on CMS support!

I have granted you RFC karma.  Best of luck with the RFC. :)

--
Christoph M. Becker

---

## #110147 — G. P. B. — 2020-05-12T15:10:10+00:00

URL: https://externals.io/message/110127#110147 · In reply to: #110130

> 
>
> > […]
> systems).
> > […]
>
> Thanks for working on CMS support!
>
> I have granted you RFC karma.  Best of luck with the RFC. :)
>
> --
> Christoph M. Becker
>
> --
> 
> 
>
>
Does this really require an RFC?
This seems like just exposing some underlying functionality from OpenSSL
to userland which I wouldn't have expected to need an RFC to be added.

Best regards

George P. Banyard

---

## #110148 — Eliot Lear — 2020-05-12T15:39:03+00:00

URL: https://externals.io/message/110127#110148 · In reply to: #110147

Hi!


> Does this really require an RFC?
> This seems like just exposing some underlying functionality from OpenSSL
> to userland which I wouldn't have expected to need an RFC to be added.

Whether or not you wish to use the full process (voting and all) is not
something I can comment on, but I will say that just writing out the RFC
helped me realize that I could improve a few things in the code.  I also
pretty much wrote out the documentation for the calling interface in the
draft RFC.  I hope this will prove useful.

Eliot
