82 static int ecdh_compute_key(
void *out,
size_t len,
const EC_POINT *pub_key,
84 void *(*KDF)(
const void *in,
size_t inlen,
void *out,
size_t *outlen));
87 "OpenSSL ECDH method",
99 return &openssl_ecdh_meth;
108 static int ecdh_compute_key(
void *out,
size_t outlen,
const EC_POINT *pub_key,
110 void *(*KDF)(
const void *in,
size_t inlen,
void *out,
size_t *outlen))
119 unsigned char *buf=NULL;
121 if (outlen > INT_MAX)
133 if (priv_key == NULL)
146 if (!
EC_POINT_mul(group, tmp, NULL, pub_key, priv_key, ctx))
160 #ifndef OPENSSL_NO_EC2M
184 memset(buf, 0, buflen - len);
185 if (len != (
size_t)
BN_bn2bin(x, buf + buflen - len))
193 if (KDF(buf, buflen, out, &outlen) == NULL)
205 memcpy(out, buf, outlen);