* sometimes iverride IV per operation.
*/
fctx->enc.iv_source = CPT_FROM_DPTR;
+
+ if (cpt_ctx->auth_key_len > 64)
+ return -1;
}
switch (type) {
cpt_ctx->fc_type = HASH_HMAC;
}
+ if (cpt_ctx->fc_type == FC_GEN && key_len > 64)
+ return -1;
+
/* For GMAC auth, cipher must be NULL */
if (type == GMAC_TYPE)
fctx->enc.enc_cipher = 0;
cpt_ctx->auth_key_len = key_len;
memset(fctx->hmac.ipad, 0, sizeof(fctx->hmac.ipad));
memset(fctx->hmac.opad, 0, sizeof(fctx->hmac.opad));
- memcpy(fctx->hmac.opad, key, key_len);
+
+ if (key_len <= 64)
+ memcpy(fctx->hmac.opad, key, key_len);
fctx->enc.auth_input_type = 1;
}
return 0;
return -1;
}
- if (a_form->key.length > 64) {
- CPT_LOG_DP_ERR("Auth key length is big");
- return -1;
- }
-
switch (a_form->algo) {
case RTE_CRYPTO_AUTH_SHA1_HMAC:
/* Fall through */
.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 20,
.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 28,
.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 32,
.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 48,
.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
.block_size = 128,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 64,
.algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 20,
.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 28,
.algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 32,
.algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
.block_size = 64,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 48,
.algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
.block_size = 128,
.key_size = {
- .min = 64,
- .max = 64,
- .increment = 0
+ .min = 1,
+ .max = 1024,
+ .increment = 1
},
.digest_size = {
.min = 64,