Certificate Management Protocol (CMP, RFC 4210) extension#6811
Certificate Management Protocol (CMP, RFC 4210) extension#6811mpeylo wants to merge 27 commits intoopenssl:masterfrom
Conversation
Also includes CRMF (RFC 4211) and HTTP transfer (RFC 6712) CMP and CRMF API is added to libcrypto, and the "cmp" app to the openssl CLI. Adds extensive man pages and unit tests. Integration into build scripts. Squashed version of the CMP patch as of 2018-07-30 last incremental commit 95b69c2
|
Hi, As announced in #5926, here the official pull request for the CMP extension. In the meanwhile we have continued improving the code and documentation, added unit tests, etc. Among others, we took care of all three points mentioned by @levitte on Apr 11; adding the We have significantly extended the tests and now have hundreds of test cases as well on low-level as also for the CLI application. Some of the test cases require online connectivity and availability of the respective servers - and thus are not enabled by default. For executing the tests (with verbose output) with the EJBCA AWS instance currently provided by PrimeKey, use e.g. http_proxy=(set if needed) CMP_TESTS="EJBCA" make tests TESTS="test_cmp_cli" VERBOSE=1 Of course, code is is never finished, and we are aware of additional features and fixes, which would be nice to have, and will eventually also come - those are documented on https://github.com/mpeylo/cmpossl/issues @DDvO and I will be happy to read any of your feedback, |
|
There are two zip files included in this PR. What are they for? |
mattcaswell
left a comment
There was a problem hiding this comment.
I started to review this and quickly gave up. As it currently stands this PR is unreviewable. According to github it adds 640,787 lines of code in a single commit. I settled in the end for scanning through it and making the occasional random comment where I saw something that leapt out at me.
You have clearly spent a lot of time and effort on this PR. Before this could be merged I think you're going to need to take a step back and break this thing up into significantly smaller chunks that can be reviewed independently.
One other thing the strikes me about this code is the fact that it is entirely standalone. It is all new code with no modification of existing OpenSSL code at all. This makes me wonder whether OpenSSL is the correct home for this code. Something to consider is whether it would be better placed as a standalone project that just has OpenSSL as a dependency.
| * | ||
| * SPDX-License-Identifier: OpenSSL | ||
| * | ||
| * CMP implementation by Martin Peylo, Miikka Viljanen, and David von Oheimb. |
There was a problem hiding this comment.
This isn't the standard file header. Please can you use that instead (which can include additional copyright lines if required)
There was a problem hiding this comment.
We thought to have followed https://wiki.openssl.org/index.php/License .
I've just changed the headers to include the text as given in similar source files.
The extra line containing "SPDX-License-Identifier: OpenSSL" had recently been requested by our legals, but is not strictly required, so I removed it again.
There was a problem hiding this comment.
I meanwhile learned that the use of the line"SPDX-License-Identifier: OpenSSL" has been motivated by https://reuse.software/practices/ - I wonder what you an other think about that?
| return NULL; | ||
| if (!ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, ui_method, 0, 1)) | ||
| return NULL; | ||
| # if 0 |
There was a problem hiding this comment.
Why do we have #if 0 code here?
| * ASN1_SIMPLE(OSSL_CMP_ITAV, infoValue.signingCertificate, | ||
| * ESS_SIGNING_CERT)) | ||
| */ | ||
| #endif |
doc/man3/CMP_CERTRESPONSE.pod
Outdated
| static X509 *OSSL_CMP_CERTRESPONSE_encCert_get1(OSSL_CMP_CERTRESPONSE *crep, | ||
| EVP_PKEY *pkey); | ||
|
|
||
| #include "cmp_int.h" |
There was a problem hiding this comment.
Isn't cmp_int.h an internal header file? If so why is it referred to in the public API docs?
|
Thanks @mattcaswell for your quick comments and questions. |
|
One .zip file contains build info for OpenSSL v1.0.2 and should not have been part of this PR (like the version switches we already eliminated). I've just removed it. The other .zip file contains conformance test data for EJBCA and is no longer needed in this form. I had forgotten to remove it; done now. |
|
The figure 640,787 is not actually the number of lines of code Here is a list of the included .c and .h files (apart from those generated automatically) and their sizes produced with A potential split could for instance be done as follows, in the given order of dependencies:
|
|
The fact that there is pretty little interference with other parts of OpenSSL was on purpose.
Actually, there are a couple of overlaps with existing code:
I started almost a year ago with carving out these changes because they are of more general interest (this is, for use also independently of CMP). This resulted in a series of rather small PRs (the first one being #4124). Part of them have meanwhile been merged, while others are still open and further ones are yet to be given, which one can see also from the open TODOs I put in The dilemma we face here is that the CMP code (mostly in |
|
What is the smallest standalone piece that we can pull out of here? CRMF? A possible route could be like this:
Possibly we may want to wait until both (1) and (2) are approved before pushing either of them. Once CRMF is in we pick the next smallest standalone thing that makes sense and repeat the above. And so on. |
|
This sounds like a good pragmatic way to go. Yes, the CRMF sub-lib is the smallest piece that can be seen as an independent contribution. (Yet the CRMF layer does not have tests of its own - we test it indirectly along with CMP.) As you suggested, I'll produce a PR for its documentation and then one for its implementation. |
…f, for, while, and '?'
…f, for, while, and '?' correction in cmp_ctx.c and completion in cmp_srv.c
…error_txt() for use in cmp.c
… the git line count statistics
levitte
left a comment
There was a problem hiding this comment.
Did a first very quick read through...
as raised by levitte on 2018-08-10 Also replacing __LINE__ and __FILE__ with OPENSSL-defined versions for CMP/CRMF macros.
raised by FdaSilvaYY on 2018-08-10 - CRMF_R_SETTING_MAC_ALRGOR_FAILURE - CRMF_R_SETTING_OWF_ALRGOR_FAILURE
replacing CRMF_R_MALLOC_FAILURE with ERR_R_MALLOC_FAILURE raised by FdaSilvaYY on 2018-08-10
replacing CMP_R_OUT_OF_MEMORY with ERR_R_MALLOC_FAILURE equivalent to CRMF error code issue as raised by FdaSilvaYY on 2018-08-10
improved PBM documentation, amongst others renamed OSSL_CRMF_passwordBasedMac_new() to OSSL_CRM_pbm_new() and made parameters (and function) conforming to no-CamelCase coding requirement. minor style improvements to other documentation
…ymbols regarding the four most recent commits
compiler options "-Werror,-Wmissing-variable-declarations"
|
As recently agreed by email we have started providing the CMPforOpenSSL contribution in small incremental chunks, in PR #7328. |
|
Closing this PR as it as been superseded since long. Not all CMP contribution chunks have been provided as PR and reviewed/merged yet, |
Also includes CRMF (RFC 4211) and HTTP transfer (RFC 6712)
CMP and CRMF API is added to libcrypto, and the "cmp" app to the openssl CLI.
Adds extensive man pages and unit tests. Integration into build scripts.
Squashed version of the CMP patch as of 2018-07-30
last incremental commit 95b69c2
Checklist