summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Unexport the weird X509_OBJECT_up_ref_count()tb10 days2-5/+5
| | | | | | | | It's only used in x509_lu.c, so move it there. X509_OBJECT is not itself refcounted. This API bumps the refcount of its cert or CRL member. This isn't really useful outside of the library. ok jsing
* Unexport X509_NAME_print()tb10 days1-2/+1
| | | | | | | | | | Nothing uses this anymore. M2Crypto has been patched and a fix for opensc has been upstreamed. ok jsing This is the start of a major bump. Don't build the tree until I have synced sets in about 20 commits.
* Rename X509V3_get_section() to X509V3_get0_section()tb14 days5-13/+13
| | | | | | | | This makes it clear for those fluent in OpenSSL API gibberish that nothing needs to be freed here. This is because it returns something hanging off a hash entry owned by cnf. ok jsing
* Garbage collect X509V3_section_free()tb14 days5-20/+6
| | | | | | | | Historically, X509V3_section_free() could be customized by the conf db method to release memory allocated by X509V3_get_section(). This is no longer supported, so it is always a noop and can be removed. ok jsing
* unifdef OPENSSL_NO_CHAIN_VERIFYtb2025-03-041-6/+3
| | | | ok jsing
* Remove offensive whitespace from x509.htb2025-03-011-27/+27
|
* Remove unused name member from x509_sttb2025-02-211-2/+1
| | | | | | | As far as I can tell this has never been used since the beginning of git history with SSLeay 0.8.1b, so we can simplify the x509_cb() a little. ok jsing miod
* Remove unused valid member of x509_sttb2025-02-201-2/+1
| | | | | | internal_verify() (now x509_vfy_internal_verify()) used to cache the validity of the signature of a cert in this field. This is no longer the case since x509_vfy.c 1.57 (2017).
* Cache CRLs in issuer cachetb2025-02-082-18/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | The issuer cache holds a pair of SHA-512 of parent and child cert plus the result of the signature verification. Since CRLs also have a cached hash of their DER, we can easily add them to the same cache. This way we also avoid the cost of repeated signature verification for CRLs. For ordinary workloads the cache is larger than necessary and it won't currently take up more space than ~8M anyway, so the cost of doing this is negligible. For applications like rpki-client where the same (CA, CRL) pair is used to verify multiple EE certs, the gain is significant. In fact, the current worst case is a single pair being used for > 50k EE certs, responsible for about 20-25% of the total runtime of an ordinary rpki-client run if a hw-accelerated version of SHA-2 is available and even more if it isn't. In both cases the cost of processing of this pair is reduced by more than an order of magnitude. The implementation is a translation of x509_verify_parent_signature() to the case of CRLs and is entirely trivial thanks to the cache's design. Found while investigating a performance bottleneck found by job tested by job ok beck
* x509_verify_parent_signature(): no need to bump pkey's refcounttb2025-02-081-4/+2
| | | | | | | The parent certificate outlives the signature check, so we don't have to take a refcount of its pubkey and then release it again. ok beck
* x509_verify: missing verify error on cached signature mismatchtb2025-02-081-2/+5
| | | | | | | | If a signature mismatch is cached, the same error should be passed to the verify callback as if the mismatch was detected by doing the calculation, rather than falling back to the "unable to find the issuer cert locally". ok beck
* x509_obj.c: be better at sortingtb2025-01-271-2/+2
|
* x509_obj.c: fix includestb2025-01-261-4/+5
|
* Rewrite X509_NAME_ENTRY_oneline() using CBB and CBStb2025-01-262-104/+123
| | | | | | | | | | | | | | | | | | | | | | This splits the horrid spaghetti into a few relatively straightforward helpers which do one thing at a time. There are still some spectacular dances around ASN1_GENERALSTRING, but let's blame that one on X.500. In brief, X509_NAME_ENTRY_oneline() iterates over the name entries, and writes out a line /name1=value1,/name2=value2,... which you may have seen variations of in issuer or subject output. The name is the short name or the long name or the textual representation of the OID (truncated to 79 characters) and the value is a string where printable ASCII characters are represented as themselves and otherwise as hexadecimal digits preceded by \x. Except for GENERALSTRING, where the four octet representation is shortened to single-octet representation if none of the top three octets in the entire string is populated. It's the mother of all pretty things. But, hey, you could do worse and try to parse this garbage... ok jsing
* x509_utl.c: use normal order of internal headerstb2025-01-261-3/+2
|
* typo: slighty -> slightlytb2025-01-061-2/+2
|
* Tweak doc comment of _X509_CHECK_FLAG_DOT_SUBDOMAINStb2024-12-241-4/+3
| | | | | Now that it lives in a .c file, there's no need to point out that it is non-public...
* Internal linkage for one constant struct where that was accidentallyschwarze2024-12-241-2/+2
| | | | | | | | | forgotten in rev. 1.3 on July 13 this year. No library bump and no ABI change because libcrypto.so.55.0 did not export the symbol because it wasn't in Symbols.list. Found in a partial code audit focusing on X509V3_EXT_METHOD objects.
* Move _X509_CHECK_FLAG_DOT_SUBDOMAINS to x509_utl.ctb2024-12-232-9/+9
| | | | | | | | Unclear why this ever had to be made public since it's only used in a single file. Anyway, nothing uses this, so remove it. This went through a full bulk pointed out by/ok schwarze
* Remove the EXT_* table building macrostb2024-12-231-19/+1
| | | | | | | | These were used in x509_bitst.c and x509_ia5.c for populating tables that have been expanded a long time ago. Nothing uses them, so remove them. This went through a full bulk pointed out by/ok schwarze
* Annotate ENUMERATED_NAMES for potential removaltb2024-12-231-1/+2
| | | | | Only security/xca uses it for no good rean. It can use BIT_STRING_BITNAME if it really needs to.
* Remove X509V3_EXT_{DYNAMIC,CTX_DEP}tb2024-12-231-4/+2
| | | | | | | | | | LibreSSL has removed support for dynamically allocated custom extension methods. The mysterious CTX_DEP define was part of an experimental code dump and that part of the experimental code was never shown hence never reviewed. This went through a full amd64 bulk noticed by/ok schwarze
* Fix the error handling in X509V3_parse_list(3); it ignored failuresschwarze2024-12-231-6/+9
| | | | | | | | | | | | | of the internal subroutine X509V3_add_value(), which could result in silently losing part of the input data on memory exhaustion. I independently rediscovered this bug while writing the documentation, then noticed after fixing it that Zhou Qingyang <zhou1615 at umn dot edu> fixed it in essentially the same way in OpenSSL 3 (commit bcd5645b on Apr 11 02:05:19 2022 +0800), but it wasn't backported to the OpenSSL 1.1.1 branch. OK tb@
* Annotate yet another greasy stinky tentacle of xcatb2024-12-201-1/+2
| | | | I'm so tired of this.
* Use ASIdentifiers rather than struct ASIdentifiers_sttb2024-12-041-2/+2
| | | | | | This matches the other members of X509 and is what's used everywhere else. ok miod
* x509_policy.c: point at RFC 9618tb2024-11-141-3/+3
|
* Move cryptlib.h to crypto_local.htb2024-11-051-2/+2
| | | | discussed with jsing
* Drop some pointless parenthesestb2024-11-011-7/+7
|
* Only include cryptlib.h where it's neededtb2024-11-011-4/+3
| | | | Clean up the other includes while there.
* Rewrite X509V3_add_value() to a single exit idiomtb2024-08-311-19/+32
| | | | ok jsing
* Expose X509_get_signature_infotb2024-08-311-3/+1
| | | | | | | | To compensate for all the removals, a single, small, constructive piece of this bump: expose X509_get_signature_info() so that libssl's security level API can handle RSA-PSS certificates correctly. ok beck jsing
* Make X509at_* API internaltb2024-08-313-54/+18
| | | | | | | | The only consumer, yara, has been adjusted. It will be some more work to remove this idiocy internally, but at least we will no longer have to care about external consumers. ok beck jsing
* Remove EVP_PKEY.*attr* APItb2024-08-311-19/+1
| | | | | | I ranted enough about this recently. PKCS#12. Microsoft. 'nuff said. ok beck jsing
* Move BIT_STRING_BITNAME tables to consttb2024-08-312-6/+6
| | | | | | | | | Another bunch of const correctness fixes for global tables. These are used to map ns cert types, key usage types and CRL reasons to strings and vice versa. By the looks of it, nobody ever figured out how to use this (need I mention that it's convoluted?). ok beck jsing
* const correct X509_LOOKUP_METHODtb2024-08-316-19/+19
| | | | | | | With this another family of global tables becomes const as it should always have been. ok beck jsing
* Remove X509_REQ_{set,get}_extension_nids()tb2024-08-312-23/+2
| | | | | | | | LibreSSL no longer supports non-standard OIDs for use in the extensions attribute of CSRs. The API that enabled that (and nobody used of course) can now go. ok beck jsing
* Make X509_VAL opaquetb2024-08-312-6/+8
| | | | | | | Nothing needs to reach into this structure, which is part of certificates. So hide its innards. ok beck jsing
* Remove X509_check_trust() and some related definestb2024-08-313-32/+10
| | | | | | | | | Someone thought it would be a good idea to append non-standard trust information to the certs in the trust store. This API is used to inspect that depending on the intended purpose of the cert. Only M2Crypto thought it necessary to expose this. It was adjusted. ok beck jsing
* The X509V3_CONF_METHOD goes awaytb2024-08-311-10/+1
| | | | | | No longer used, never really needed. ok beck jsing
* Remove X509V3_get_string/X509V3_string_freetb2024-08-312-19/+2
| | | | | | | These have always been unused, but the db_meth abstraction hid that very well. Bye. ok beck jsing
* Make some more x509 conf stuff internaltb2024-08-3110-48/+39
| | | | | | | This internalizes a particularly scary layer of conf used for X.509 extensions. Again unused public API... ok beck jsing
* Retire X509V3_set_conf_lhash()tb2024-08-312-13/+2
| | | | | | | | Thankfully sthen removed the out-of-support PHP versions 7.4 and 8.0, which were the last users of this API, which in turn permitted much of this conf rampage. Now the stub can join its guts in the attic. ok beck jsing
* Retire X509V3_EXT_{,CRL_,REQ_}add_conf()tb2024-08-312-35/+2
| | | | | | | | Fortunately all projects who want to configure their extensions using a dangerous string DSL/API figured out the fact that one was supposed to be using the nconf version of these (the hint is the 'n', as in new). ok beck jsing
* Unexport some conf layers unused outside of libcryptotb2024-08-311-1/+3
| | | | | | | | | | | | | imodules are called imodules because they contain Information about modules that have been Initialized. Which one of these two I it is is anyone's best guess. Why anything outside of libcrypto would ever possibly care will also remain a mystery. Remove the old way of adding a conf module, user data, stop allowing to set a method (it's opaque now, remember?) and drop a couple bits more from the public api interface. ok beck jsing
* Make CONF_METHOD opaquetb2024-08-311-1/+2
| | | | | | | Much of conf is designed in such a way that you really have to reach into its structs. This one piece can be hidden. It might even be removed soon. ok beck jsing
* Get rid of last use of db_methtb2024-08-281-38/+11
| | | | | | | | | | | | Nothing touches db_meth in ports. Thus only way a db_meth can be set is now as a side effect X509V3_set_conf() in which case the db is an NCONF database and the db_meth will be a thin wrapper of NCONF_get_section(). Make that explicit in the implementation, remove the guts of the unused X509V3_get_string() and X509V3_string_free(), turn X509V3_section_free() into a noop and replace several checks for ctx->db, ctx->db->meth, ... with a simple ctx->db != NULL check. ok beck jsing
* Remove a few obvious comments, unwrap a few lines and annotate sometb2024-08-281-26/+9
| | | | functions for removal
* Turn X509V3_set_conf_lhash() into a nooptb2024-08-281-26/+1
| | | | | | Another legacy turd that was only used by PHP 7.4 and 8.0. ok beck jsing