neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/40830?usp=email )
Change subject: use secrets.SystemRandom as secure random nr source ......................................................................
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 --- M pySim/esim/saip/param_source.py 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/30/40830/1
diff --git a/pySim/esim/saip/param_source.py b/pySim/esim/saip/param_source.py index 46a04fb..f5d2a35 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 http://www.gnu.org/licenses/.
-import random +import secrets import re from pySim.utils import all_subclasses_of from osmocom.utils import b2h @@ -94,7 +94,7 @@ return cls(cls.expand_str(s))
class RandomSourceMixin: - random_impl = random.SystemRandom() + random_impl = secrets.SystemRandom()
class RandomDigitSource(InputExpandingParamSource, RandomSourceMixin): 'return a different sequence of random decimal digits each'