<p style="white-space: pre-wrap; word-wrap: break-word;"><br>> Yes, without this commit, it was not possible to select an AID on Sysmocom ISIM and USIM (also any operation related to USIM/ISIM AID) as pySim was throwing various forms 6Exx or 6Axx errors. Yeah are right about SIM being classic SIM (0xA0) or an UICC (0x00), I think the commit message here may be a bit misleading.</p><p style="white-space: pre-wrap; word-wrap: break-word;">To be specific: Without chaging the CLA and possibly P1/P2 it was not possible.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Also, this commit was inspired by the implementation in sysmo-usim-tool, which uses the same CLA, P1 and P2 to read a USIM.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I'm not saying the choice of CLA/P1/P2 is wrong.  I'm saying your conditions are wrong.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The standard approach - AFAIK - is to always use CLA=00 for the first APDU talking to the card.  If it returns an error that CLA is unsupported, you know it's not an UICC and hence only a classic SIM.</p><p style="white-space: pre-wrap; word-wrap: break-word;">So my suggestion would be to follow this approach.  It is much more generic and doesn't rely on very specific AIDs of ISIM or USIM.  It will even work with HPSIM, TSIM, ....</p><p style="white-space: pre-wrap; word-wrap: break-word;">You also don't need to reset the card if you do it that way.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/17880">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/17880">change 17880</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/17880"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ifea328eff3a381d7b82118e22d2bc0ec5f8a87e4 </div>
<div style="display:none"> Gerrit-Change-Number: 17880 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: herlesupreeth <herlesupreeth@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: herlesupreeth <herlesupreeth@gmail.com> </div>
<div style="display:none"> Gerrit-CC: guilly@gmail.com <guilly@gmail.com> </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Sun, 26 Apr 2020 10:48:52 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>