add support for OCSP_request_verify#1778
Conversation
0baa193 to
30d3135
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1778 +/- ##
==========================================
+ Coverage 78.33% 78.35% +0.01%
==========================================
Files 580 581 +1
Lines 97256 97419 +163
Branches 13945 13971 +26
==========================================
+ Hits 76187 76329 +142
- Misses 20445 20470 +25
+ Partials 624 620 -4 ☔ View full report in Codecov by Sentry. |
30d3135 to
ff19094
Compare
ff19094 to
d02aa40
Compare
| OPENSSL_EXPORT int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, | ||
| X509_STORE *st, unsigned long flags); | ||
|
|
||
| OPENSSL_EXPORT int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, |
There was a problem hiding this comment.
missing function description
There was a problem hiding this comment.
My bad haha...
crypto/ocsp/ocsp_verify.c
Outdated
| signer = X509_find_by_subject(certs, nm); | ||
| if (signer != NULL) { | ||
| *psigner = signer; | ||
| return SIGNER_IN_TRUSTED_CERTS; |
There was a problem hiding this comment.
trusted certs are in the trust store, no? only OCSP_NOCHAIN will mean these are "trusted" from a validation perspective.
There was a problem hiding this comment.
And OCSP_TRUSTOTHER I guess.
There was a problem hiding this comment.
Yeah I worded this from the perspective of using the OCSP_TRUSTOTHER flag.
OCSP_NOCHAIN means that the certs provided outside of the trust store are not considered when building the chain.
| // OCSP_NOCHAIN is for |OCSP_basic_verify| and |OCSP_request_verify|. All | ||
| // certificates in both |certs| and in |bs|/|req| are considered as untrusted | ||
| // certificates for the construction of the validation path for the signer | ||
| // certificate by default, unless |OCSP_NOCHAIN| is set. |
There was a problem hiding this comment.
unless |OCSP_NOCHAIN| is set
Just checking: the negation implied by "unless" means that the certs and all "intern" certs in bs/req are not added for the purpose of chain building. It doesn't mean negating "untrusted" to "trusted.
There was a problem hiding this comment.
Yeah this could be clearer. OCSP_NOCHAIN means that certificates in certs and bs/req aren't considered when building the chain.
But on closer examination, certs is never considered in OCSP_request_verify so the above only applies to OCSP_basic_verify. Will change.
## What's Changed * Use OPENSSL_STATIC_ASSERT which handles all the platform/compiler/C s… by @andrewhop in #1791 * ML-KEM refactor by @dkostic in #1763 * ML-KEM-IPD to ML-KEM as defined in FIPS 203 by @dkostic in #1796 * Add KDA OneStep testing to ACVP by @skmcgrail in #1792 * Updating erroneous documentation for BIO_get_mem_data and subsequent usage by @smittals2 in #1752 * No-op impls for several EVP_PKEY_CTX functions by @justsmth in #1759 * Drop "ipd" suffix from ML-KEM related code by @dkostic in #1797 * Upstream merge 2024 08 19 by @skmcgrail in #1781 * ML-KEM move to the FIPS module by @dkostic in #1802 * Reduce collision probability for variable names by @torben-hansen in #1804 * Refactor ENGINE API and memory around METHOD structs by @smittals2 in #1776 * bn: Move x86-64 argument-based dispatching of bn_mul_mont to C. by @justsmth in #1795 * Check at runtime that the tool is loading the same libcrypto it was built with by @andrewhop in #1716 * Avoid matching prefixes of a symbol as arm registers by @torben-hansen in #1807 * Add CI for FreeBSD by @justsmth in #1787 * Move curve25519 implementations to fips module except spake25519 by @torben-hansen in #1809 * Add CAST for SP 800-56Cr2 One-Step function by @skmcgrail in #1803 * Remove custom PKCS7 ASN1 functions, add new structs by @WillChilds-Klein in #1726 * NASM use default debug format by @justsmth in #1747 * Add KDF in counter mode ACVP Testing by @skmcgrail in #1810 * add support for OCSP_request_verify by @samuel40791765 in #1778 * Fix GitHub/CodeBuild Purge Lambda by @justsmth in #1808 * KBKDF_ctr_hmac FIPS Service Indicator by @skmcgrail in #1798 * Update x509 tool to write all output to common BIO which is a file or stdout by @andrewhop in #1800 * Add ML-KEM to speed.cc, bump AWSLC_API_VERSION to 30 by @andrewhop in #1817 * Add EVP_PKEY_asn1_* functions by @justsmth in #1751 * Improve portability of CI integration script by @torben-hansen in #1815 * Upstream merge 2024 08 23 by @justsmth in #1799 * Replace ECDSA_METHOD with EC_KEY_METHOD and add the associated API by @smittals2 in #1785 * Cherrypick "Add some barebones support for DH in EVP" by @samuel40791765 in #1813 * Add KDA OneStep (SSKDF_digest and SSKDF_hmac) to FIPS indicator by @skmcgrail in #1793 * Add EVP_Digest one-shot test XOFs by @WillChilds-Klein in #1820 * Wire-up ACVP Testing for SHA3 Signatures with RSA by @skmcgrail in #1805 * Make SHA3 (not SHAKE) Approved for EVP_DigestSign/Verify, RSA and ECDSA. by @nebeid in #1821 * Begin tracking RelWithDebInfo library statistics by @andrewhop in #1822 * Move EVP ed25519 function table under FIPS module by @torben-hansen in #1826 * Avoid C11 Atomics on Windows by @justsmth in #1824 * Improve pre-sandbox setup by @torben-hansen in #1825 * Add OCSP round trip integration test with minor fixes by @samuel40791765 in #1811 * Add various PKCS7 getters and setters by @WillChilds-Klein in #1780 * Run clang-format on pkcs7 code by @WillChilds-Klein in #1830 * Move KEM API and ML-KEM definitions to FIPS module by @torben-hansen in #1828 * fix socat integration CI by @samuel40791765 in #1833 * Retire out-of-module KEM folder by @torben-hansen in #1832 * Refactor RSA_METHOD and expand API by @smittals2 in #1790 * Update benchmark documentation in tool/readme.md by @andrewhop in #1812 * Pre jail unit test by @torben-hansen in #1835 * Move EVP KEM implementation to in-module and correct OID by @torben-hansen in #1838 * More minor symbols Ruby depends on by @samuel40791765 in #1837 * ED25519 Power-on Self Test / CAST / KAT by @skmcgrail in #1834 * ACVP ML-KEM testing by @skmcgrail in #1840 * ACVP ECDSA SHA3 Digest Testing by @skmcgrail in #1819 * ML-KEM Service Indicator for EVP_PKEY_keygen, EVP_PKEY_encapsulate, EVP_PKEY_decapsulate by @skmcgrail in #1844 * Add ML-KEM CAST for KeyGen, Encaps, and Decaps by @skmcgrail in #1846 * ED25519 Service Indicator by @skmcgrail in #1829 * Update Allowed RSA KeySize Generation to FIPS 186-5 specification by @skmcgrail in #1823 * Add ED25519 ACVP Testing by @skmcgrail in #1818 * Make EDDSA/Ed25519 POST lazy initalized by @skmcgrail in #1848 * add support for PEM Parameters without ASN1 hooks by @samuel40791765 in #1831 * Add OpenVPN tip of main to CI by @smittals2 in #1843 * Ensure SSE2 is enabled when using optimized assembly for 32-bit x86 by @graebm in #1841 * Add support for `EVP_PKEY_CTX_ctrl_str` - Step #1 by @justsmth in #1842 * Added SHA3/SHAKE XOF functionality by @jakemas in #1839 * Migrated ML-KEM SHA3/SHAKE usage to fipsmodule by @jakemas in #1851 * AVX-512 support for RSA Signing by @pittma in #1273
Issues:
Resolves
CryptoAlg-2420Description of changes:
OCSP_request_verifyis the last OCSP API needed for Ruby. OCSP request signatures are optional according to the OCSP RFC, so this is less used thanOCSP_basic_verify. Much of the logic & flags are reused across each other however. A significant portion of the logic was also reworked without changing the behavior.Documentation was also rewritten slightly so that it could be applied to both OCSP verification APIs.
Call-outs:
We don't support
OCSP_NOSIGSforOCSP_basic_verifyeither, so I've left that out of here for the time being.Testing:
New tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.