summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-11-04 11:15:55 +0700
committerfixeria <vyanitskiy@sysmocom.de>2020-11-10 12:16:21 +0000
commit6b2957109115c9873c0d900258e862cabf24a349 (patch)
treee6476b3078c56ced6c151b44e5c19c1af29a48c5 /library
parent76d1d1a815f5a328ff28995e1c2f09fe040696b6 (diff)
library/L3_Common: use f_rnd_octstring() from Osmocom_Types
Diffstat (limited to 'library')
-rw-r--r--library/L3_Common.ttcn25
1 files changed, 8 insertions, 17 deletions
diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn
index 0a80593..981c6ba 100644
--- a/library/L3_Common.ttcn
+++ b/library/L3_Common.ttcn
@@ -29,30 +29,21 @@ type record AuthVector {
OCT14 auts
}
-private function f_rnd_oct(integer len) return octetstring {
- var integer i;
- var octetstring res;
- for (i := 0; i < len; i := i + 1) {
- res[i] := int2oct(float2int(rnd()*256.0), 1);
- }
- return res;
-}
-
function f_gen_auth_vec_2g() return AuthVector {
var AuthVector vec;
- vec.rand := f_rnd_oct(16);
- vec.sres := f_rnd_oct(4);
- vec.kc := f_rnd_oct(8);
+ vec.rand := f_rnd_octstring(16);
+ vec.sres := f_rnd_octstring(4);
+ vec.kc := f_rnd_octstring(8);
return vec;
}
function f_gen_auth_vec_3g() return AuthVector {
var AuthVector vec := f_gen_auth_vec_2g();
- vec.ik := f_rnd_oct(16);
- vec.ck := f_rnd_oct(16);
- vec.autn := f_rnd_oct(16);
- vec.res := f_rnd_oct(8);
- vec.auts := f_rnd_oct(14);
+ vec.ik := f_rnd_octstring(16);
+ vec.ck := f_rnd_octstring(16);
+ vec.autn := f_rnd_octstring(16);
+ vec.res := f_rnd_octstring(8);
+ vec.auts := f_rnd_octstring(14);
return vec;
}