aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-12 19:03:18 -0400
committerJack Lloyd <[email protected]>2018-08-12 19:03:18 -0400
commitc3b40191a0406b6d8f7d1480d06344067622e2c1 (patch)
tree4ad369713128d0787cdf9b0b46d95a92925770af /src/lib/prov
parentf21693a2499e10fae7a07f7d80178874115a185c (diff)
Add function to return the size of a key agreement output
Very useful when using "Raw" DH/ECDH via the FFI API.
Diffstat (limited to 'src/lib/prov')
-rw-r--r--src/lib/prov/pkcs11/p11_ecdh.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/prov/pkcs11/p11_ecdh.cpp b/src/lib/prov/pkcs11/p11_ecdh.cpp
index d7b0fae5c..0cd671bcb 100644
--- a/src/lib/prov/pkcs11/p11_ecdh.cpp
+++ b/src/lib/prov/pkcs11/p11_ecdh.cpp
@@ -45,6 +45,7 @@ class PKCS11_ECDH_KA_Operation final : public PK_Ops::Key_Agreement
: PK_Ops::Key_Agreement(), m_key(key), m_mechanism(MechanismWrapper::create_ecdh_mechanism(params))
{}
+ size_t agreed_value_size() const override { return m_key.domain().get_p_bytes(); }
/// The encoding in V2.20 was not specified and resulted in different implementations choosing different encodings.
/// Applications relying only on a V2.20 encoding (e.g. the DER variant) other than the one specified now (raw) may not work with all V2.30 compliant tokens.