Secure element Access Control on ICS 4.0.4
Asked Answered
W

4

11

I updated my Android phone to 4.0.4 and i noticed that a new file nfcee access.xml appeared in the system folder. The idea of the file as far as i understood is the keep a list of signatures, and allow access to the SE and related intends only to the packages that are signed with one of this signatures. So far in this list is of course the signature of the Google Wallet.

Does anybody know how would be the process in future to enter this list? Do you need to ask for permission directly Google?

Waltz answered 8/5, 2012 at 7:52 Comment(0)
C
18

If you root your phone, you can modify the file. The file contains the list of signatures and package names that are allowed access to the Secure Element (SE). The signatures is a hex-encoded X.509 certificate. To create one, simply include the tag <debug /> in the file and it will print to logcat the hex-encoded signature of applications that are denied SE access, for easy cut-and-paste into this file.

To create an app that can access the SE, you need to add this permission to the manifest:

<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />

To actually access the SE, you need to access a hidden API by importing com.android.nfc_extras:

import com.android.nfc_extras.NfcAdapterExtras;
import com.android.nfc_extras.NfcAdapterExtras.CardEmulationRoute;
import com.android.nfc_extras.NfcExecutionEnvironment;

The easiest way to make this possible is to compile your app in the Android source code tree by placing it in packages/apps and building it from there. You need to add the following line to the Android.mk makefile to get access to the SE API:

LOCAL_JAVA_LIBRARIES := com.android.nfc_extras

The functions in com.android.nfc_extras allow enabling and disabling the SE, sending commands to it and receiving responses from it (comparable to IsoDep.transceive()).

Cottingham answered 8/5, 2012 at 20:51 Comment(2)
wow! +1. I didn't know about the hidden api. Anyway, do you know of any links about this? Or a step by step walkthrough to get started?Dumpcart
Have a look at this blog post by @NikolayElenkovCottingham
D
6

This is interesting indeed. If entering your certificate and package name in this file is all that is needed, you shouldn't need to talk to Google, just get whoever is building the ROM (yourself if custom ROM, or a particular carrier) to include it. The bigger problem though is, who do you need to talk to to get the CardManager keys. If it is the carrier, you can also get them to pre-install your applet, so you might not need the keys at runtime (unless you want to use a secure channel to your applet).

Update: Here's a summary of SE support in Android and some more info on how to use the embedded one. In short, it does work, but you can only query stuff of course. It runs JavaCard and is GP 2.1.1 compatible, uses 3DES keys for the secure channel.

http://nelenkov.blogspot.com/2012/08/accessing-embedded-secure-element-in.html

http://nelenkov.blogspot.com/2012/08/android-secure-element-execution.html

BTW, here's the currently allowed cert on my GN 4.0.4. A package is not specified, so any app signed with it will get access to the SE:

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            a8:cd:17:c9:3d:a5:d9:90
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: C=US, ST=California, L=Mountain View, O=Google Inc., OU=Android, CN=Google NFC
        Validity
            Not Before: Mar 24 01:06:53 2011 GMT
            Not After : Aug  9 01:06:53 2038 GMT
        Subject: C=US, ST=California, L=Mountain View, O=Google Inc., OU=Android, CN=Google NFC
Dekow answered 8/5, 2012 at 8:22 Comment(2)
I agree that the actual problem is the Card Management Keys, but if Google offers in future TSM service this might allow other parties use the SE as well. My opinion is that if Google do not open up a bit more, the SIM cards or the MicroSD card will become very soon the preferable SE. I just wanted to know if somebody know the future plans of Google in this direction.Waltz
Well, I can't speak about Google's plans, but since Google Wallet is not doing particularly great, maybe they will open up to letting other/similar/competing NFC payment services work with the SE on Nexus devices.Dekow
B
3

With cavets: If you can get your application on the nfcee_access list you can do the following things:

  • Enable the UICC (sim card) and enable the embedded secure element (if present)
  • Open a communication channel to the embedded secure element and exchange data
  • Receive transaction data from the UICC (sim card) if the UICC wants to send you data (you'll be receiver only).

You can do all this if you root your phone. No need to hack the nfcee_access list to do so, you can just intercept all traffic to the nfc-chip to so so.

What you can't do, even with a rooted phone:

  • Install applets on the UICC / eSE
  • Log/Monitor/influence the data-transfer between the embedded secure element/UICC and an external reader, e.g. hack payment systems.

Caveat: You can do almost everthing if, and only if you have the knowledge and the secure access-keys to access the embedded SE. However, if you have these information you wouldn't ask on stack-overflow. :-)

This knowledge is a well kept secret and no one will tell you this secret unless you are a company as big as google, mastercard, visa, american-express and the like.

Budding answered 8/5, 2012 at 21:48 Comment(0)
S
0

The answer is simply NO you cannot do anything with the Secure Element. Only SE owner or issuer can allow the access to the SE - i.e. it is Google itself, or might be First Data (http://www.firstdata.com/en_us/products/merchants/mobile-commerce/trusted-service-manager-solution.html), but I think this company is responsible only for the Google Wallet itself, not for the SE management - this might done by SK C&C - I have no idea...

Take it also that way - the precondition for using embedded secure element is that you are offering excellent service and you are Google partner or other phone manufacturer partner (unless you are from Facebook or similar company save your time and do not try that). This is not easy and 99.99% of services cannot be there.

Regarding secure element now you can wait until SWP and SIM cards will become more popular and acceptable solution, since you might be able to get contract with MNO on national level easier or hope in NFC-WI and SD card solution or go with stickers or external accessories like iCarte for iPhone.

Shari answered 8/5, 2012 at 8:25 Comment(8)
Is this statement based on actual policy/fact or are you just guessing here? 'the precondition for using embedded secure element is that you are offering excellent service and you are Google'Dekow
Hi, I guess based on my experience. Do you know any other service then Google Wallet for Sprint? If you check what is happening in the NFC industry it is 'battle of SE', because if you controll the SE you participate on revenue. The space on SE is precious and mainly will be used for payment solutions, MNO apps and big services like Oyster. It is for trusted companies - unless the whole ecosystem change. So the idea that you will have nice solution that will secure your door lock and you would like to run that service in embedded SE is as I think Utopia. I can be wrong of course...Shari
It is clear for me that at the moment the embedded secure element is not available for anybody else than Google. But i just told that this latest change in the NFCService is indication that Google goes into direction that will allow in future third-parties have applications using the SE. Of course after approval from Google. Something like RIM is doing at the moment with their secure element.Waltz
@Shari I can't speak about the NFC market in the US, but out here it's pretty developed, and mobile NFC payments have been available for more than 5 years. Not sure how the whole thing is played out, but there are many competing services and you usually use all of them on the same chip. And everyone has their own bank :)Dekow
Well - which NFC mobile payments and in which countries are widely available (meaning not pilot projects for couple of hundred or thousand customers)? And which of them are using embedded SE elements and which of them are using passive stickers, which are normal contactless RFID payment cards, iCarte or SIM card??? And even there are some it is always cooperation of bank, TSM, card issuer (Visa, MasterCard), PoS terminal provider and optionally MNO. So we are talking about billion business - and we are back again - they have power to be Google partner or other phone manufacturer partner...Shari
Check this (nfctimes.com/nfc-projects) for list of outgoing project in last ~8 years. Majority of them are trials, usually based on feature phones, might be few are using Nexus S...Shari
@Shari Two words: FeliCa and Japan :)Dekow
Any news on this topic? Is it possible to use the internal SE somehow nowadays?Crofter

© 2022 - 2024 — McMap. All rights reserved.