diff options
-rw-r--r-- | drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 3 | ||||
-rw-r--r-- | drivers/crypto/ccp/ccp-crypto-sha.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c index 3d9acc53d247..60fc0fa26fd3 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes-cmac.c +++ b/drivers/crypto/ccp/ccp-crypto-aes-cmac.c | |||
@@ -225,6 +225,9 @@ static int ccp_aes_cmac_export(struct ahash_request *req, void *out) | |||
225 | struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); | 225 | struct ccp_aes_cmac_req_ctx *rctx = ahash_request_ctx(req); |
226 | struct ccp_aes_cmac_exp_ctx state; | 226 | struct ccp_aes_cmac_exp_ctx state; |
227 | 227 | ||
228 | /* Don't let anything leak to 'out' */ | ||
229 | memset(&state, 0, sizeof(state)); | ||
230 | |||
228 | state.null_msg = rctx->null_msg; | 231 | state.null_msg = rctx->null_msg; |
229 | memcpy(state.iv, rctx->iv, sizeof(state.iv)); | 232 | memcpy(state.iv, rctx->iv, sizeof(state.iv)); |
230 | state.buf_count = rctx->buf_count; | 233 | state.buf_count = rctx->buf_count; |
diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c index b5ad72897dc2..8f36af62fe95 100644 --- a/drivers/crypto/ccp/ccp-crypto-sha.c +++ b/drivers/crypto/ccp/ccp-crypto-sha.c | |||
@@ -212,6 +212,9 @@ static int ccp_sha_export(struct ahash_request *req, void *out) | |||
212 | struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); | 212 | struct ccp_sha_req_ctx *rctx = ahash_request_ctx(req); |
213 | struct ccp_sha_exp_ctx state; | 213 | struct ccp_sha_exp_ctx state; |
214 | 214 | ||
215 | /* Don't let anything leak to 'out' */ | ||
216 | memset(&state, 0, sizeof(state)); | ||
217 | |||
215 | state.type = rctx->type; | 218 | state.type = rctx->type; |
216 | state.msg_bits = rctx->msg_bits; | 219 | state.msg_bits = rctx->msg_bits; |
217 | state.first = rctx->first; | 220 | state.first = rctx->first; |