Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09ad8ed7 authored by Sivanesan Rajapupathi's avatar Sivanesan Rajapupathi Committed by Gerrit - the friendly Code Review server
Browse files

crypto: msm: qcrypto: Fix hash crash if not last issue



If an ahash request is not final, the result variable of ahash_request
may not exist. In the completion callback function, then, do not
copy the digest result to result variable of ahash_request, if it not
final.  Otherwise, crash may happen.

Change-Id: I169218e8658500539b19408eca3afeabcaa4816b
Acked-by: default avatarChe-Min Hsieh <cheminh@qti.qualcomm.com>
Signed-off-by: default avatarSivanesan Rajapupathi <srajap@codeaurora.org>
parent cc339a2a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* Qualcomm Crypto driver
 *
 * Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1605,6 +1605,7 @@ static void _qce_ahash_complete(void *cookie, unsigned char *digest,
#endif
	if (digest) {
		memcpy(rctx->digest, digest, diglen);
		if (rctx->last_blk)
			memcpy(areq->result, digest, diglen);
	}
	if (authdata) {