diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-03-21 09:03:16 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-03-21 09:04:14 +0100 |
commit | a72e47b8a09d6a870b093cfa3b5716b6817c33b8 (patch) | |
tree | bf5f747ac33e5ef579ed6530abdd06f03708d851 /utils | |
parent | 5fb795e972340b104467d37d5281b622507e9ff8 (diff) |
auth_milenage/osmo-auc-gen: compute OPC in case only OP is known
Diffstat (limited to 'utils')
-rw-r--r-- | utils/osmo-auc-gen.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 93f126f1..a3c4dc27 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -59,6 +59,7 @@ static void help() "-a --algorithm\tSpecify name of the algorithm\n" "-k --key\tSpecify Ki / K\n" "-o --opc\tSpecify OPC (only for 3G)\n" + "-O --op\tSpecify OP (only for 3G)\n" "-a --amf\tSpecify AMF (only for 3G)\n" "-s --sqn\tSpecify SQN (only for 3G)\n" "-r --rand\tSpecify random value\n"); @@ -84,6 +85,7 @@ int main(int argc, char **argv) { "algorithm", 1, 0, 'a' }, { "key", 1, 0, 'k' }, { "opc", 1, 0, 'o' }, + { "op", 1, 0, 'O' }, { "amf", 1, 0, 'f' }, { "sqn", 1, 0, 's' }, { "rand", 1, 0, 'r' }, @@ -133,6 +135,16 @@ int main(int argc, char **argv) } rc = osmo_hexparse(optarg, test_aud.u.umts.opc, sizeof(test_aud.u.umts.opc)); + test_aud.u.umts.opc_is_op = 0; + break; + case 'O': + if (test_aud.type != OSMO_AUTH_TYPE_UMTS) { + fprintf(stderr, "Only UMTS has OP\n"); + exit(2); + } + rc = osmo_hexparse(optarg, test_aud.u.umts.opc, + sizeof(test_aud.u.umts.opc)); + test_aud.u.umts.opc_is_op = 1; break; case 'f': if (test_aud.type != OSMO_AUTH_TYPE_UMTS) { |