don't allow empty HMAC key for verification

This commit is contained in:
Günter Obiltschnig 2019-07-31 08:09:57 +02:00
parent 6c828018df
commit 651ab74390

View File

@ -132,6 +132,8 @@ class HMACAlgorithm: public Algorithm
public:
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());
hmac.update(header);
hmac.update('.');