Attention is currently required from: neels.
laforge has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/39745?usp=email )
Change subject: personalization: refactor AlgorithmID, K, Opc ......................................................................
Patch Set 12:
(1 comment)
File pySim/esim/saip/personalization.py:
https://gerrit.osmocom.org/c/pysim/+/39745/comment/8a750446_8efc764b?usp=ema... : PS8, Line 571: allow_len = int(128/8) # length in bytes (from BinaryParam)
yes, that is accurate. […]
Yes, if Algo is TUAK, then the K length can be 128 or 256. And the OPc must be 256. See the related sysmocom-internal ticket where I made a nice table.
I think independent of user input validation of downstream applications, the ProfileElementAKA should get code to validate those constraints before tyring to encode something potentially illegal into DER. This doesn't have to happen here.
But the code here would have to permit both lengths, and it should probably have a comment stating that applications using these classes shall ensure consistency between chosen algo and key material length with specifications.