Commit Graph

8 Commits

Author SHA1 Message Date
Neels Hofmeyr
00fa37ebda saip/param_source: try to not repeat random values
Change-Id: I4fa743ef5677580f94b9df16a5051d1d178edeb0
2025-12-13 22:34:23 +01:00
Neels Hofmeyr
2a6e498e82 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
2025-12-13 22:34:23 +01:00
Neels Hofmeyr
4d555f4b8d use random.SystemRandom as random nr source (/dev/urandom)
/dev/urandom is somewhat better than python's PRNG

Change-Id: I6de38c14ac6dd55bc84d53974192509c18d02bfa
2025-12-13 22:34:23 +01:00
Neels Hofmeyr
647af01c41 param_source: allow plugging a random implementation (for testing)
Change-Id: Idce2b18af70c17844d6f09f7704efc869456ac39
2025-12-13 22:34:23 +01:00
Neels Hofmeyr
7d0cde74a0 RandomHexDigitSource: rather return in string format, not bytes
Change-Id: I4e86289f6fb72cbd4cf0c90b8b49538cfab69a7f
2025-12-13 22:34:23 +01:00
Neels Hofmeyr
588d06cd9d param_source: allow input val expansion like '0 * 32'
Working with keys, we often generate 4, 8, 16, 32 digit wide random
values. Those then typically have default input values like

 00000000000000000000000000000000

it is hard for humans to count the number of digits. Much easier:

 00*16

Teach the ParamSource subclasses dealing with random values to
understand an expansion like this. Any expansion is carried out before
all other input value handling.

Use this expansion also in the default_value of ConfigurableParameter
subclasses that have a default_source pointing at a ParamSource that now
understand this expansion.

Related: SYS#6768
Change-Id: Ie7171c152a7b478736f8825050305606b5af5735
2025-12-13 22:34:23 +01:00
Neels Hofmeyr
565deff488 esim param_source: add is_abstract flag
Allow omitting some ParamSource subclassed from
ParamSource.get_all_implementations().

My previous attempts at automagically detecting abstract classes failed
conceptually, and the easiest, most explicit way is already used in
ConfigurableParameter: add an is_abstract flag.

Prep for Ie7171c152a7b478736f8825050305606b5af5735

Change-Id: Icfccdd0a8ecb5e0e9d22afa490d73c9f1849a64c
2025-12-13 22:34:23 +01:00
Neels Hofmeyr
a8f3962be3 personalization: add param_source.py, implement batch personalization
Implement pySim.esim.saip.personalization.BatchPersonalization,
generating N eSIM profiles from a preset configuration.

Batch parameters can be fed by a constant, incrementing, random or from
CSV rows: add pySim.esim.saip.param_source.* classes to feed such input
to each of the BatchPersonalization's ConfigurableParameter instances.

Related: SYS#6768
Change-Id: I497c60c101ea0eea980e8b1a4b1f36c0eda39002
2025-12-13 22:34:23 +01:00