struct crypt_op cryp;
struct dev_crypto_state *state = ctx->md_data;
struct session_op *sess = &state->d_sess;
+ char *new_mac_data;
if (!data || state->d_fd < 0) {
printf("cryptodev_digest_update: illegal inputs \n");
if (!(ctx->flags & EVP_MD_CTX_FLAG_ONESHOT)) {
/* if application doesn't support one buffer */
- state->mac_data = OPENSSL_realloc(state->mac_data, state->mac_len + count);
+ new_mac_data = OPENSSL_realloc(state->mac_data, state->mac_len + count);
- if (!state->mac_data) {
+ if (!new_mac_data) {
printf("cryptodev_digest_update: realloc failed\n");
return (0);
}
+ state->mac_data = new_mac_data;
memcpy(state->mac_data + state->mac_len, data, count);
state->mac_len += count;