diff options
Diffstat (limited to 'crypto/hmac_mac.cc')
-rw-r--r-- | crypto/hmac_mac.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/hmac_mac.cc b/crypto/hmac_mac.cc index f9a00cd..36caa0d 100644 --- a/crypto/hmac_mac.cc +++ b/crypto/hmac_mac.cc @@ -42,6 +42,12 @@ HMAC::~HMAC() { bool HMAC::Sign(const base::StringPiece& data, unsigned char* digest, int digest_length) const { + if (plat_->key_.empty()) { + // Init has not been called or has failed. + NOTREACHED(); + return false; + } + CCHmacAlgorithm algorithm; int algorithm_digest_length; switch (hash_alg_) { |