Skip to content

Commit

Permalink
don't allow empty HMAC key for verification
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Jul 31, 2019
1 parent 6c82801 commit 651ab74
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions JWT/src/Signer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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('.');
Expand Down

0 comments on commit 651ab74

Please sign in to comment.