mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
don't allow empty HMAC key for verification
This commit is contained in:
parent
6c828018df
commit
651ab74390
@ -132,6 +132,8 @@ class HMACAlgorithm: public Algorithm
|
|||||||
public:
|
public:
|
||||||
Poco::DigestEngine::Digest sign(const Signer& signer, const std::string& header, const std::string& payload)
|
Poco::DigestEngine::Digest sign(const Signer& signer, const std::string& header, const std::string& payload)
|
||||||
{
|
{
|
||||||
|
if (signer.getHMACKey().empty()) throw SignatureGenerationException("No HMAC key available");
|
||||||
|
|
||||||
Poco::HMACEngine<Engine> hmac(signer.getHMACKey());
|
Poco::HMACEngine<Engine> hmac(signer.getHMACKey());
|
||||||
hmac.update(header);
|
hmac.update(header);
|
||||||
hmac.update('.');
|
hmac.update('.');
|
||||||
|
Loading…
Reference in New Issue
Block a user