commit
9b297c1720
|
@ -1,6 +1,6 @@
|
||||||
/* Qualcomm Crypto Engine driver.
|
/* Qualcomm Crypto Engine driver.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2010-2016, 2020 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -768,6 +768,11 @@ static int _ce_setup(struct qce_device *pce_dev, struct qce_req *q_req,
|
||||||
switch (q_req->alg) {
|
switch (q_req->alg) {
|
||||||
case CIPHER_ALG_DES:
|
case CIPHER_ALG_DES:
|
||||||
if (q_req->mode != QCE_MODE_ECB) {
|
if (q_req->mode != QCE_MODE_ECB) {
|
||||||
|
if (ivsize > MAX_IV_LENGTH) {
|
||||||
|
pr_err("%s: error: Invalid length parameter\n",
|
||||||
|
__func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
_byte_stream_to_net_words(enciv32, q_req->iv, ivsize);
|
_byte_stream_to_net_words(enciv32, q_req->iv, ivsize);
|
||||||
writel_relaxed(enciv32[0], pce_dev->iobase +
|
writel_relaxed(enciv32[0], pce_dev->iobase +
|
||||||
CRYPTO_CNTR0_IV0_REG);
|
CRYPTO_CNTR0_IV0_REG);
|
||||||
|
|
|
@ -781,6 +781,11 @@ static int _ce_setup_cipher(struct qce_device *pce_dev, struct qce_req *creq,
|
||||||
switch (creq->alg) {
|
switch (creq->alg) {
|
||||||
case CIPHER_ALG_DES:
|
case CIPHER_ALG_DES:
|
||||||
if (creq->mode != QCE_MODE_ECB) {
|
if (creq->mode != QCE_MODE_ECB) {
|
||||||
|
if (ivsize > MAX_IV_LENGTH) {
|
||||||
|
pr_err("%s: error: Invalid length parameter\n",
|
||||||
|
__func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
_byte_stream_to_net_words(enciv32, creq->iv, ivsize);
|
_byte_stream_to_net_words(enciv32, creq->iv, ivsize);
|
||||||
pce = cmdlistinfo->encr_cntr_iv;
|
pce = cmdlistinfo->encr_cntr_iv;
|
||||||
pce->data = enciv32[0];
|
pce->data = enciv32[0];
|
||||||
|
|
Loading…
Reference in New Issue