<resources>
<string name="app_name">YkNeo CR</string>
<string name="info"><![CDATA[
-<center>
<h1>Challenge-Response Provider</h1>
<h2>using Yubico\'s <em>Yubikey Neo</em> NFC token</h2>
-</center>
<p>
-You need to set up a slot in the <em>Neo</em> to use with CHAL-HMAC
+This application does not do anything itself, it provides a way for other
+applications to use the NFC token for encryption and authentication purposes.
+</p>
+<p>
+You need to configure one of the slots in the <em>Neo</em> to run in CHAL-HMAC
mode, like this:
</p>
<pre>
ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -oserial-api-visible
</pre>
<p>
-This application does not do anything itself, it provides a way for other
-applications to use the NFC token for encryption and authentication purposes.
-</p>
-<p>
-The slot number used for the above command must be selected below:
+The slot number that was used in the above command must be selected below:
</p>
]]>
</string>
return null;
}
- public void onResume(ArrayList<String> challenge) {
+ public boolean onResume(ArrayList<String> challenge) {
this.challenge = challenge;
Intent intent = activity.getIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (adapter == null) {
Toast.makeText(activity, R.string.no_nfc,
Toast.LENGTH_LONG).show();
- return;
+ return false;
}
if (!adapter.isEnabled()) {
Toast.makeText(activity, R.string.nfc_disabled,
Toast.LENGTH_LONG).show();
- return;
+ return false;
}
adapter.enableForegroundDispatch(activity, tagIntent,
new IntentFilter[] {iso},
new String[][] {techs});
+ return true;
}
public void onPause() {
intent.getStringArrayListExtra("challenge");
intent.putExtra("yubikey_neo_slot", slot);
if (challenge != null) {
- dispatch.onResume(challenge);
+ if (!dispatch.onResume(challenge)) {
+ Log.e(TAG, "Failed to enable fg dispatch");
+ finish();
+ }
} else {
Log.e(TAG, "Challenge missing in the Intent");
finish();