From patchwork Wed Jun 1 12:10:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 628648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3rKThh32gqz9t5c for ; Wed, 1 Jun 2016 22:10:44 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id DF8A02248C; Wed, 1 Jun 2016 12:10:42 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id 712E02247D; Wed, 1 Jun 2016 12:10:41 +0000 (UTC) Date: Wed, 1 Jun 2016 12:10:41 +0000 From: Harald Welte To: Harald Welte X-Gerrit-MessageType: merged Subject: [MERGED] libosmocore[master]: osmo-auc-gen: Print hex values without intermittent spaces X-Gerrit-Change-Id: I2805615e0c2087ca632e0658b37a9e06929620b6 X-Gerrit-ChangeURL: X-Gerrit-Commit: 4f511b67fd83b5767071604920ebc3bac025b751 In-Reply-To: References: MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2-31-gb331dbd-dirty X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: laforge@gnumonks.org Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" Message-Id: <20160601121042.DF8A02248C@lists.osmocom.org> Harald Welte has submitted this change and it was merged. Change subject: osmo-auc-gen: Print hex values without intermittent spaces ...................................................................... osmo-auc-gen: Print hex values without intermittent spaces When generating some authentication vectors using the osmo-auc-gen utility, it used to print values like this: AUTN: f7 55 bc 47 de d0 00 00 f9 ed 4b 3f 6c 2a 97 6f which is quite difficult to copy+paste on the terminal. Now it generates the following format: Change-Id: I2805615e0c2087ca632e0658b37a9e06929620b6 AUTN: f755bc47ded00000f9ed4b3f6c2a976f Reviewed-on: https://gerrit.osmocom.org/164 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M utils/osmo-auc-gen.c 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index b026e28..3b3e557 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -48,18 +48,18 @@ static void dump_auth_vec(struct osmo_auth_vector *vec) { - printf("RAND:\t%s\n", osmo_hexdump(vec->rand, sizeof(vec->rand))); + printf("RAND:\t%s\n", osmo_hexdump_nospc(vec->rand, sizeof(vec->rand))); if (vec->auth_types & OSMO_AUTH_TYPE_UMTS) { - printf("AUTN:\t%s\n", osmo_hexdump(vec->autn, sizeof(vec->autn))); - printf("IK:\t%s\n", osmo_hexdump(vec->ik, sizeof(vec->ik))); - printf("CK:\t%s\n", osmo_hexdump(vec->ck, sizeof(vec->ck))); - printf("RES:\t%s\n", osmo_hexdump(vec->res, vec->res_len)); + printf("AUTN:\t%s\n", osmo_hexdump_nospc(vec->autn, sizeof(vec->autn))); + printf("IK:\t%s\n", osmo_hexdump_nospc(vec->ik, sizeof(vec->ik))); + printf("CK:\t%s\n", osmo_hexdump_nospc(vec->ck, sizeof(vec->ck))); + printf("RES:\t%s\n", osmo_hexdump_nospc(vec->res, vec->res_len)); } if (vec->auth_types & OSMO_AUTH_TYPE_GSM) { - printf("SRES:\t%s\n", osmo_hexdump(vec->sres, sizeof(vec->sres))); - printf("Kc:\t%s\n", osmo_hexdump(vec->kc, sizeof(vec->kc))); + printf("SRES:\t%s\n", osmo_hexdump_nospc(vec->sres, sizeof(vec->sres))); + printf("Kc:\t%s\n", osmo_hexdump_nospc(vec->kc, sizeof(vec->kc))); } }