From patchwork Mon Jun 1 14:35:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max X-Patchwork-Id: 479072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (unknown [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id B6A01140DCC for ; Tue, 2 Jun 2015 00:36:11 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 7D6136F0A; Mon, 1 Jun 2015 14:36:09 +0000 (UTC) X-Original-To: baseband-devel@lists.osmocom.org Delivered-To: baseband-devel@lists.osmocom.org X-Greylist: delayed 1456 seconds by postgrey-1.34 at lists.osmocom.org; Mon, 01 Jun 2015 14:36:07 UTC Received: from hylle06.itea.ntnu.no (hylle06.itea.ntnu.no [IPv6:2001:700:300:3::235]) by lists.osmocom.org (Postfix) with ESMTP id ED9766F04 for ; Mon, 1 Jun 2015 14:36:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hylle06.itea.ntnu.no (Postfix) with ESMTP id EC6406618AE for ; Mon, 1 Jun 2015 16:36:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle06.itea.ntnu.no Received: from alumnimail01.it.ntnu.no (unknown [IPv6:2001:700:300:4::54]) by hylle06.itea.ntnu.no (Postfix) with ESMTP id A64F1661834 for ; Mon, 1 Jun 2015 16:36:05 +0200 (CEST) Received: from localhost (nat.sec.t-labs.tu-berlin.de [130.149.230.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: suraev) by alumnimail01.it.ntnu.no (Postfix) with ESMTPSA id 7F79C55260 for ; Mon, 1 Jun 2015 16:36:05 +0200 (CEST) From: Max To: baseband-devel@lists.osmocom.org Subject: [PATCH] Remove comp128 from public API - use osmocom/crypt/auth.h instead Date: Mon, 1 Jun 2015 16:35:56 +0200 Message-Id: <1433169356-12908-1-git-send-email-max.suraev@fairwaves.co> X-Mailer: git-send-email 2.1.4 X-BeenThere: baseband-devel@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OsmocomBB - open source GSM baseband firmware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: baseband-devel-bounces@lists.osmocom.org Sender: "baseband-devel" Signed-off-by: Max --- TODO-RELEASE | 1 + include/Makefile.am | 6 +++--- include/osmocom/gsm/comp128.h | 4 ++-- src/gsm/auth_comp128v1.c | 2 +- src/gsm/comp128.c | 2 +- src/gsm/libosmogsm.map | 1 - tests/comp128/comp128_test.c | 1 - 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/TODO-RELEASE b/TODO-RELEASE index d03aa49..956b4be 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -1,2 +1,3 @@ #library what description / commit summary line +libosmogsm api-change remove comp128 from public API libosmogb abi-change bssgp: Fix bssgp_tx_fc_bvc parameter type diff --git a/include/Makefile.am b/include/Makefile.am index 52c6a38..b4da54e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -51,8 +51,6 @@ nobase_include_HEADERS = \ osmocom/gsm/a5.h \ osmocom/gsm/abis_nm.h \ osmocom/gsm/apn.h \ - osmocom/gsm/comp128.h \ - osmocom/gsm/comp128v23.h \ osmocom/gsm/gan.h \ osmocom/gsm/gsm0341.h \ osmocom/gsm/gsm0411_smc.h \ @@ -121,7 +119,9 @@ endif noinst_HEADERS = \ osmocom/core/timer_compat.h \ - osmocom/gsm/kasumi.h + osmocom/gsm/kasumi.h \ + osmocom/gsm/comp128.h \ + osmocom/gsm/comp128v23.h osmocom/core/bit%gen.h: osmocom/core/bitXXgen.h.tpl $(AM_V_GEN)$(MKDIR_P) $(dir $@) diff --git a/include/osmocom/gsm/comp128.h b/include/osmocom/gsm/comp128.h index 33b997a..c45da37 100644 --- a/include/osmocom/gsm/comp128.h +++ b/include/osmocom/gsm/comp128.h @@ -9,10 +9,10 @@ #include /* - * Performs the COMP128 algorithm (used as A3/A8) + * Performs the COMP128v1 algorithm (used as A3/A8) * ki : uint8_t [16] * srand : uint8_t [16] * sres : uint8_t [4] * kc : uint8_t [8] */ -void comp128(const uint8_t *ki, const uint8_t *srand, uint8_t *sres, uint8_t *kc); +void comp128v1(const uint8_t *ki, const uint8_t *srand, uint8_t *sres, uint8_t *kc); diff --git a/src/gsm/auth_comp128v1.c b/src/gsm/auth_comp128v1.c index 41aef71..c40027e 100644 --- a/src/gsm/auth_comp128v1.c +++ b/src/gsm/auth_comp128v1.c @@ -28,7 +28,7 @@ static int c128v1_gen_vec(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand) { - comp128(aud->u.gsm.ki, _rand, vec->sres, vec->kc); + comp128v1(aud->u.gsm.ki, _rand, vec->sres, vec->kc); vec->auth_types = OSMO_AUTH_TYPE_GSM; return 0; diff --git a/src/gsm/comp128.c b/src/gsm/comp128.c index b7a2382..e36c20d 100644 --- a/src/gsm/comp128.c +++ b/src/gsm/comp128.c @@ -185,7 +185,7 @@ _comp128_permutation(uint8_t *x, uint8_t *bits) } void -comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) +comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) { int i; uint8_t x[32], bits[128]; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 22428a2..c80c15f 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -26,7 +26,6 @@ abis_nm_ipa_magic; osmo_sitype_strs; -comp128; dbm2rxlev; gprs_cipher_gen_input_i; diff --git a/tests/comp128/comp128_test.c b/tests/comp128/comp128_test.c index eb6fb12..d6a6401 100644 --- a/tests/comp128/comp128_test.c +++ b/tests/comp128/comp128_test.c @@ -6,7 +6,6 @@ #include #include -#include #include static struct osmo_sub_auth_data test_aux2 = {