Fix temporary array size (GH #675)

cryptest.sh and UBsan caught a "secblock.h:389:4: runtime error: load of value 206, which is not a valid value for type 'bool'". m_t[4] is accessed in UncheckedSetKey. The extra m_t[] element was inadvertently removed when ProcessAndXorBlock no longer used it.
pull/681/head^2
Jeffrey Walton 2018-07-03 22:41:04 -04:00
parent f8f6afd1fa
commit 78ece1b2aa
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ public:
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params); void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
FixedSizeSecBlock<word16, ROUNDS> m_rk; FixedSizeSecBlock<word16, ROUNDS> m_rk;
mutable FixedSizeSecBlock<word16, 4> m_t; mutable FixedSizeSecBlock<word16, 5> m_t;
}; };
/// \brief Provides implementation for encryption transformation /// \brief Provides implementation for encryption transformation
@ -113,7 +113,7 @@ public:
void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params); void UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params);
FixedSizeSecBlock<word32, ROUNDS> m_rk; FixedSizeSecBlock<word32, ROUNDS> m_rk;
mutable FixedSizeSecBlock<word32, 4> m_t; mutable FixedSizeSecBlock<word32, 5> m_t;
}; };
/// \brief Provides implementation for encryption transformation /// \brief Provides implementation for encryption transformation