Core NFC Enhancements - Error attempting to read tag

Hello,


I couldn't find a better place to ask about issues using the Core NFC enhancements in iOS 13.


I'm attempting to attempt access to a simple smartcard applet on a typical smartcard. To the extent that this smartcard is also able to be a MiFare card, the MiFare capabilities of the card have been disabled.


I'm have the appropriate entitelements and the proper AID loaded in the Info.plist array.


I have NFC sniffing equipment which even shows the iPhone 8 selecting my application (which succeeds with a SW1 SW2 of 0x90 0x00).


Shortly thereafter and without having made a call to my tagReaderSession didDetectTags, I'm seeing: Error Domain=NFCError Code=202 "Session invalidated unexpectedly" UserInfo={NSLocalizedDescription=Session invalidated unexpectedly} in the debug console.


Any thoughts?

Accepted Reply

As of the iOS 13 Beta 2 release yesterday, I can confirm that the issue I was seeing has been resolved.

Replies

Further notes on this issue:


Here's a capture of the session with the phone & smartcard (bottom of message):


*Note towards the end the iPhone send a select command for AID A00000014100, which is the AID I have declared in my Info.plist and does exist on the card. The card, in turn, responds back with 90 31 32 33 SW1=90 SW2=00, which is the correct hello from the application. It appears that the moment that this happens, nfcd crashes. The phone I'm testing on is an iPhone 8.


      Start |        End | Src | Data (! denotes parity error, ' denotes short bytes)            | CRC | Annotation         |         
------------|------------|-----|-----------------------------------------------------------------|-----|--------------------|         
          0 |       1056 | Rdr | 26'                                                             |     | REQA         
       2228 |       4596 | Tag | 08  00                                                          |     |          
      11648 |      14112 | Rdr | 93  20                                                          |     | ANTICOLL         
      15284 |      21172 | Tag | 75  c2  2b  02  9e                                              |     |          
      28160 |      38688 | Rdr | 93  70  75  c2  2b  02  9e  4e  8c                              |  ok | SELECT_UID         
      39876 |      43460 | Tag | 20  fc  70                                                      |     |          
      52416 |      57184 | Rdr | e0  80  31  73                                                  |  ok | RATS         
      58356 |      79220 | Tag | 10  78  80  b1  00  4a  49  50  69  46  6f  6e  79  5f  56  32  |     |          
            |            |     | a2  d5                                                          |  ok |          
     105520 |     109136 | Rdr | b2  67  c7                                                      |  ok | ?         
     113124 |     116644 | Tag | a3  6f  c6                                                      |     |          
     133344 |     150784 | Rdr | 02  00  a4  04  00  06  a0  00  00  01  41  00  00  04  0e      |  ok | ?         
     235668 |     246100 | Tag | 02  90  31  32  33  90  00  08  2d                              |  ok |         

I tried to start iso14443 session, but I got same error "Session invalidated unexpectedly" on iPhoneX iOS13.

Exceptionally, ePassport detection succeeded(called tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag])),

but failed with other generic smartcards in spite of the appropriate AID is set in Info.plist.

With "Additional Logging" setting enabled, I can see that nfcd was crashing.


~~~

14:27:52.041618 +0900 runningboardd XPC connection invalidated: [daemon<com.apple.nfcd>:4781]

14:27:52.051173 +0900 runningboardd [daemon<com.apple.nfcd>:4781] Death sentinel fired!

14:27:52.072549 +0900 ReportCrash cr_update: Parsing corpse data for process nfcd [pid 4781]

~~~


It seems a issue of nfcd so we need support.

Thanks.

I seem to be seeing the same behaviour. I have both an ePassport and generic transport AID configured in Info.plist. I can successfully detect an ePassport, but the transport card results in nfcd crashing.


0x8344 default 14:48:35.662570 +0100 SharingViewService NFCTagReaderViewController: Interrupted

0x8344 default 14:48:35.663573 +0100 SharingViewService XPC interrupted

0x8344 default 14:48:35.663794 +0100 SharingViewService dismissIfIdle: is idle

0xe6e2 default 14:48:35.717530 +0100 nfc-prototype tagReaderSession.didInvalidateWithError Session invalidated unexpectedly

0xe861 default 14:48:35.747840 +0100 runningboardd XPC connection invalidated: [daemon<com.apple.nfcd>:563]

0xe8a1 default 14:48:35.750553 +0100 ReportCrash cr_update: Parsing corpse data for process nfcd [pid 563]

0xe804 default 14:48:35.765041 +0100 runningboardd [daemon<com.apple.nfcd>:563] Death sentinel fired!

0xe67f default 14:48:35.780511 +0100 passd 00000001 0371cc50 -[NFHardwareManager didInterruptXPCConnection:]:208 Connection interrupted

0xe8a9 default 14:48:35.921379 +0100 runningboardd Removing process: [daemon<com.apple.nfcd>:563]

0xe8a9 default 14:48:35.923673 +0100 runningboardd Removing assertions for terminated process: [daemon<com.apple.nfcd>:563]

0xe8a1 default 14:48:35.945018 +0100 ReportCrash Formulating fatal report for corpse[563] nfcd

0xe8a1 default 14:48:35.987454 +0100 ReportCrash Saved type '109(<private>)' report (18 of max 25) at /var/mobile/Library/Logs/CrashReporter/nfcd-2019-06-12-144835.ips

I also start iso14443 session and getting a crash of com.apple.nfcd on iPhone 7.

As of the iOS 13 Beta 2 release yesterday, I can confirm that the issue I was seeing has been resolved.

Confirming that iOS 13 beta 2 also resolved this for me 🙂

You wrote:

I have both an ePassport and generic transport AID configured in Info.plist.

My Question: How did you do that? I am striggeling to connect at all. On Android I can connect to the passwort and it shows up as an iso14443-4 tag. So I expecting this should work on iOS as well.

Hi @StuartyBoarder, Can you please let me know about how your ePassport connected with iso14443-4 tag.