From cf47a3b2ef1fe3e095c81dc6033c67b067adb08c Mon Sep 17 00:00:00 2001 From: "k4.rahul" Date: Thu, 27 Apr 2023 12:08:48 +0530 Subject: [PATCH] Coverity-CWE 330: Use of Insufficiently Random Values (137944 Cryptographically weak PRNG) replaced SystemRandom().randint() instead of randint() Change-Id: I02dd1387b795c856d0cd05d0366b7bb410016a8b Signed-off-by: k4.rahul --- osm_lcm/ns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osm_lcm/ns.py b/osm_lcm/ns.py index 305b70b..28979b2 100644 --- a/osm_lcm/ns.py +++ b/osm_lcm/ns.py @@ -124,7 +124,7 @@ from copy import copy, deepcopy from time import time from uuid import uuid4 -from random import randint +from random import SystemRandom __author__ = "Alfonso Tierno " @@ -7557,7 +7557,7 @@ class NsLcm(LcmBase): not isinstance(job.get("job_name"), str) or vnfr_id not in job["job_name"] ): - job["job_name"] = vnfr_id + "_" + str(randint(1, 10000)) + job["job_name"] = vnfr_id + "_" + str(SystemRandom().randint(1, 10000)) job["nsr_id"] = nsr_id job["vnfr_id"] = vnfr_id return job_list -- 2.25.1