summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-314-28/+3
| | | | | | | | 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-313-7/+11
| | | | | | | 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-315-35/+11
| | | | | | | | | 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
* Remove ERR_add_{,v}data()tb2024-08-314-40/+3
| | | | | | Another unused bit of legacy API... 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-3113-72/+42
| | | | | | | 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-314-16/+3
| | | | | | | | 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-314-42/+3
| | | | | | | | 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
* Remove OPENSSL_load_builtin_modulestb2024-08-316-10/+9
| | | | | | | This became obsolete with the automatic library initialization. Now it is time for it to become an internal API. ok beck jsing
* Unexport CONF_set_nconf()tb2024-08-313-6/+5
| | | | | | | This translation device from old to new conf guts will need to stay for a while. However, it's only needed internally. ok beck jsing
* Remove more CONF_* functions that are no longer neededtb2024-08-314-153/+3
| | | | | | | | This is the next layer of unused cruft that can now go. The code lovingly called it 'the "CONF classic" functions'. No tear was shed. Don't worry, we still have the "New CONF" functions! ok beck jsing
* Inline last use of CONF_free()tb2024-08-311-2/+5
| | | | | | | This permits another single-use-no-longer-public API to join the party in the bit bucket. ok beck jsing
* Unexport NCONF_defaulttb2024-08-315-8/+6
| | | | | | | | The only project I'm aware of that ever used this was rust-openssl and they did so for no good reason. So remove this API, the crate's code is already adjusted accordingly. ok beck jsing
* Inline NCONF_free_data in its only usertb2024-08-314-16/+4
| | | | ok beck jsing
* const correct uses of CONF_METHODtb2024-08-314-13/+13
| | | | | | | While not all of this is strictly needed, it was simply incorrect. This way another global which was modifiable for no good reason becomes const. ok beck jsing
* Stop using conf->meth_data and make CONF_type_default consttb2024-08-313-7/+7
| | | | | | | | | Now that we no longer need to hang a poor man's ctype substitute off the conf structure, we can get rid of the otherwise unused meth_data member. This allows us to const correct CONF_type_default. Hopefully we can remove it soon. ok beck jsing
* Remove NCONF_WIN32tb2024-08-315-75/+4
| | | | | | | Undocumented and entirely unused. Gets rid of a big, modifiable, global table. ok beck jsing
* Retire conf_api.h and the API thereintb2024-08-318-146/+17
| | | | | | | This makes the _CONF_* layer of the conf module internal and gets rid of the entirely unused conf_api.h. ok beck jsing
* Unexport some conf layers unused outside of libcryptotb2024-08-3110-84/+31
| | | | | | | | | | | | | 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-317-19/+92
| | | | | | | 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
* Remove unused {,N}CONF_dump_{bio,fp}()tb2024-08-314-68/+3
| | | | | | | | It's time to start removing some horrors from the conf/ garbage. If the current top layer wasn't terrible enough, you could always slap another one on top of it and it would then be truly marvellous. ok beck jsing
* Remove EVP_PKEY_*check againtb2024-08-314-40/+3
| | | | | | | | | | | | | | | This API turned out to be a really bad idea. OpenSSL 3 extended it, with the result that basically every key type had its own DoS issues fixed in a recent security release. We eschewed these by having some upper bounds that kick in when keys get insanely large. Initially added on tobhe's request who fortunately never used it in iked, this was picked up only by ruby/openssl (one of the rare projects doing proper configure checks rather than branching on VERSION defines) and of course xca, since it uses everything it can. So it was easy to get rid of this again. ok beck jsing
* Garbage collect the DH_check*_ex() APItb2024-08-302-75/+4
| | | | | | | | | This was only needed by the EVP_PKEY_*check() API, which was defanged. So this silly garbage can now go: it translated flags to errors on the error stack so that openssl *check could print ugly errors while DoS-ing the user. ok beck
* Remove cross references to whirlpooltb2024-08-302-6/+4
|
* Remove documentation of EVP_whirlpooltb2024-08-292-85/+1
|
* Remove documentation of ERR_add_error_{,v}data()tb2024-08-292-41/+8
|
* HMAC_Init() is dead. Long live HMAC_Init_ex()tb2024-08-291-17/+2
|
* Remove documentation of (caveat on) X509_TRUST_DEFAULTtb2024-08-291-12/+2
| | | | Sadly, it's going to go away before ever having become the default.
* Remove the pkey_{,public_,param_}check() handlerstb2024-08-295-140/+15
| | | | | | | | This disables the EVP_PKEY_*check() API and makes it fail (more precisely indicate lack of support) on all key types. This is an intermediate step to full removal. Removal is ok beck jsing
* repair bizzare indents; ok tbderaadt2024-08-292-4/+12
|
* def_create(): switch from malloc() to calloc()tb2024-08-281-2/+2
| | | | ok jsing
* Get rid of last use of db_methtb2024-08-282-41/+14
| | | | | | | | | | | | 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-282-28/+3
| | | | | | Another legacy turd that was only used by PHP 7.4 and 8.0. ok beck jsing
* Add LCRYPTO_USED(X509_get_signature_info)tb2024-08-281-1/+2
|
* Disable X509V3_EXT{,_CRL,_REQ}_add_conf()tb2024-08-282-21/+11
| | | | | | | 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
* Annotate X509V3_CONF_CTX and its only instance for removaltb2024-08-281-4/+3
| | | | | | | A comment saying /* Maybe more here */ in a public also goes (yuck). Of course the promise was fulfilled by OpenSSL 3. ok beck jsing
* Make use of X509_get_signature_info() in check_sig_level()tb2024-08-281-20/+3
| | | | | | | | | | | | | | | 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
* Document X509_get0_signature_info()tb2024-08-281-3/+70
| | | | | | | | Loosely based on the OpenSSL 1.1 documentation but extended quite a bit to explain what the flags mean and what info they do (and do not) convey. With the usual valuable feedback from jmc. ok jmc
* Implement X509_get_signature_info()tb2024-08-286-5/+204
| | | | | | | | | | | | | | | | 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
* Fix underlying pkey of RSA-PSStb2024-08-281-2/+2
| | | | | | | | | | | | | | | | | | | | There are currently very few differences between the rsa_asn1_meth for plain RSA and the rsa_pss_asn1_meth for RSA-PSS apart from the obviously necessary differnces for base_method, pkey_id, pem_str and info (and the fact that RSA has support for legacy private key encoding). This had the lucky side effect that it didn't really matter which ameth one ended up using after OBJ_find_sigid_algs(). With the upcoming support for X509_get_signature_infO() for RSA-PSS, this needs to change as for RSA-PSS we need to decode the PSS parameters for extracting the "security level", whereas for RSA we can just use the hash length. Thus, for RSA-PSS switch pkey_id from the incorrect rsaEncryption to rassaPss. ok jsing PS: OBJ_find_sigid_algs() manual is no longer entirely correct, but this has been the case since we added Ed25519 support to obj_xref.
* Add a comment to OCSP_id_issuer_cmp() to make blind use of X509_ALGOR_cmp()tb2024-08-281-1/+6
| | | | | | less likely. ok jsing
* Clean up and simplify OCSP_cert_id_new()tb2024-08-281-21/+16
| | | | | | | Use proper NULL checks, set hashAlgorithm with X509_ALGOR_set0_by_nid(), and avoid a silly digerr label. ok jsing
* Avoid reaching into X509_ALGOR in ocsp_certid_print()tb2024-08-281-2/+6
| | | | ok jsing
* Avoid polluting the error stack when printing certificatestb2024-08-281-3/+17
| | | | | | | | | | | | | | For a certificate serial number between LONG_MAX and ULONG_MAX, the call to ASN1_INTEGER_get() fails and leaves an error on the stack because the check bs->length <= sizeof(long) doesn't quite do what it's supposed to do (bs is probably for bitstring, although the more common reading would be adequate, too.) Fix this by checking for non-negativity and using ASN1_INTEGER_get_uint64() and add a lengthy comment to explain the nonsense per beck's request. discussed with jsing ok beck
* cms_att.c: tidy includes and add x509_local.h for upcoming changetb2024-08-271-5/+5
|
* replace atoi(3) usage with strtonum(3); ok/tweaks tb@op2024-08-263-16/+64
|