summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_vpm.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* x509_param_set_hosts_internal: rename vpm to param for consistencyHEADmastertb11 hours1-11/+11
|
* X509_VERIFY_PARAM_lookup(): avoid passing stack garbage aroundtb11 hours1-1/+2
| | | | ok jsing
* Rename pm to param, fix the type of idx and unindenttb11 hours1-8/+6
| | | | ok jsing
* Introduce and use N_DEFAULT_VERIFY_PARAMStb11 hours1-6/+9
| | | | ok jsing
* X509_VERIFY_PARAM_get0(): use consistent idiom for default_table accesstb11 hours1-2/+3
| | | | ok jsing
* X509_VERIFY_PARAM_lookup(): remove unnecessary braces and add empty linetb11 hours1-3/+3
| | | | ok jsing
* X509_VERIFY_PARAM_get_count(): make NULL check explicittb12 hours1-2/+2
| | | | ok jsing
* X509_VERIFY_PARAM_get0: avoid out of bounds access when id < 0tb12 hours1-1/+5
| | | | ok jsing
* Streamline X509_VERIFY_PARAM_add0_table()tb8 days1-17/+12
| | | | | | | Unindent, use correct type for idx (int rather than size_t) and make this mess a bit more pleasant on the eyes. ok jsing
* x509_vpm: remove unnecessary NULL check before sk_pop_free()tb8 days1-4/+2
| | | | ok jsing
* Make X509_VERIFY_PARAM_set1_policies() less badtb2024-03-291-22/+34
| | | | | | | | | | | If any OBJ_dup() fails along the way, a partially copied policy stack would remain on the params object. This makes no sense. Implement and use an sk_ASN1_OBJECT_deep_copy(), that copies the full stack or else returns NULL. Remove unnecessary NULL check and streamline some other logic. ok jsing
* Clean up X509_VERIFY_PARAM_add0_policy()tb2024-03-291-6/+5
| | | | | | Streamline some checks and use more idiomatic sk_push() error check ok jsing
* Fix indenttb2024-03-291-2/+2
|
* Inline X509_{TRUST,PUPROSE}_set() in their only callerstb2024-01-081-3/+16
| | | | | | They are now unused and will join the exodus to the attic in the next bump. ok jsing
* Fix sk_deep_copy() implementationtb2023-12-141-32/+22
| | | | | | | | | | | | | | | | | sk_deep_copy() is bad code. It is less bad than the upstream code, but still bad: it passes strdup() through a void pointer and assigns it to a function pointer of different type before calling the latter. That's not kosher in more than one way. There is no need for such gymnastics. If we need a deep copy for a type, we should implement it as appropriate for that type. Also, we should not expect and even less so allow holes in a STACK_OF(). The only way the vpm->hosts can be populated is by way of this deep_copy function or x509_param_set_hosts_internal(), which pushes only after a non-NULL check. Invariants: they're useful. ok jsing
* Merge X509_VERIFY_PARAM_ID into X509_VERIFY_PARAMtb2023-05-281-82/+50
| | | | | | | | | | Back in the day when essentially every struct was open to all applications, X509_VERIFY_PARAM_ID provided a modicum of opacity. This indirection is now no longer needed with X509_VERIFY_PARAM being opaque itself, so stop using X509_VERIFY_PARAM_ID and merge it into X509_VERIFY_PARAM. This is a first small step towards cleaning up the X509_VERIFY_PARAM mess. ok jsing
* Copy the verify param hostflags independently of the host listtb2023-05-241-3/+4
| | | | | | | | | | | | | | | | Without this, hostflags set on the SSL_CTX would not propagate to newly created SSL. This is surprising behavior that was changed in OpenSSL 1.1 by Christian Heimes after the issue was flagged by Quentin Pradet: https://bugs.python.org/issue43522 This is a version of the fix that landed in OpenSSL. There used to be a workaround in place in urllib3, but that was removed at some point. We haven't fixed this earlier since it wasn't reported. It only showed up after recent fallout of extraordinarily strict library checking in urllib3 coming from their own interpretation of the implications of PEP 644. ok jsing
* Provide X509_VERIFY_PARAM_set_hostflags()tb2023-05-241-1/+8
| | | | | | | | This is needed for an upcoming regress test that needs to access the hostflag. This is public API in OpenSSL but since nothing seems to be using this, this accessor will be kept internal-only for the time being. ok jsing
* Enable policy checking by default now that we are DAG implementation based.beck2023-04-281-4/+1
| | | | | | | This ensures that we will no longer silently ignore a certificate with a critical policy extention by default. ok tb@
* Garbage collect the now unused obfuscating macro string_stack_free()tb2023-04-161-4/+1
|
* Inline the three uses of string_stack_free()tb2023-04-161-4/+4
| | | | | | | sk_OPENSSL_STRING_pop_free() is much more explicit and isn't that much more complicated. x509_util.c can also use it directly... No binary change
* x509_vfy.c and x509_vpm.c don't need vpm_int.h anymoretb2023-04-161-2/+1
|
* libressl *_namespace.h: adjust *_ALIAS() to require a semicolontb2023-02-161-31/+31
| | | | | | | | | | LCRYPTO_ALIAS() and LSSL_ALIAS() contained a trailing semicolon. This does not conform to style(9), breaks editors and ctags and (most importantly) my workflow. Fix this by neutering them with asm("") so that -Wpedantic doesn't complain. There's precedent in libc's namespace.h fix suggested by & ok jsing
* Make internal header file names consistenttb2022-11-261-2/+2
| | | | | | | | | | | | | | | | Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
* Hide public symbols in libcrypto/x509 .c filesbeck2022-11-141-1/+31
| | | | ok tb@
* Prepare to provide X509_VERIFY_PARAM_get_time()tb2022-07-041-1/+7
| | | | ok jsing sthen
* Prepare to provide X509_VERIFY_PARAM_set_auth_level()tb2022-06-271-1/+7
| | | | | | | | For some unknown reason this needed a different name than security_level, both internally and in the public API. Obviously it is exactly the same garbage. ok beck jsing
* Move the now internal X.509-related structs into x509_lcl.h.tb2021-11-011-1/+2
| | | | | | | | Garbage collect the now unused LIBRESSL_CRYPTO_INTERNAL and LIBRESSL_OPAQUE_X509. Include "x509_lcl.h" where needed and fix a couple of unnecessary reacharounds. ok jsing
* Enable X509_V_FLAG_TRUSTED_FIRST by default in the legacy verifier.jsing2021-09-301-1/+2
| | | | | | | | | | | | In order to work around the expired DST Root CA X3 certficiate, enable X509_V_FLAG_TRUSTED_FIRST in the legacy verifier. This means that the default chain provided by Let's Encrypt will stop at the ISRG Root X1 intermediate, rather than following the DST Root CA X3 intermediate. Note that the new verifier does not suffer from this issue, so only a small number of things will hit this code path. ok millert@ robert@ tb@
* Enable the new verifier again so hopefully the remaining kinks get ironedtb2021-04-241-2/+2
| | | | | | out in this release cycles. discussed with deraadt and jsing
* Switch back to the legacy verifier for the release.tb2021-04-151-2/+2
| | | | | | | | | | | This is disappointing as a lot of work was put into the new verifier during this cycle. However, there are still too many known bugs and incompatibilities. It is better to be faced with known broken behavior than with new broken behavior and to switch now rather than via errata. This way we have another cycle to iron out the kinks and to fix some of the remaining bugs. ok jsing
* Don't leak param->name in x509_verify_param_zero()tb2021-04-051-1/+2
| | | | | | | | | For dynamically allocated verify parameters, param->name is only ever set in X509_VERIFY_set1_name() where the old one is freed and the new one is assigned via strdup(). Setting it to NULL without freeing it beforehand is a leak. looks correct to millert, ok inoguchi
* Fix some KNF issuestb2020-12-161-7/+8
|
* re-enable new x509 chain verifier as the defaultbeck2020-09-141-3/+1
| | | | ok tb@
* revert previous, need to fix a problembeck2020-09-141-1/+3
|
* Enable the use of the new x509 chain validator by default.beck2020-09-141-3/+1
| | | | ok jsing@ tb@
* Add new x509 certificate chain validator in x509_verify.cbeck2020-09-131-1/+3
| | | | | | | | | | | | | | | | | | | The new validator finds multiple validated chains to handle the modern PKI cases which may frequently have multiple paths via different intermediates to different roots. It is loosely based on golang's x509 validator This includes integration so that the new validator can be used via X509_verify_cert() as well as a new api x509_verify() which will return multiple chains (similar to go). The new validator is not enabled by default with this commit, this will be changed in a follow on commit. The new public API is not yet exposed, and will be finalized and exposed with a man page and a library minor bump later. ok tb@ inoguchi@ jsing@
* poison for X509_VERIFY_PARAM'sbeck2018-04-061-27/+42
| | | | | | | | | | | | Tighten up checks for various X509_VERIFY_PARAM functions, and allow for the verify param to be poisoned (preculding future successful cert validation) if the setting of host, ip, or email for certificate validation fails. (since many callers do not check the return code in the wild and blunder along anyway) Inspired by some discussions with Adam Langley. ok jsing@
* Call strlen() if name length provided is 0, like OpenSSL does.beck2018-03-221-1/+3
| | | | | Issue notice by Christian Heimes <christian@python.org> ok deraadt@ jsing@
* Please variable decl before code.deraadt2017-12-091-2/+2
|
* Remove prototypes from the public header for X509_VERIFY_PARAM functionsjsing2016-12-211-1/+6
| | | | | | that were recently added but not intended to be made public at this stage. Discussed with beck@
* Commit a reminder that the default is not the default. This needs tobeck2016-11-061-1/+2
| | | | | be revisited. ok jsing@
* use the correct function for freebcook2016-11-061-2/+2
| | | | ok beck@
* Part one of the alt chains changes, bring in newer modifications tobeck2016-11-051-69/+311
| | | | | VERIFY_PARAMS - based on boringssl. ok jsing@ miod@
* X509_VERIFY_PARAM_set1_name(): if invoked with NULL as the secondmiod2014-09-291-1/+2
| | | | | parameter, correctly set param->name to NULL after having freed it. ok bcook@
* Kill a bunch more BUF_strdup's - these are converted to have a check forbeck2014-07-221-2/+4
| | | | | NULL before an intrinsic strdup. ok miod@
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-111-3/+2
| | | | | | | | Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-101-1/+2
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* no need for null check before free. from Brendan MacDonelltedu2014-05-301-2/+1
|