summaryrefslogtreecommitdiff
path: root/lib/libcrypto/x509
AgeCommit message (Collapse)Author
8 daysUse ASIdentifiers rather than struct ASIdentifiers_stTheo Buehler
This matches the other members of X509 and is what's used everywhere else. ok miod
2024-11-14x509_policy.c: point at RFC 9618Theo Buehler
2024-11-05Move cryptlib.h to crypto_local.hTheo Buehler
discussed with jsing
2024-11-01Drop some pointless parenthesesTheo Buehler
2024-11-01Only include cryptlib.h where it's neededTheo Buehler
Clean up the other includes while there.
2024-08-31Rewrite X509V3_add_value() to a single exit idiomTheo Buehler
ok jsing
2024-08-31Expose X509_get_signature_infoTheo Buehler
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
2024-08-31Make X509at_* API internalTheo Buehler
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
2024-08-31Remove EVP_PKEY.*attr* APITheo Buehler
I ranted enough about this recently. PKCS#12. Microsoft. 'nuff said. ok beck jsing
2024-08-31Move BIT_STRING_BITNAME tables to constTheo Buehler
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
2024-08-31const correct X509_LOOKUP_METHODTheo Buehler
With this another family of global tables becomes const as it should always have been. ok beck jsing
2024-08-31Remove X509_REQ_{set,get}_extension_nids()Theo Buehler
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
2024-08-31Make X509_VAL opaqueTheo Buehler
Nothing needs to reach into this structure, which is part of certificates. So hide its innards. ok beck jsing
2024-08-31Remove X509_check_trust() and some related definesTheo Buehler
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
2024-08-31The X509V3_CONF_METHOD goes awayTheo Buehler
No longer used, never really needed. ok beck jsing
2024-08-31Remove X509V3_get_string/X509V3_string_freeTheo Buehler
These have always been unused, but the db_meth abstraction hid that very well. Bye. ok beck jsing
2024-08-31Make some more x509 conf stuff internalTheo Buehler
This internalizes a particularly scary layer of conf used for X.509 extensions. Again unused public API... ok beck jsing
2024-08-31Retire X509V3_set_conf_lhash()Theo Buehler
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
2024-08-31Retire X509V3_EXT_{,CRL_,REQ_}add_conf()Theo Buehler
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
2024-08-31Unexport some conf layers unused outside of libcryptoTheo Buehler
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
2024-08-31Make CONF_METHOD opaqueTheo Buehler
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
2024-08-28Get rid of last use of db_methTheo Buehler
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
2024-08-28Remove a few obvious comments, unwrap a few lines and annotate someTheo Buehler
functions for removal
2024-08-28Turn X509V3_set_conf_lhash() into a noopTheo Buehler
Another legacy turd that was only used by PHP 7.4 and 8.0. ok beck jsing
2024-08-28Disable X509V3_EXT{,_CRL,_REQ}_add_conf()Theo Buehler
These legacy interfaces were only used by PHP 7.4 and 8.0 and they will be removed in an upcoming bump. ok beck jsing
2024-08-28Annotate X509V3_CONF_CTX and its only instance for removalTheo Buehler
A comment saying /* Maybe more here */ in a public also goes (yuck). Of course the promise was fulfilled by OpenSSL 3. ok beck jsing
2024-08-28Make use of X509_get_signature_info() in check_sig_level()Theo Buehler
If an auth_level (i.e., security_level, but not quite, because Viktor) was set on the X509_VERIFY_PARAM in the X509_STORE_CTX, the verifier would reject RSA-PSS or EdDSA certificates for insufficient security bits due to incorrect use of OBJ_find_sigid_algs() (this was also a bug in the initial security level implementation in OpenSSL 1.1). Using X509_get_signature_info() fixes this while preserving behavior for all other algorithms. Reported by Steffen Ullrich as one of multiple issues with RSA-PSS. ok jsing
2024-08-28Implement X509_get_signature_info()Theo Buehler
This is a slightly strange combination of OBJ_find_sigid_algs() and the security level API necessary because OBJ_find_sigid_algs() on its own isn't smart enough for the special needs of RSA-PSS and EdDSA. The API extracts the hash's NID and the pubkey's NID from the certificate's signatureAlgorithm and invokes special handlers for RSA-PSS and EdDSA for retrieving the corresponding information. This isn't entirely free for RSA-PSS, but for now we don't cache this information. The security bits calculation is a bit hand-wavy, but that's something that comes along with this sort of numerology. ok jsing
2024-08-04x509_vfy.c: drop some unnecessary parenthesesTheo Buehler
2024-07-26Disable X509at_get_attr{,_count}() and X509at_delete_attr()Theo Buehler
These are (not so) thin wrappers around the stack API and only make things unreadable by adding an unneccesary layer of indirection and repeating checks already present in the stack API. X509at_delete_attr() is a masterpiece. ok jsing
2024-07-26Inline last user of X509at_get_attr()Theo Buehler
ok jsing
2024-07-26Inline trivial X509at_* calls in x509_reqTheo Buehler
ok jsing
2024-07-13Unify X.509v3 extension methodsTheo Buehler
Use C99 initializers for all structs (some were forgotten). Make all the structs static, call them x509v3_ext_* matching NID_*. Add accessors called x509v3_ext_method_* and use these to implement X509V3_EXT_get_nid(). This adds consistency and avoids a few contortions like grouping a few extensions in arrays to save a couple externs. ok beck jsing
2024-07-12Fix the horrible and undocumented behaviour of X509_check_trustBob Beck
Of allowing you to pass in a NID directly, instead of a trust_id, and have it work, as long as the trust_id's and the NID's did not overlap. This screwball behaviour was depended upon by the OCSP code that called X509_check_trust with the NID, instead of the trust id, so let's fix that. We also rename the confusingly named X509_TRUST_DEFAULT to X509_TRUST_ACCEPT_ALL which makes a lot more sense, and rototill this to remove the confusingly named static functions. This will shortly be follwed up by making this function private, so we have not bothered to fix the amazingly obtuse man page as it will be taken behind the barn at that time. ok tb@
2024-07-12Clean up in X509_check_trust.Bob Beck
The XXX comment in here is now outdated. Our behaviour matches boringssl in that passing in a 0 trust gets the default behavior, which is to trust the certificate only if it has EKU any, or is self signed. Remove the goofy unused nid argument to "trust_compat" and rename it to what it really does, instead of some bizzare abstraction to something simple so the code need not change if we ever change our mind on what "compat" is for X.509, which will probably only happen when we are back to identifying things by something more sensible like recognizable grunts and smells. ok jsing@
2024-07-12Drop the unused evp includeTheo Buehler
2024-07-12Rename the sk in this file to extsTheo Buehler
2024-07-12Avoid using ret for an X509_EXTENSIONTheo Buehler
Instead rename the **ext in this file to **out_ext, freeing up ext in X509_EXTENSION_create_by_OBJ() Appeases some jsing grumbling on review
2024-07-12Tweak variable names in X509v3_add_ext()Theo Buehler
x -> out_ext, sk -> exts requested by jsing on review
2024-07-12Rename crit to critical in this fileTheo Buehler
requested by jsing on review
2024-07-12Simplify X509_EXTENSION_get_critical()Theo Buehler
This is a silly API, but there are worse. ok jsing
2024-07-12Lose a few extra lines in X509_EXTENSION_set_object()Theo Buehler
ok jsing
2024-07-12Streamline X509_EXTENSION_create_by_OBJ()Theo Buehler
ok jsing
2024-07-12Clean up X509_EXTENSION_create_by_NID()Theo Buehler
Remove unnecessary ret parameter and freeing of obj (which looks like a double free or freeing of unallocated memory but actually isn't due to various magic flags). Also make this const correct. ok jsing
2024-07-12Rewrite X509v3_add_ext()Theo Buehler
This is another brilliancy straight out of muppet labs. Overeager and misguided sprinkling of NULL checks, going through the trademark poor code review, made this have semantics not matching what almost every other function with this signature would be doing in OpenSSL land. This is a long standing mistake we can't fix without introducing portability traps, but at least annotate it. Simplify the elaborate dance steps and make this resemble actual code. ok jsing
2024-07-12Simplify X509v3_get_ext() and X509v3_delete_ext()Theo Buehler
Drop unnecessary checks that are part of the stack API. ok jsing
2024-07-12Align X509v3_get_ext_by_critical() with X509v3_get_ext_by_OBJ()Theo Buehler
Plus, replace a manual check with a call to X509_EXTENSION_get_critical(). ok jsing
2024-07-12Clean up X509v3_get_ext_by_OBJ()Theo Buehler
Like most of its siblings, this function can be simplified significantly by making proper use of the API that is being built. Drop unnecessary NULL checks and other weirdness and add some const correctness. ok jsing
2024-07-08Hide global _it variables in x509v3.hBob Beck
ok tb@
2024-07-08Pretend to clarify the way ipv6_asc() worksJeremie Courreges-Anglas
Give example IPv6 addresses to clarify what is meant with 1, 2 or 3 zero length elements. tb made me look. perverted, twisted, crippled