reset the hash after finalizing it
@@ -295,6 +295,9 @@ int s2n_hmac_digest_two_compression_rounds(struct s2n_hmac_state *state, void *o
return 0;
}
+ /* Can't reuse a hash after it has been finalized, so reset and push another block in */
+ GUARD(s2n_hash_reset(&state->inner));
+
/* No-op s2n_hash_update to normalize timing and guard against Lucky13. This does not affect the value of *out. */
return s2n_hash_update(&state->inner, state->xor_pad, state->hash_block_size);
}
