ARMV8_CRYPTO_AUTH_LIST_END = ARMV8_CRYPTO_AUTH_NOT_SUPPORTED
};
-#define CRYPTO_ORDER_MAX ARMV8_CRYPTO_CHAIN_LIST_END
-#define CRYPTO_CIPHER_OP_MAX ARMV8_CRYPTO_CIPHER_OP_LIST_END
#define CRYPTO_CIPHER_KEYLEN_MAX ARMV8_CRYPTO_CIPHER_KEYLEN_LIST_END
-#define CRYPTO_CIPHER_MAX RTE_CRYPTO_CIPHER_LIST_END
-#define CRYPTO_AUTH_MAX RTE_CRYPTO_AUTH_LIST_END
+#define CRYPTO_CIPHER_MAX (RTE_CRYPTO_CIPHER_AES_ECB + 1)
+#define CRYPTO_AUTH_MAX (RTE_CRYPTO_AUTH_SHA512_HMAC + 1)
#define HMAC_IPAD_VALUE (0x36)
#define HMAC_OPAD_VALUE (0x5C)
crypto_func_tbl_t *func_tbl = \
(crypto_chain_order[(order)])[(cop)]; \
\
- ((*func_tbl)[(calg)][(aalg)][KEYL(keyl)]); \
+ ((calg >= CRYPTO_CIPHER_MAX) || (aalg >= CRYPTO_AUTH_MAX)) ? \
+ NULL : ((*func_tbl)[(calg)][(aalg)][KEYL(keyl)]); \
})
/*----------------------------------------------------------------------------*/
({ \
crypto_key_sched_tbl_t *ks_tbl = crypto_key_sched_dir[(cop)]; \
\
- ((*ks_tbl)[(calg)][KEYL(keyl)]); \
+ (calg >= CRYPTO_CIPHER_MAX) ? \
+ NULL : ((*ks_tbl)[(calg)][KEYL(keyl)]); \
})
/*----------------------------------------------------------------------------*/
return -ENOTSUP;
}
- if (unlikely(sess->crypto_func == NULL)) {
+ if (unlikely(sess->crypto_func == NULL ||
+ sess->cipher.key_sched == NULL)) {
/*
* If we got here that means that there must be a bug
* in the algorithms selection above. Nevertheless keep