examples/l2fwd-crypto: improve random key generator
authorPiotr Azarewicz <piotrx.t.azarewicz@intel.com>
Wed, 25 May 2016 13:34:52 +0000 (15:34 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 15 Jul 2016 22:08:13 +0000 (00:08 +0200)
commit6dad6e692bd74ea8ade42dd3c8a27264027c659c
tree341d6e397111bed61b73ea2306b61b4178c42d49
parent2b41fac55911d92084988f15bdfc312d44b87599
examples/l2fwd-crypto: improve random key generator

This patch improve generate_random_key() function by replacing rand()
function with reading from /dev/urandom.

CID 120136 : Calling risky function (DC.WEAK_CRYPTO)
dont_call: rand should not be used for security related applications, as
linear congruential algorithms are too easy to break

Coverity issue: 120136

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
examples/l2fwd-crypto/main.c