summaryrefslogtreecommitdiff
path: root/src/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Garbage collect the unused order in check_discriminant()tb2023-07-261-4/+2
| | | | ok jsing
* Streamline check_discriminant()tb2023-07-261-14/+6
| | | | | | Instead of inlining EC_GROUP_get_curve(), we can simply call it... ok jsing
* Introduce ec_decode_scalar()tb2023-07-261-81/+39
| | | | | | | | | This is a helper that decodes a scalar from field-internal representation to a representation as a BIGNUM in the interval [0, p). This simplifies EC_GROUP_get_curve() and EC_POINT_get_Jprojective_coordinates() to a few obvious lines and prepares cleanup in EC_POINT_get_affine_coordinates(). ok jsing
* Use EC_POINT_set_to_infinity() rather than inlining ittb2023-07-261-6/+4
|
* Remove constructor attribute for OPENSSL_cpuid_setup() on arm/aarch64.jsing2023-07-262-10/+2
| | | | | | | | OPENSSL_cpuid_setup() is invoked via OPENSSL_init_crypto(), whihc is triggered by various entry points to the library. As such, we do not need to invoke it as a constructor. ok tb@
* Fix a few more 0/NULL misspellingstb2023-07-251-8/+8
|
* Use [a,b), not [a,b-1] in a commenttb2023-07-251-2/+2
|
* EC_POINT_is_on_curve() error is -1, not 0.tb2023-07-251-2/+2
| | | | ok miod
* Fix two EC_POINT_is_on_curve() checkstb2023-07-242-4/+4
| | | | | | | This API can fail for various reasons, in which case it returns -1, so you need to check if (EC_POINT_is_on_curve_checks(...) <= 0). ok miod
* Fix a minibug in DH_check()tb2023-07-241-2/+2
| | | | | | Or in the flag, don't overwrite the already set ones. ok jsing
* Remove OPENSSL_cpuid_setup() call from OPENSSL_add_all_algorithms_noconf()jsing2023-07-241-2/+1
| | | | | | | | | | OPENSSL_cpuid_setup() used to need to be called from OPENSSL_add_all_algorithms(), as that was the main entry point. These days we do on demand initialisation and there are various paths that lead to OPENSSL_init_crypto() being called, which in turn calls OPENSSL_cpuid_setup(). ok tb@
* Mark read/write registers as non-overlapping for bn_qwmulw_{addqw_,}addw()jsing2023-07-241-3/+3
| | | | | | This does not cause an issue currently, however if called differently to their current usage, it can lead to an input being overwritten and incorrect results being generated.
* Use C99 initializers for x509_name_fftb2023-07-241-8/+8
|
* Tweak previous. Should have been 60 instead of 64tb2023-07-221-3/+3
|
* Align argument names of OBJ_add_sigid() with the other functions.tb2023-07-221-2/+2
|
* Rewrite obj_xref.ctb2023-07-224-419/+291
| | | | | | | | | | | | Instead of having two unreadable tables placed in a header generated by a janky perl script from an ugly text file, use a single table inlined in the C file. This table is used to translate between signature algorithm OIDs and pairs of OIDs of a message digest and a cipher. The table has fewer than fifty entries and isn't used in a hot path. Using binary search is overkill. Just do two linear searches, one for each translation. None of the original code remains apart from the API. ok jsing
* No need to call OBJ_sigid_free() in EVP_cleanup() anymore.tb2023-07-221-2/+1
| | | | ok jsing
* Neuter OBJ_add_sigid() and OBJ_sigid_free()tb2023-07-221-93/+11
| | | | | | | | | | These functions will be removed in the upcoming bump. Nothing uses them, so it won't hurt if they become noops. This allows us to garbage collect the sig_app and sigx_app stacks and make a first step towards simplifying the OBJ_bsearch_() dances. Also sprinkle some const correctness... because we can. intermediate step towards a diff that is ok jsing
* Adapt bn_print() for EdDSA key printingtb2023-07-221-7/+40
| | | | | | | | This is essentially a reimplementation of ASN1_buf_print(). The latter was only added for these printing purposes and it will be removed again since nothing uses it. We can then simply remove t_pkey.c in the upcoming bump. ok jsing
* Simplify indent handling in bn_print()tb2023-07-221-6/+3
| | | | variant of a suggestion by jsing
* Fix #includes in ct_sct.ctb2023-07-221-5/+7
| | | | | | | This does not need tls1.h (upstream used TLSEXT constants we don't have) nor does it need evp.h. But it does need asn1.h, objects.h for STACK_OF and NID_*, among other things and it also uses uint64_t and allocates, so it needs stdint.h and stdlib.h.
* Actually add OBJ_find_sigid_algstb2023-07-221-0/+90
|
* Rename OBJ_add_sigid.3 to OBJ_find_sigid_algs.3tb2023-07-222-92/+2
|
* Add missing license for rsa_local.htb2023-07-211-1/+57
| | | | discussed with jsing
* Simple adjustments for DSO removaltb2023-07-212-8/+6
| | | | openssl.cnf.5 will need a major overhaul. But that isn't new...
* Stop mentioning some ERR_load_*_strings that will be removedtb2023-07-211-6/+2
|
* Provide a bunch of always failing ENGINE APItb2023-07-213-6/+166
| | | | | | | | | | | | | | | This commit adds a few symbols under OPENSSL_NO_ENGINE. They will be used after the main ENGINE code is disabled in the next bump. The ecosystem is mostly prepared for dealing with a libcrypto compiled with OPENSSL_NO_ENGINE. There are a few stragglers like M2Crypto, dovecot and the latest apr-util release (fixed in their development branch). To avoid intrusive patching in these ports, we need to keep a bunch of ENGINE symbols around despite adding OPENSSL_NO_ENGINE. This of course meant patching some other ports, but that was way easier. ok jsing
* Fix Xr order to appease mandoc -Tlinttb2023-07-211-4/+4
|
* Remove OBJ_add_sigid and OBJ_sigid_free documentationtb2023-07-215-54/+14
| | | | | These will be made internal and will likely go away. The OBJ_add_sigid.3 manual should probably be renamed; this can be done in a second step.
* Remove ASN1_buf_print documentationtb2023-07-213-74/+3
| | | | This function will be made internal-only and likely be renamed/rewritten.
* Remove remaining ECDSA_METHOD documentationtb2023-07-211-29/+4
|
* Remove documentation of ECDH/ECDSA ex_data APItb2023-07-211-21/+3
|
* Document ENGINE_get_default_ECtb2023-07-211-17/+8
| | | | | | | ENGINE_get_default_{ECDH,ECDSA} will go away and won't come back. Replace their documentation with the missing ENGINE_get_defaulT_EC. In the unlikely event that we will need to bring back ENGINE after the next bump, this manual will not be outdated and incomplete.
* Document ENGINE_{get,set}_ECtb2023-07-211-29/+17
| | | | | | | ENGINE_{get,set}_{ECDH,ECDSA} will go away and won't come back. Replace their documentation with the missing ENGINE_{get,set}_EC. In the unlikely event that we will need to bring back ENGINE after the next bump, this manual will not be outdated and incomplete.
* Remove some ancient cruft that hasn't been used in agestb2023-07-204-1695/+1
| | | | discussed with jsing
* Move get_rfc3526_prime_8192.3 to BN_get_rfc3526_prime_8192.3tb2023-07-202-4/+4
| | | | | This way we will have a manual corresponding to an existing function after the next bump.
* Remove unnecessary inclusion of dso.htb2023-07-203-6/+3
|
* Remove last internal consumer of DSOtb2023-07-201-80/+9
| | | | | | | | | | | | It is currently possible to extend libcrypto by having it load a shared object via dlopen() either from a config file on library initialization or when an application calls the relevant API. Recent and not so recent events showed how dangerous an idea dlopen() is. Independently of such concerns, this should not be handled in the characteristically convoluted way of this toolkit. DSO will go away in the upcoming bump. This commit clears the road for a plain cvs rm of the dso code. ok jsing
* eng_aesni.c: add evp_local.h so it compiles again.tb2023-07-201-1/+3
|
* Remove get_rfc*_prime_* documentationtb2023-07-202-46/+20
| | | | | | Their BN_get_rfc*_prime_* aliases from the OpenSSL 1.1 API will remain. Perhaps the manual should be moved to BN_get_rfc3526_prime_8192.3; that can be done in a second step.
* Remove ECDSA_{do_,}sign_ex() and ECDSA_sign_setup()tb2023-07-204-103/+20
| | | | | These very poorly designed interfaces will go away, so stop documenting them.
* Cap the size of numbers we check for primalitytb2023-07-201-1/+12
| | | | | | | | | | | We refuse to generate RSA keys larger than 16k and DH keys larger than 10k. Primality checking with adversarial input is a DoS vector, so simply don't do this. Introduce a cap of 32k for numbers we try to test for primality, which should be more than large enough for use withing a non-toolkit crypto library. This is one way of mitigating the DH_check()/EVP_PKEY_param_check() issue. ok jsing miod
* Fix two aliases in libcrypto spotted by the new symbols testtb2023-07-192-3/+4
| | | | ok jsing
* Mop up MD32_XARRAY from md5.jsing2023-07-151-91/+84
| | | | | | | MD32_XARRAY was added as a workaround for a broken HP C compiler (circa 1999). Clean it up to simplify the code. No change in generated assembly.
* Mop up MD32_XARRAY from md4.jsing2023-07-151-75/+68
| | | | | | | MD32_XARRAY was added as a workaround for a broken HP C compiler (circa 1999). Clean it up to simplify the code. No change in generated assembly.
* Refactor ASN1_item_sign_ctx()tb2023-07-131-54/+89
| | | | | | | | | | | | | | | | | | | | | | Oh, joy! The muppets had a feast: they could combine the horrors of EVP with X.509... Return values between -1 and 3 indicating how much work needs to be done, depending on whether methods are present or absent. Needless to say that RSA and EdDSA had inconsistent return values until recently. Instead of interleaving if/else branches, split out two helper functions that do essentially independent things, which results in something that isn't entirely bad. Well, at least not compared to the surrounding code. asn1_item_set_algorithm_identifiers() extracts the signature algorithm from the digest and pkey if known, and sets it on the two X509_ALGOR that may or may not have been passed in. asn1_item_sign() converts data into der and signs. Of course there were also a few leaks and missing error checks. ok jsing
* Revert accidental addition of cofactor ECDH supporttb2023-07-121-16/+2
| | | | This snuck in with ech_key.c r1.33 because I committed from a dirty tree.
* Remove old workaround for F5tb2023-07-111-13/+2
| | | | | | | | | | | F5 is well-known for needing workaround (go read RFC 8446). In this particular case, it required implementation sending CHs larger than 255 bytes to 0x0300 otherwise their server would hang. This is the same hang that required the CH padding extension which broke other implementations. The CH padding extension was removed ~6 years ago, so hopefully this kludge will no longer needed either. ok jsing
* Rename EC_KEY from r to key like in the rest of the filetb2023-07-101-4/+4
|
* Pull BIGNUM constants out of get_* function bodiestb2023-07-101-315/+331
| | | | | | | | | The get_rfc*_prime_* functions will be removed. The constants will remain for the BN_get_rfc*_prime_* functions. Make the latter call BN_bin2bn() directly on these constants rather than going through get_*. This avoids some overlong lines. Also KNF for some comments. Reduces the diff I currently carry by quite a bit.