From b9c8bd666edd766027d7d93b1fd5a6dea375c171 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 5 Aug 2025 00:20:21 +0200 Subject: [PATCH] use secrets.SystemRandom as secure random nr source secrets.SystemRandom is defined as the most secure random source available on the given operating system. Change-Id: I8049cd1292674b3ced82b0926569128535af6efe --- pySim/esim/saip/param_source.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pySim/esim/saip/param_source.py b/pySim/esim/saip/param_source.py index 00584006..876b87d2 100644 --- a/pySim/esim/saip/param_source.py +++ b/pySim/esim/saip/param_source.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import random +import secrets import re from osmocom.utils import b2h @@ -125,7 +125,7 @@ class DecimalRangeSource(InputExpandingParamSource): return cls(num_digits=len(first_str), first_value=first_value, last_value=last_value) class RandomSourceMixin: - random_impl = random.SystemRandom() + random_impl = secrets.SystemRandom() class RandomDigitSource(DecimalRangeSource, RandomSourceMixin): """return a different sequence of random decimal digits each"""