Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2363] Android: ti.touchid does not decode Keychain data correctly

GitHub Issuen/a
TypeBug
PriorityCritical
StatusResolved
ResolutionFixed
Resolution Date2017-11-14T21:58:30.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTouchID
Labelsn/a
ReporterGary Mathews
AssigneeGary Mathews
Created2017-09-26T18:25:47.000+0000
Updated2017-11-14T21:58:30.000+0000

Description

- ti.touchid can sometimes decode decrypted data incorrectly *TEST CASE*
var TouchID = require('ti.touchid');
    keychainItem = TouchID.createKeychainItem({
        identifier: 'test_key',
        accessControlMode: TouchID.ACCESS_CONTROL_TOUCH_ID_ANY // remove this to save without fingerprint authentication
    }),
    win = Ti.UI.createWindow({backgroundColor: 'white', layout: 'vertical'});
    queue = [],
    callback = function(e) {
        if (queue.length) {
            queue.shift().close();
        }
        alert(JSON.stringify(e, null, 1));
    };

keychainItem.addEventListener('save', callback);
keychainItem.addEventListener('read', callback);
keychainItem.addEventListener('reset', callback);
keychainItem.addEventListener('update', callback);

button('SAVE', function() {
    showFingerprint();
    keychainItem.save('86c8153c-6d2c-421a-8e79-eae8ad0831ba');
});
button('READ', function() {
    showFingerprint();
    keychainItem.read();
});
button('RESET', function() {
    showFingerprint();
    keychainItem.reset();
});
button('UPDATE', function() {
    showFingerprint();
    keychainItem.update('test_update');
});

win.open();

function showFingerprint() {
    if (keychainItem.accessControlMode !== TouchID.ACCESS_CONTROL_TOUCH_ID_ANY) return;
    var win = Ti.UI.createWindow({backgroundColor: 'white'}),
        img = Ti.UI.createImageView({image: 'http://bit.ly/2ur2X4u', width: 64, height: 64});
    queue.push(win);
    win.add(img);
    win.open();
}
function button(title, click) {
    var btn = Ti.UI.createButton({title: title, width: Ti.UI.FILL});
    btn.addEventListener('click', click);
    win.add(btn);
}
- SAVE and then READ data - READ callback should return the full string 86c8153c-6d2c-421a-8e79-eae8ad0831ba

Comments

  1. Gary Mathews 2017-09-26

    ti.touchid: https://github.com/appcelerator-modules/ti.touchid/pull/35

JSON Source