aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/prov/openssl')
-rw-r--r--src/lib/prov/openssl/openssl_ec.cpp4
1 files changed, 4 insertions, 0 deletions
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<uint8_t> 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<uint8_t> 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<EC_KEY, std::function<void (EC_KEY*)>> m_ossl_ec;
+ size_t m_value_size;
};
}