X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fec%2Fec_kmeth.c;h=4904989d63f784497e5b7ee53fe9e39efa160043;hp=f0e3fdeadf0b4c5e2be64e85ce8c4c79c14ccfa5;hb=5196641617ceef00af51128eb1db0083097d95e7;hpb=28572b577c9a8fa41d85e1d2dce8afb2892464cd diff --git a/crypto/ec/ec_kmeth.c b/crypto/ec/ec_kmeth.c index f0e3fdeadf..4904989d63 100644 --- a/crypto/ec/ec_kmeth.c +++ b/crypto/ec/ec_kmeth.c @@ -53,14 +53,18 @@ */ #include -#include +#ifndef OPENSSL_NO_ENGINE +# include +#endif #include #include "ec_lcl.h" static const EC_KEY_METHOD openssl_ec_key_method = { "OpenSSL EC_KEY method", - 0 + 0, + ossl_ec_key_gen, + ossl_ecdh_compute_key }; const EC_KEY_METHOD *default_ec_key_meth = &openssl_ec_key_method; @@ -118,3 +122,14 @@ EC_KEY *EC_KEY_new_method(ENGINE *engine) ret->references = 1; return (ret); } + +int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, + EC_KEY *eckey, + void *(*KDF) (const void *in, size_t inlen, void *out, + size_t *outlen)) +{ + if (eckey->meth->compute_key) + return eckey->meth->compute_key(out, outlen, pub_key, eckey, KDF); + ECerr(EC_F_ECDH_COMPUTE_KEY, EC_R_OPERATION_NOT_SUPPORTED); + return 0; +}