From 08f3fc5676afcd2ea171b13ecae5f467859d021f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 15 Sep 2021 04:42:31 -0400 Subject: [PATCH] Fix ed25519Signer and ed25519Verifier The classes don't provide a copy contructor. Derp. Also see https://github.com/noloader/cryptopp-pem/issues/12 --- xed25519.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xed25519.cpp b/xed25519.cpp index 7fffa83f..b59a47bb 100644 --- a/xed25519.cpp +++ b/xed25519.cpp @@ -664,8 +664,11 @@ ed25519Signer::ed25519Signer(const Integer &x) } ed25519Signer::ed25519Signer(const PKCS8PrivateKey &key) - : m_key(dynamic_cast(key)) { + // Load all fields from the other key + ByteQueue queue; + key.Save(queue); + AccessPrivateKey().Load(queue); } ed25519Signer::ed25519Signer(RandomNumberGenerator &rng) @@ -855,8 +858,11 @@ ed25519Verifier::ed25519Verifier(const Integer &y) } ed25519Verifier::ed25519Verifier(const X509PublicKey &key) - : m_key(dynamic_cast(key)) { + // Load all fields from the other key + ByteQueue queue; + key.Save(queue); + AccessPublicKey().Load(queue); } ed25519Verifier::ed25519Verifier(BufferedTransformation ¶ms)