diff options
author | Jack Lloyd <[email protected]> | 2018-08-09 14:05:29 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-08-10 10:12:49 -0400 |
commit | 1e18edf2673519c8f8c01dbbaacc5a189f0c0a92 (patch) | |
tree | 40a7c64752842ce9298de220860af38fe80bb882 /src/lib/prov/pkcs11 | |
parent | fe242c20a01ae2e8a4589c353cdbc080ae629487 (diff) |
Add PK_Signer::signature_length
Diffstat (limited to 'src/lib/prov/pkcs11')
-rw-r--r-- | src/lib/prov/pkcs11/p11_ecdsa.cpp | 2 | ||||
-rw-r--r-- | src/lib/prov/pkcs11/p11_rsa.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/prov/pkcs11/p11_ecdsa.cpp b/src/lib/prov/pkcs11/p11_ecdsa.cpp index a93e761b1..bdea2c1fa 100644 --- a/src/lib/prov/pkcs11/p11_ecdsa.cpp +++ b/src/lib/prov/pkcs11/p11_ecdsa.cpp @@ -100,6 +100,8 @@ class PKCS11_ECDSA_Signature_Operation final : public PK_Ops::Signature return signature; } + size_t signature_length() const override { return 2*m_order.bytes(); } + private: const PKCS11_EC_PrivateKey& m_key; const BigInt& m_order; diff --git a/src/lib/prov/pkcs11/p11_rsa.cpp b/src/lib/prov/pkcs11/p11_rsa.cpp index e62c038ec..65bcd2d22 100644 --- a/src/lib/prov/pkcs11/p11_rsa.cpp +++ b/src/lib/prov/pkcs11/p11_rsa.cpp @@ -206,6 +206,8 @@ class PKCS11_RSA_Signature_Operation final : public PK_Ops::Signature : m_key(key), m_mechanism(MechanismWrapper::create_rsa_sign_mechanism(padding)) {} + size_t signature_length() const override { return m_key.get_n().bytes(); } + void update(const uint8_t msg[], size_t msg_len) override { if(!m_initialized) |