From e0a43a200901e9c212573b09730c142b42c5719e Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 12 Aug 2018 19:24:52 -0400 Subject: Fix for OpenSSL --- src/lib/prov/openssl/openssl_ec.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib') diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp index 5da466c0c..e8df0598c 100644 --- a/src/lib/prov/openssl/openssl_ec.cpp +++ b/src/lib/prov/openssl/openssl_ec.cpp @@ -305,6 +305,7 @@ class OpenSSL_ECDH_KA_Operation final : public PK_Ops::Key_Agreement_with_KDF OpenSSL_ECDH_KA_Operation(const ECDH_PrivateKey& ecdh, const std::string& kdf) : PK_Ops::Key_Agreement_with_KDF(kdf), m_ossl_ec(::EC_KEY_new(), ::EC_KEY_free) { + m_value_size = ecdh.domain().get_p_bytes(); const secure_vector der = PKCS8_for_openssl(ecdh); const uint8_t* der_ptr = der.data(); m_ossl_ec.reset(d2i_ECPrivateKey(nullptr, &der_ptr, der.size())); @@ -312,6 +313,8 @@ class OpenSSL_ECDH_KA_Operation final : public PK_Ops::Key_Agreement_with_KDF throw OpenSSL_Error("d2i_ECPrivateKey"); } + size_t agreed_value_size() const override { return m_value_size; } + secure_vector raw_agree(const uint8_t w[], size_t w_len) override { const EC_GROUP* group = ::EC_KEY_get0_group(m_ossl_ec.get()); @@ -348,6 +351,7 @@ class OpenSSL_ECDH_KA_Operation final : public PK_Ops::Key_Agreement_with_KDF private: std::unique_ptr> m_ossl_ec; + size_t m_value_size; }; } -- cgit v1.2.3