diff options
author | Jack Lloyd <[email protected]> | 2020-04-01 11:42:22 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-04-06 07:52:16 -0400 |
commit | 415aa76ff7b17466eb42eef089982a4783c18b20 (patch) | |
tree | 2f8cfb785298829325dabbd4e1e59cfbddcab75e /src/lib/pubkey/xmss/xmss_signature_operation.cpp | |
parent | 3a26a33de2459c40cdfb766f4035a60cf449ab1c (diff) |
Avoid UbSan false positive in GCC
Unfortunately GCC's UbSan errors out when we cast the function
pointer derived from XMSS_Common_Ops as a XMSS_PrivateKey::*
then use an XMSS_PrivateKey* as this. Clang accepts it.
Curiously, it works in GCC if we use an XMSS_Common_Ops::* instead,
but Clang rejects that at compile time.
Short of compiler specific logic which is probably fragile, just
make everything from XMSS_Common_Ops static instead of being
inherited.
Diffstat (limited to 'src/lib/pubkey/xmss/xmss_signature_operation.cpp')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_signature_operation.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/pubkey/xmss/xmss_signature_operation.cpp b/src/lib/pubkey/xmss/xmss_signature_operation.cpp index 38659a88b..b7daad7c0 100644 --- a/src/lib/pubkey/xmss/xmss_signature_operation.cpp +++ b/src/lib/pubkey/xmss/xmss_signature_operation.cpp @@ -18,12 +18,13 @@ namespace Botan { XMSS_Signature_Operation::XMSS_Signature_Operation( - const XMSS_PrivateKey& private_key) - : XMSS_Common_Ops(private_key.xmss_oid()), - m_priv_key(private_key), - m_randomness(0), - m_leaf_idx(0), - m_is_initialized(false) + const XMSS_PrivateKey& private_key) : + m_priv_key(private_key), + m_xmss_params(private_key.xmss_oid()), + m_hash(private_key.xmss_hash_function()), + m_randomness(0), + m_leaf_idx(0), + m_is_initialized(false) {} XMSS_WOTS_PublicKey::TreeSignature |