We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#include <seckey.h> #include <siphash.h> int main(void) { const uint8_t key[3] = { 0 }; ::CryptoPP::SipHash<2, 4, false> siphash(key, sizeof(key)); return 0; }
I think it would be more appropriate to throw an exception in this case?
The text was updated successfully, but these errors were encountered:
Validate SipHash key length in ctor (GH #947)
d6a5b76
Thanks @guidovranken.
Can you give Commit d6a5b7664bde a try?
diff --git a/siphash.h b/siphash.h index 76dcccf6..4ffe1b50 100644 --- a/siphash.h +++ b/siphash.h @@ -148,7 +148,8 @@ public: /// \param key a byte array used to key the cipher /// \param length the size of the byte array, in bytes SipHash(const byte *key, unsigned int length) - {this->UncheckedSetKey(key, length, g_nullNameValuePairs);} + {this->ThrowIfInvalidKeyLength(length); + this->UncheckedSetKey(key, length, g_nullNameValuePairs);} }; template <unsigned int C, unsigned int D, bool T_128bit>
Sorry, something went wrong.
Thank you, confirmed fixed.
No branches or pull requests
I think it would be more appropriate to throw an exception in this case?
The text was updated successfully, but these errors were encountered: