mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-10-30 18:17:50 +00:00
don't allow empty HMAC key for verification
This commit is contained in:
@@ -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('.');
|
||||
|
||||
Reference in New Issue
Block a user