[v1] examples/fips_validation: fix IV generation for gmac
Checks
Commit Message
Replace rand() call in fips validation example with rte_rand().
Coverity issue: 381668
Fixes: e27268bd2103 ("examples/fips_validation: add parsing for AES-GMAC")
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
examples/fips_validation/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
> Replace rand() call in fips validation example with rte_rand().
>
> Coverity issue: 381668
> Fixes: e27268bd2103 ("examples/fips_validation: add parsing for AES-GMAC")
>
> Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Applied to dpdk-next-crypto
Thanks.
@@ -12,6 +12,7 @@
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
+#include <rte_random.h>
#include "fips_validation.h"
#include "fips_dev_self_test.h"
@@ -761,7 +762,7 @@ prepare_auth_op(void)
}
for (i = 0; i < vec.iv.len; i++) {
- int random = rand();
+ int random = rte_rand();
vec.iv.val[i] = (uint8_t)random;
}
}