586 #ifndef OPENSSL_V_3_0 593 if (1 != EC_POINT_oct2point(
group,
pubkey, src.get_buffer(),
599 const int numbits = EC_GROUP_get_degree(
group);
600 dst.length((numbits + 7) / 8);
602 const int len = ECDH_compute_key(dst.get_buffer(), dst.length(),
pubkey,
611 if (EVP_PKEY_todata(keypair, EVP_PKEY_PUBLIC_KEY, ¶ms) <= 0) {
615 for (OSSL_PARAM* p = params; grp == 0 && p != 0 && p->key != 0; p++) {
616 if (
strcmp(p->key,
"group") == 0) {
617 grp =
static_cast<const char*
>(p->data);
626 if ((param_bld = OSSL_PARAM_BLD_new()) == 0) {
631 if ((OSSL_PARAM_BLD_push_utf8_string(param_bld,
"group", grp, 0) == 0)) {
636 if ((OSSL_PARAM_BLD_push_octet_string(param_bld,
"pub", src.get_buffer(),src.length()) == 0)) {
641 OSSL_PARAM* old_params = params;
642 params = OSSL_PARAM_BLD_to_param(param_bld);
643 OSSL_PARAM_free(old_params);
645 if ((fd_ctx = EVP_PKEY_CTX_new(keypair,0)) == 0) {
650 EVP_PKEY_fromdata_init(fd_ctx);
652 if (EVP_PKEY_fromdata(fd_ctx, &peer, EVP_PKEY_PUBLIC_KEY, params) != 1) {
657 if ((ec_ctx = EVP_PKEY_CTX_new(keypair,0)) == 0) {
662 if (!EVP_PKEY_derive_init(ec_ctx)) {
667 if (EVP_PKEY_derive_set_peer(ec_ctx, peer) <= 0) {
673 if (EVP_PKEY_derive(ec_ctx, 0, &len) <= 0) {
677 dst.length(static_cast<ACE_CDR::ULong>(len));
678 if (EVP_PKEY_derive(ec_ctx, dst.get_buffer(), &len) <= 0) {
int strcmp(const char *s, const char *t)
#define OPENDDS_SSL_LOG_ERR(MSG)