Skip to contentSkip to conversation

examples/fips_validation: fix IV generation for gmac

PATCH Applied Brian Dooley 2 participants 2 messages Nov 2, 2022 – Nov 3, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/fips_validation: fix IV generation for gmac

Replace rand() call in fips validation example with rte_rand().

Coverity issue: 381668

Fixes e27268bd2103 ("examples/fips_validation: add parsing for AES-GMAC")
---
 examples/fips_validation/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
examples/fips_validation/main.c +2 -1
index 40a5b70e07..404a29d7b6 100644
@@ -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;
 		}
 	}
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 6 lines

Replace rand() call in fips validation example with rte_rand().

Coverity issue: 381668

Fixes e27268bd2103 ("examples/fips_validation: add parsing for AES-GMAC")

Applied to dpdk-next-crypto

Thanks.