From northmirko at gmail.com Wed Apr 1 21:20:38 2020 From: northmirko at gmail.com (Mirko Kovacevic) Date: Wed, 1 Apr 2020 23:20:38 +0200 Subject: TTCN3 3G/2G Authentication using SIM card/SIM card reader Message-ID: HI, Osmo Packet Core Guys, I am working from home nowadays, testing commercial packet core equipment (Ericsson). I have already listen/read about using TTCN3 in all your famous products. But never get a try. I am interesting to deploy similar tests for production systems like yours for OsmoSGSN, due to lack of test radio equipment from home and also to make some sort of automation. I ran your TTCN3 tests for OsmoSGSN and get loved on a first sight. You did amazing job and made countless possibilities. Thank for that. I know you have C code support in libosmocore library for 3g/2g auth. *Can we use SIM card reader in TTCN3 as an option to evaluate authentication ?!* *Did you ever tried?!* Best regards, Mirko K. -------------- next part -------------- An HTML attachment was scrubbed... URL: From laforge at osmocom.org Thu Apr 2 14:12:25 2020 From: laforge at osmocom.org (Harald Welte) Date: Thu, 2 Apr 2020 16:12:25 +0200 Subject: TTCN3 3G/2G Authentication using SIM card/SIM card reader In-Reply-To: References: Message-ID: <20200402141225.GF3286233@nataraja> Hi Mirko, thanks for reaching out and for your kind words. On Wed, Apr 01, 2020 at 11:20:38PM +0200, Mirko Kovacevic wrote: > I ran your TTCN3 tests for OsmoSGSN and get loved on a first sight. > You did amazing job and made countless possibilities. Thank for that. Happy to see at least somebody out there recognizes the work we do :) > I know you have C code support in libosmocore library for 3g/2g auth. > *Can we use SIM card reader in TTCN3 as an option to evaluate > authentication ?!* This is not implemented, as in general the target of our TTCN-3 test suites for core network interfaces is to run fully virtualized, i.e. not to have a dependency on any given hardware. Having said this, TTCN-3 is a programming language, and there are multiple methods by which a physical card reader could be integrated into a test suite. a) by means of a "Native Function" (i.e. exposing PC/SC API functions to the test). IMHO a bad choice b) by means of a test port implemented in C++ which one can send APDUs to, and receives APDUs back. So the message interface between the actual test case and the card reader would be a TTCH3 test port sending/receiving ISO7816 APDUs. The C++ implementation of that test port would the nin turn use pcsc-lite to talk to a card reader. c) by means of the USB test port I wrote (exposing libusb to TITAN), and the TTCN-3 implementation of the USB-CCID protocol on top. This was originally developed to test the CCID compliance of card reader firmware, but it could of course also used in this context. This means more code in TTCN-3 and less in C++ compared to method 'b' above. > *Did you ever tried?!* No, as stated above, it's quite different from what we are using the code for. Kind regards, Harald -- - Harald Welte http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) From ahochauwaaaaa at gmail.com Wed Apr 22 14:42:11 2020 From: ahochauwaaaaa at gmail.com (Yoshiyuki Kurauchi) Date: Wed, 22 Apr 2020 23:42:11 +0900 Subject: [PATCH] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() Message-ID: <20200422144211.28756-1-ahochauwaaaaa@gmail.com> In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI flag since it returns multipart message. This patch adds a new arg "flags" in gtp_genl_fill_info() so that flags can be set by the callers. Signed-off-by: Yoshiyuki Kurauchi --- drivers/net/gtp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 672cd2caf2fb..10fa731bae6d 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1097,7 +1097,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) } static struct pdp_ctx *gtp_find_pdp_by_link(struct net *net, - struct nlattr *nla[]) + struct nlattr *nla[]) { struct gtp_dev *gtp; @@ -1169,11 +1169,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) static struct genl_family gtp_genl_family; static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, - u32 type, struct pdp_ctx *pctx) + int flags, u32 type, struct pdp_ctx *pctx) { void *genlh; - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, flags, type); if (genlh == NULL) goto nlmsg_failure; @@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) goto err_unlock; } - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, - info->snd_seq, info->nlhdr->nlmsg_type, pctx); + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, info->snd_seq, + info->nlhdr->nlmsg_flags, info->nlhdr->nlmsg_type, pctx); if (err < 0) goto err_unlock_free; @@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, gtp_genl_fill_info(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, + NLM_F_MULTI, cb->nlh->nlmsg_type, pctx)) { cb->args[0] = i; cb->args[1] = j; -- 2.17.1 From ahochauwaaaaa at gmail.com Wed Apr 22 14:45:18 2020 From: ahochauwaaaaa at gmail.com (Yoshiyuki Kurauchi) Date: Wed, 22 Apr 2020 23:45:18 +0900 Subject: [PATCH] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() In-Reply-To: <20200422144211.28756-1-ahochauwaaaaa@gmail.com> References: <20200422144211.28756-1-ahochauwaaaaa@gmail.com> Message-ID: Hi, Could anyone review this change? This is the same one I sent in February except the prefix of commit message(net: => gtp:). BR, Yoshiyuki On Wed, Apr 22, 2020 at 11:42 PM Yoshiyuki Kurauchi wrote: > In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI > flag since it returns multipart message. > This patch adds a new arg "flags" in gtp_genl_fill_info() so that > flags can be set by the callers. > > Signed-off-by: Yoshiyuki Kurauchi > --- > drivers/net/gtp.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c > index 672cd2caf2fb..10fa731bae6d 100644 > --- a/drivers/net/gtp.c > +++ b/drivers/net/gtp.c > @@ -1097,7 +1097,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, > struct genl_info *info) > } > > static struct pdp_ctx *gtp_find_pdp_by_link(struct net *net, > - struct nlattr *nla[]) > + struct nlattr *nla[]) > { > struct gtp_dev *gtp; > > @@ -1169,11 +1169,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, > struct genl_info *info) > static struct genl_family gtp_genl_family; > > static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 > snd_seq, > - u32 type, struct pdp_ctx *pctx) > + int flags, u32 type, struct pdp_ctx *pctx) > { > void *genlh; > > - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, > + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, > flags, > type); > if (genlh == NULL) > goto nlmsg_failure; > @@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, > struct genl_info *info) > goto err_unlock; > } > > - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, > - info->snd_seq, info->nlhdr->nlmsg_type, > pctx); > + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, > info->snd_seq, > + info->nlhdr->nlmsg_flags, > info->nlhdr->nlmsg_type, pctx); > if (err < 0) > goto err_unlock_free; > > @@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, > gtp_genl_fill_info(skb, > NETLINK_CB(cb->skb).portid, > cb->nlh->nlmsg_seq, > + NLM_F_MULTI, > cb->nlh->nlmsg_type, pctx)) { > cb->args[0] = i; > cb->args[1] = j; > -- > 2.17.1 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo at netfilter.org Sun Apr 26 10:29:55 2020 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Sun, 26 Apr 2020 12:29:55 +0200 Subject: [PATCH] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() In-Reply-To: <20200422144211.28756-1-ahochauwaaaaa@gmail.com> References: <20200422144211.28756-1-ahochauwaaaaa@gmail.com> Message-ID: <20200426102955.GA16734@salvia> Hi, On Wed, Apr 22, 2020 at 11:42:11PM +0900, Yoshiyuki Kurauchi wrote: > In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI > flag since it returns multipart message. > This patch adds a new arg "flags" in gtp_genl_fill_info() so that > flags can be set by the callers. > > Signed-off-by: Yoshiyuki Kurauchi > --- > drivers/net/gtp.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c > index 672cd2caf2fb..10fa731bae6d 100644 > --- a/drivers/net/gtp.c > +++ b/drivers/net/gtp.c > @@ -1097,7 +1097,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info) > } > > static struct pdp_ctx *gtp_find_pdp_by_link(struct net *net, > - struct nlattr *nla[]) > + struct nlattr *nla[]) > { > struct gtp_dev *gtp; > > @@ -1169,11 +1169,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) > static struct genl_family gtp_genl_family; > > static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, > - u32 type, struct pdp_ctx *pctx) > + int flags, u32 type, struct pdp_ctx *pctx) > { > void *genlh; > > - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, > + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, flags, > type); > if (genlh == NULL) > goto nlmsg_failure; > @@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) > goto err_unlock; > } > > - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, > - info->snd_seq, info->nlhdr->nlmsg_type, pctx); > + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, info->snd_seq, > + info->nlhdr->nlmsg_flags, info->nlhdr->nlmsg_type, pctx); This should be 0 instead, not sure why using info->nlhdr->nlmsg_flags for this netlink GET operation. > if (err < 0) > goto err_unlock_free; > > @@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, > gtp_genl_fill_info(skb, > NETLINK_CB(cb->skb).portid, > cb->nlh->nlmsg_seq, > + NLM_F_MULTI, This one looks fine to me. > cb->nlh->nlmsg_type, pctx)) { > cb->args[0] = i; > cb->args[1] = j; > -- > 2.17.1 > From ahochauwaaaaa at gmail.com Mon Apr 27 10:32:10 2020 From: ahochauwaaaaa at gmail.com (Yoshiyuki Kurauchi) Date: Mon, 27 Apr 2020 19:32:10 +0900 Subject: [PATCH] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() In-Reply-To: <20200426102955.GA16734@salvia> References: <20200422144211.28756-1-ahochauwaaaaa@gmail.com> <20200426102955.GA16734@salvia> Message-ID: Hi, > This should be 0 instead, not sure why using info->nlhdr->nlmsg_flags > for this netlink GET operation. That's just my mistake, thank you for your review. I'll send a revised patch again later today. BR, Yoshiyuki On Sun, Apr 26, 2020 at 7:29 PM Pablo Neira Ayuso wrote: > Hi, > > On Wed, Apr 22, 2020 at 11:42:11PM +0900, Yoshiyuki Kurauchi wrote: > > In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI > > flag since it returns multipart message. > > This patch adds a new arg "flags" in gtp_genl_fill_info() so that > > flags can be set by the callers. > > > > Signed-off-by: Yoshiyuki Kurauchi > > --- > > drivers/net/gtp.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c > > index 672cd2caf2fb..10fa731bae6d 100644 > > --- a/drivers/net/gtp.c > > +++ b/drivers/net/gtp.c > > @@ -1097,7 +1097,7 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, > struct genl_info *info) > > } > > > > static struct pdp_ctx *gtp_find_pdp_by_link(struct net *net, > > - struct nlattr *nla[]) > > + struct nlattr *nla[]) > > { > > struct gtp_dev *gtp; > > > > @@ -1169,11 +1169,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, > struct genl_info *info) > > static struct genl_family gtp_genl_family; > > > > static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 > snd_seq, > > - u32 type, struct pdp_ctx *pctx) > > + int flags, u32 type, struct pdp_ctx *pctx) > > { > > void *genlh; > > > > - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, > > + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, > flags, > > type); > > if (genlh == NULL) > > goto nlmsg_failure; > > @@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, > struct genl_info *info) > > goto err_unlock; > > } > > > > - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, > > - info->snd_seq, info->nlhdr->nlmsg_type, > pctx); > > + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, > info->snd_seq, > > + info->nlhdr->nlmsg_flags, > info->nlhdr->nlmsg_type, pctx); > > This should be 0 instead, not sure why using info->nlhdr->nlmsg_flags > for this netlink GET operation. > > > if (err < 0) > > goto err_unlock_free; > > > > @@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, > > gtp_genl_fill_info(skb, > > NETLINK_CB(cb->skb).portid, > > cb->nlh->nlmsg_seq, > > + NLM_F_MULTI, > > This one looks fine to me. > > > cb->nlh->nlmsg_type, pctx)) { > > cb->args[0] = i; > > cb->args[1] = j; > > -- > > 2.17.1 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahochauwaaaaa at gmail.com Mon Apr 27 11:08:14 2020 From: ahochauwaaaaa at gmail.com (Yoshiyuki Kurauchi) Date: Mon, 27 Apr 2020 20:08:14 +0900 Subject: [PATCH] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() Message-ID: <20200427110814.10896-1-ahochauwaaaaa@gmail.com> In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI flag since it returns multipart message. This patch adds a new arg "flags" in gtp_genl_fill_info() so that flags can be set by the callers. Signed-off-by: Yoshiyuki Kurauchi --- drivers/net/gtp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 672cd2caf2fb..21640a035d7d 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1169,11 +1169,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) static struct genl_family gtp_genl_family; static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, - u32 type, struct pdp_ctx *pctx) + int flags, u32 type, struct pdp_ctx *pctx) { void *genlh; - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, flags, type); if (genlh == NULL) goto nlmsg_failure; @@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) goto err_unlock; } - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, - info->snd_seq, info->nlhdr->nlmsg_type, pctx); + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, info->snd_seq, + 0, info->nlhdr->nlmsg_type, pctx); if (err < 0) goto err_unlock_free; @@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, gtp_genl_fill_info(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, + NLM_F_MULTI, cb->nlh->nlmsg_type, pctx)) { cb->args[0] = i; cb->args[1] = j; -- 2.17.1 From pablo at netfilter.org Wed Apr 29 12:24:26 2020 From: pablo at netfilter.org (Pablo Neira Ayuso) Date: Wed, 29 Apr 2020 14:24:26 +0200 Subject: [PATCH] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() In-Reply-To: <20200427110814.10896-1-ahochauwaaaaa@gmail.com> References: <20200427110814.10896-1-ahochauwaaaaa@gmail.com> Message-ID: <20200429122426.GA9598@salvia> On Mon, Apr 27, 2020 at 08:08:14PM +0900, Yoshiyuki Kurauchi wrote: > In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI > flag since it returns multipart message. > This patch adds a new arg "flags" in gtp_genl_fill_info() so that > flags can be set by the callers. Looks good, would you repost this and Cc: netdev at vger.kernel.org You will have to specify what tree you're targetting this to (either net or net-next). Thanks. > Signed-off-by: Yoshiyuki Kurauchi > --- > drivers/net/gtp.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c > index 672cd2caf2fb..21640a035d7d 100644 > --- a/drivers/net/gtp.c > +++ b/drivers/net/gtp.c > @@ -1169,11 +1169,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) > static struct genl_family gtp_genl_family; > > static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, > - u32 type, struct pdp_ctx *pctx) > + int flags, u32 type, struct pdp_ctx *pctx) > { > void *genlh; > > - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, > + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, flags, > type); > if (genlh == NULL) > goto nlmsg_failure; > @@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) > goto err_unlock; > } > > - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, > - info->snd_seq, info->nlhdr->nlmsg_type, pctx); > + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, info->snd_seq, > + 0, info->nlhdr->nlmsg_type, pctx); > if (err < 0) > goto err_unlock_free; > > @@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, > gtp_genl_fill_info(skb, > NETLINK_CB(cb->skb).portid, > cb->nlh->nlmsg_seq, > + NLM_F_MULTI, > cb->nlh->nlmsg_type, pctx)) { > cb->args[0] = i; > cb->args[1] = j; > -- > 2.17.1 > From ahochauwaaaaa at gmail.com Thu Apr 30 05:01:36 2020 From: ahochauwaaaaa at gmail.com (Yoshiyuki Kurauchi) Date: Thu, 30 Apr 2020 14:01:36 +0900 Subject: [PATCH net] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() Message-ID: <20200430050136.1837-1-ahochauwaaaaa@gmail.com> In drivers/net/gtp.c, gtp_genl_dump_pdp() should set NLM_F_MULTI flag since it returns multipart message. This patch adds a new arg "flags" in gtp_genl_fill_info() so that flags can be set by the callers. Signed-off-by: Yoshiyuki Kurauchi --- drivers/net/gtp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 672cd2caf2fb..21640a035d7d 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -1169,11 +1169,11 @@ static int gtp_genl_del_pdp(struct sk_buff *skb, struct genl_info *info) static struct genl_family gtp_genl_family; static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, - u32 type, struct pdp_ctx *pctx) + int flags, u32 type, struct pdp_ctx *pctx) { void *genlh; - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, flags, type); if (genlh == NULL) goto nlmsg_failure; @@ -1227,8 +1227,8 @@ static int gtp_genl_get_pdp(struct sk_buff *skb, struct genl_info *info) goto err_unlock; } - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, - info->snd_seq, info->nlhdr->nlmsg_type, pctx); + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, info->snd_seq, + 0, info->nlhdr->nlmsg_type, pctx); if (err < 0) goto err_unlock_free; @@ -1271,6 +1271,7 @@ static int gtp_genl_dump_pdp(struct sk_buff *skb, gtp_genl_fill_info(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, + NLM_F_MULTI, cb->nlh->nlmsg_type, pctx)) { cb->args[0] = i; cb->args[1] = j; -- 2.17.1