From patchwork Thu Mar 23 12:07:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Maier X-Patchwork-Id: 742641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by ozlabs.org (Postfix) with ESMTP id 3vplfs5sh6z9s3w for ; Thu, 23 Mar 2017 23:07:33 +1100 (AEDT) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 6C20D2F316; Thu, 23 Mar 2017 12:07:31 +0000 (UTC) Authentication-Results: lists.osmocom.org; dmarc=none header.from=sysmocom.de X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a01:4f8:191:444c::2:4; helo=mail.sysmocom.de; envelope-from=pmaier@sysmocom.de; receiver=openbsc@lists.osmocom.org Authentication-Results: lists.osmocom.org; dmarc=none header.from=sysmocom.de Received: from mail.sysmocom.de (mail.sysmocom.de [IPv6:2a01:4f8:191:444c::2:4]) by lists.osmocom.org (Postfix) with ESMTP id 5AF222F306 for ; Thu, 23 Mar 2017 12:07:28 +0000 (UTC) Received: from mail.sysmocom.de (mail.sysmocom.de [144.76.43.93]) by mail.sysmocom.de (Postfix) with ESMTP id A881A2AB025; Thu, 23 Mar 2017 12:07:27 +0000 (UTC) Received: from my.box (unknown [91.65.133.89]) by mail.sysmocom.de (Postfix) with ESMTPSA id 4021D2AB023; Thu, 23 Mar 2017 12:07:27 +0000 (UTC) From: Philipp Maier To: openbsc@lists.osmocom.org, pmaier@sysmocom.de Subject: [PATCH 2/2] fix writing of ICCID for sysmo-usim-sjs1 Date: Thu, 23 Mar 2017 13:07:17 +0100 Message-Id: <1490270837-28823-3-git-send-email-pmaier@sysmocom.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490270837-28823-1-git-send-email-pmaier@sysmocom.de> References: <1490270837-28823-1-git-send-email-pmaier@sysmocom.de> X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" The programming procedure for sysmo-usim-sjs1 lacks writing the ICCID. This commit adds the missing call to update_binary() --- pySim/cards.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pySim/cards.py b/pySim/cards.py index fafc55f..925c5e6 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -434,20 +434,20 @@ class SysmoUSIMSJS1(Card): def program(self, p): + # authenticate as ADM using default key (written on the card..) + if not p['pin_adm']: + raise ValueError("Please provide a PIN-ADM as there is no default one") + self._scc.verify_chv(0x0A, h2b(p['pin_adm'])) # select MF r = self._scc.select_file(['3f00']) + # write EF.ICCID + data, sw = self._scc.update_binary('2fe2', enc_iccid(p['iccid'])) + # select DF_GSM r = self._scc.select_file(['7f20']) - # authenticate as ADM using default key (written on the card..) - if not p['pin_adm']: - raise ValueError("Please provide a PIN-ADM as there is no default one") - - self._scc.verify_chv(0x0A, h2b(p['pin_adm'])) - - # set Ki in proprietary file data, sw = self._scc.update_binary('00FF', p['ki'])