summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ecdh
AgeCommit message (Collapse)Author
2023-07-28Remove some unneeded includes from ecdh.cTheo Buehler
2023-07-28Pull up zeroing of out; drop unnecessary checkTheo Buehler
Move the zeroing of the output buffer a few lines up and remove an unnecessary check. requested/ok jsing
2023-07-28Rename buflen to buf_len, use calloc/freezeroTheo Buehler
Some cosmetic tweaks in ecdh_compute_key(). Rename buflen to buf_len to match out_len, use calloc() and freezero(). ok jsing
2023-07-28Move KDF handling to ECDH_compute_key()Theo Buehler
In OpenSSL e2285d87, the KDF handling was moved from the compute_key() method into the public API. A consequence of this change is that the ECDH_compute_key() API no longer returns -1 for some errors. Existing checks for <= 0 are safe as are those checking for the exact length as return value, which is all what the ecosystem seems to be doing. ok jsing
2023-07-28Merge ecdh.h into ec.hTheo Buehler
The remaining two ECDH interfaces are relocated into ec.h. ecdh.h remains. It does nothing but include ec.h. ok jsing
2023-07-28Excise ECDH_METHODTheo Buehler
Unlike ECDSA_METHOD, this has been unused forever but kind of needed to stay for symmetry with ECDSA_METHOD. Now we can finally take it behind the barn and remove its tendrils into ENGINE. ok jsing
2023-07-28Remove ECDH errorsTheo Buehler
Much like the ECDSA errors, the ECDH errors have been unused for a while. Garbage collect them. ok jsing
2023-07-24Fix two EC_POINT_is_on_curve() checksTheo Buehler
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
2023-07-12Revert accidental addition of cofactor ECDH supportTheo Buehler
This snuck in with ech_key.c r1.33 because I committed from a dirty tree.
2023-07-07Hide symbols in hkdf, evp, err, ecdsa, and ecBob Beck
(part 2 of commit) ok jsing@
2023-07-05Mop up last uses of ECDHerror() and ECDSAerror()Theo Buehler
ok jsing
2023-07-05ECDHerror() and ECDSAerror will go awayTheo Buehler
Move some trivial ones to ECerror(). discussed with jsing
2023-07-05Merge ECDH code that will stay into ecdh.cTheo Buehler
2023-07-05Drop useless ossl_ prefixesTheo Buehler
discussed with jsing
2023-07-02Unconditionally zero the ECDH keyTheo Buehler
While memset() is quite expensive, we can afford zeroing a few extra bytes to make this code more readable. ok beck jsing
2023-07-02Move the EC_POINT a bit down and a * to the right placeTheo Buehler
2023-07-02ech_key.c: Fix includesTheo Buehler
We need stdint.h for uintptr_t, stdlib.h for malloc, ec.h for various things, but there's no need for objects. or sha.h.
2023-07-01Reverse polarity to avoid an overlong lineTheo Buehler
2023-07-01Reword comment to fit on a single lineTheo Buehler
2023-07-01tmp is a silly name for a point on an elliptic curveTheo Buehler
2023-07-01Garbage collect the now unused lenTheo Buehler
2023-07-01Test and assign for EC_KEY_get0_private_key()Theo Buehler
2023-07-01Add a missing NULL check for groupTheo Buehler
ok jsing
2023-07-01Reference commit needed in the next major bumpTheo Buehler
2023-07-01Simplify handling of retTheo Buehler
ok jsing
2023-07-01Use BN_bn2binpad() instead of handrolling itTheo Buehler
As ugly as the BN_bn2binpad() internals are, what it does is quite handy with all sorts of EC stuff. So use it here too and eliminate some ugly manual pointer zeroing and offsets. Also switch len and buflen from size_t to int to remove an iffy cast: both are set by functions that return a non-negative int. ok jsing
2023-07-01Remove unused y from ECDH key computationTheo Buehler
ok jsing
2023-06-25Add missing RCS markerTheo Buehler
2023-06-25Remove unneeded bn_local.h and drop a NULL checkTheo Buehler
2023-06-25Remove ech_local.hTheo Buehler
2023-06-25Stop including ech_local.hTheo Buehler
2023-06-25Move ecdh_KDF_X9_63() to ec_local.hTheo Buehler
In anticipation of merging ecdh/ and ecdsa/ into ec/, move the last remaining thing in ech_local.h where it will soon belong.
2023-06-25Move ECDH_size() to ech_key.cTheo Buehler
This way the public ECDH API that will remain in libcrypto is in one file and the public ECDH API that will go is in the other one.
2023-06-25Move the ecdh_method struct declaration to ech_lib.cTheo Buehler
No other file uses this anymore
2023-06-25Move ECDH_OpenSSL() ECDSA_OpenSSL() to *_lib.cTheo Buehler
Now that they no longer use static methods, they can move where they belong. Also make the static method const, as it should have been all along.
2023-06-25Remove {ecdh,ecdsa}_check() and {ECDH,ECDSA}_DATATheo Buehler
This is now unused code. Removing it will free us up to remove some other ugliness in the ec directory. ok jsing
2023-06-25Remove method wrappers that use {ecdh,ecdsa}_check()Theo Buehler
Now that it is no longer possible to set a custom {ECDH,ECDSA}_METHOD, EC_KEY_METHOD can just call the relevant method directly without the need for this extra contortion. ok jsing
2023-06-25Make ECDH and ECDSA ex_data handlers always failTheo Buehler
They will be removed in the next major bump. No port uses them. They use code that is in the way of upcoming surgery. Only libtls and smtpd used to use the ECDSA version. ok jsing
2023-06-25Make {ECDH,ECDSA}_set_method() always failTheo Buehler
They will be removed in the next major bump. No port uses them. They use code that is in the way of upcoming surgery. Only libtls used the ECDSA version, but thankfully op cleaned that up. ok jsing
2023-06-25ech_local.h: remove unused ECDH_FLAG_FIPS_METHODTheo Buehler
2023-04-25Move EC_KEY_{insert,set}_key_method_data() to internal-onlyTheo Buehler
2023-04-18Move some includes out of OPENSSL_NO_DEPRECATEDTheo Buehler
Some headers were included conditionally on OPENSSL_NO_DEPRECATED in hopes that eventually the mess of everything includes everything will magically resolve itself. Of course everyone would end up building openssl with OPENSSL_NO_DEPRECATED over time... Right. Surprisingly, the ecosystem has come to rely on these implicit inclusions, so about two dozen ports would fail to build because of this. Patching this would be easy but really not worth the effort. ok jsing
2022-11-26Make header guards of internal headers consistentTheo Buehler
Not all of them, only those that didn't leak into a public header... Yes.
2022-11-26Make internal header file names consistentTheo Buehler
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
2022-07-12Remove mkerr.pl remnants from LibreSSLKlemens Nanni
This script is not used at all and files are edited by hand instead. Thus remove misleading comments incl. the obsolete script/config. Feedback OK jsing tb
2022-06-30Replace obj_mac.h with object.hTheo Buehler
Pointed out by and ok jsing
2021-12-04Add #include "bn_lcl.h" to the files that will soon need it.Theo Buehler
ok inoguchi jsing
2021-04-20Simplify code after adding EC_POINT_{s,g}et_affine_coordinates()Theo Buehler
ok jsing
2021-04-20Prepare to provide EC_POINT_{g,s}et_affine_coordinatesTheo Buehler
Similar to part of OpenSSL commit 8e3cced75fb5fee5da59ebef9605d403a999391b ok jsing
2019-09-05Replace OPENSSL_cleanse() with explicit_bzero().Joel Sing