Commit e4e5e576 authored by yangdepei's avatar yangdepei
Browse files

crypto: ccp: fix bug that SM2 encryption of long data causes kernel crash

hygon inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I99ZNA



--------------------------------

long data sm2 encryption may cause out of bounds memory access
Fixes: acafe30ff58a ("crypto: ccp: Support SM2 algorithm for hygon ccp.")

Signed-off-by: default avatarliulanyi <liulanyi@hygon.cn>
Signed-off-by: default avataryangdepei <yangdepei@hygon.cn>
parent 59781345
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -671,8 +671,6 @@ static void ccp_sm2_enc_compute(struct work_struct *work)
		goto e_complete;
	}

	scatterwalk_map_and_copy(rctx->src, req->src, 0, req->src_len, 0);

	/* C2 = M ^ t */
	ret = ccp_sm2_kdf_xor(shash, req->src, 0, req->src_len,
			req->dst, CCP_SM2_ENCRYPT_EXT_LEN,