{ "id": "123518", "key": "AC-1901", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2014-01-12T06:23:44.000+0000", "created": "2013-12-10T03:07:07.000+0000", "labels": [ "core", "defect", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:40:49.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "We're requiring client-side hashing for logging into some of our company-internal infrastructure. That is, I took the same code we use on our web-login to Titanium. When pasting the attached code to /any/ place in the code, Titanium will crash with a null-pointer exception.\r\n\r\nIt looks like Titanium has troubles with reading strings using the \\u<0000> notation inside JavascriptCore.\r\n\r\nIf you like pictures, checkout the attached screenshot.\r\n\r\nI can't really do anything without this. Is there a way to hook openSSL's crypto-functions or at least somehow get a working Whirlpool implementation? If not, let's see how this evolves.", "attachment": [ { "id": "44514", "filename": "Bildschirmfoto 2013-12-10 um 04.03.17.png", "author": { "name": "kenansulayman", "key": "kenansulayman", "displayName": "Kenan Sulayman", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-12-10T03:07:07.000+0000", "size": 462025, "mimeType": "image/png" }, { "id": "44516", "filename": "Text 2013.12.10 04-01-34.txt", "author": { "name": "kenansulayman", "key": "kenansulayman", "displayName": "Kenan Sulayman", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-12-10T03:13:07.000+0000", "size": 6441, "mimeType": "text/plain" } ], "flagged": false, "summary": "Javascript Whirlpool implementation causes null-pointer exception", "creator": { "name": "kenansulayman", "key": "kenansulayman", "displayName": "Kenan Sulayman", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "kenansulayman", "key": "kenansulayman", "displayName": "Kenan Sulayman", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "285616", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~kenansulayman] Would it be possible for you to provide a simple Titanium test case that can help us reproduce this issue?", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-23T03:53:36.000+0000", "updated": "2013-12-23T03:53:36.000+0000" }, { "id": "287872", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I had to add missing semi colons to the provided test case but it works fine after that. Here is the code and output. Let us know if it does not resolve your issue and we would be happy to reopen the ticket.\r\n\r\n{code}\r\nvar wp = (function () {\r\n var p, c = [],\r\n u = [],\r\n b, e, v, s, z, w, A;\r\n for (b = 8; 0 < b--;) c[b] = [];\r\n for (e = 0; 256 > e; e++)\r\n for (b = \"\\u1823\\uc6e8\\u87b8\\u014f\\u36a6\\ud2f5\\u796f\\u9152\\u60bc\\u9b8e\\ua30c\\u7b35\\u1de0\\ud7c2\\u2e4b\\ufe57\\u1577\\u37e5\\u9ff0\\u4ada\\u58c9\\u290a\\ub1a0\\u6b85\\ubd5d\\u10f4\\ucb3e\\u0567\\ue427\\u418b\\ua77d\\u95d8\\ufbee\\u7c66\\udd17\\u479e\\uca2d\\ubf07\\uad5a\\u8333\\u6302\\uaa71\\uc819\\u49d9\\uf2e3\\u5b88\\u9a26\\u32b0\\ue90f\\ud580\\ubecd\\u3448\\uff7a\\u905f\\u2068\\u1aae\\ub454\\u9322\\u64f1\\u7312\\u4008\\uc3ec\\udba1\\u8d3d\\u9700\\ucf2b\\u7682\\ud61b\\ub5af\\u6a50\\u45f3\\u30ef\\u3f55\\ua2ea\\u65ba\\u2fc0\\ude1c\\ufd4d\\u9275\\u068a\\ub2e6\\u0e1f\\u62d4\\ua896\\uf9c5\\u2559\\u8472\\u394c\\u5e78\\u388c\\ud1a5\\ue261\\ub321\\u9c1e\\u43c7\\ufc04\\u5199\\u6d0d\\ufadf\\u7e24\\u3bab\\uce11\\u8f4e\\ub7eb\\u3c81\\u94f7\\ub913\\u2cd3\\ue76e\\uc403\\u5644\\u7fa9\\u2abb\\uc153\\udc0b\\u9d6c\\u3174\\uf646\\uac89\\u14e1\\u163a\\u6909\\u70b6\\ud0ed\\ucc42\\u98a4\\u285c\\uf886\".charCodeAt(e /\r\n 2), b = 0 == (e & 1) ? b >>> 8 : b & 255, v = b << 1, 256 <= v && (v ^= 285), s = v << 1, 256 <= s && (s ^= 285), z = s ^ b, w = s << 1, 256 <= w && (w ^= 285), A = w ^ b, c[0][e] = [0, 0], c[0][e][0] = b << 24 | b << 16 | s << 8 | b, c[0][e][1] = w << 24 | z << 16 | v << 8 | A, b = 1; 8 > b; b++) c[b][e] = [0, 0], c[b][e][0] = c[b - 1][e][0] >>> 8 | c[b - 1][e][1] << 24, c[b][e][1] = c[b - 1][e][1] >>> 8 | c[b - 1][e][0] << 24;\r\n u[0] = [0, 0];\r\n for (e = 1; 10 >= e; e++) b = 8 * (e - 1), u[e] = [0, 0], u[e][0] = c[0][b][0] & 4278190080 ^ c[1][b + 1][0] & 16711680 ^ c[2][b + 2][0] & 65280 ^ c[3][b + 3][0] & 255, u[e][1] = c[4][b + 4][1] & 4278190080 ^ c[5][b + 5][1] & 16711680 ^ c[6][b + 6][1] &\r\n 65280 ^ c[7][b + 7][1] & 255;\r\n var x = [],\r\n g = [],\r\n m = 0,\r\n l = 0,\r\n q = [],\r\n n = [],\r\n h = [],\r\n t = [],\r\n r = [],\r\n y = function() {\r\n var a, f, b, k, d;\r\n for (f = a = 0; 8 > a; a++, f += 8) t[a] = [0, 0], t[a][0] = (g[f] & 255) << 24 ^ (g[f + 1] & 255) << 16 ^ (g[f + 2] & 255) << 8 ^ g[f + 3] & 255, t[a][1] = (g[f + 4] & 255) << 24 ^ (g[f + 5] & 255) << 16 ^ (g[f + 6] & 255) << 8 ^ g[f + 7] & 255;\r\n for (a = 0; 8 > a; a++) r[a] = [0, 0], n[a] = [0, 0], r[a][0] = t[a][0] ^ (n[a][0] = q[a][0]), r[a][1] = t[a][1] ^ (n[a][1] = q[a][1]);\r\n for (b = 1; 10 >= b; b++) {\r\n for (a = 0; 8 > a; a++)\r\n for (h[a] = [0, 0], d = 0, k = 56, f = 0; 8 > d; d++, k -= 8, f = 32 > k ? 1 : 0) h[a][0] ^= c[d][n[a - d & 7][f] >>> k % 32 & 255][0],\r\n h[a][1] ^= c[d][n[a - d & 7][f] >>> k % 32 & 255][1];\r\n for (a = 0; 8 > a; a++) n[a][0] = h[a][0], n[a][1] = h[a][1];\r\n n[0][0] ^= u[b][0];\r\n n[0][1] ^= u[b][1];\r\n for (a = 0; 8 > a; a++)\r\n for (h[a][0] = n[a][0], h[a][1] = n[a][1], d = 0, k = 56, f = 0; 8 > d; d++, k -= 8, f = 32 > k ? 1 : 0) h[a][0] ^= c[d][r[a - d & 7][f] >>> k % 32 & 255][0], h[a][1] ^= c[d][r[a - d & 7][f] >>> k % 32 & 255][1];\r\n for (a = 0; 8 > a; a++) r[a][0] = h[a][0], r[a][1] = h[a][1];\r\n }\r\n for (a = 0; 8 > a; a++) q[a][0] = q[a][0] ^ r[a][0] ^ t[a][0], q[a][1] = q[a][1] ^ r[a][1] ^ t[a][1];\r\n };\r\n p = function(a) {\r\n return p.init().add(a).finalize();\r\n };\r\n p.init =\r\n function() {\r\n for (var a = 32; 0 < a--;) x[a] = 0;\r\n m = l = 0;\r\n g = [0];\r\n for (a = 8; 0 < a--;) q[a] = [0, 0];\r\n return p;\r\n };\r\n p.add = function(a, f) {\r\n if (!a) return p;\r\n if (!f) {\r\n var b, k, d, c = a.toString();\r\n b = [];\r\n for (k = 0; k < c.length; k++) d = c.charCodeAt(k), 256 <= d && b.push(d >>> 8 & 255), b.push(d & 255);\r\n a = b;\r\n f = 8 * a.length;\r\n }\r\n b = 0;\r\n k = 8 - (f & 7) & 7;\r\n d = m & 7;\r\n var e, h = f,\r\n c = 31;\r\n for (e = 0; 0 <= c; c--) e += (x[c] & 255) + h % 256, x[c] = e & 255, e >>>= 8, h = Math.floor(h / 256);\r\n for (; 8 < f;) {\r\n c = a[b] << k & 255 | (a[b + 1] & 255) >>> 8 - k;\r\n if (0 > c || 256 <= c) return 0;\r\n g[l++] |= c >>> d;\r\n m += 8 - d;\r\n 512 == m && (y(),\r\n m = l = 0, g = []);\r\n g[l] = c << 8 - d & 255;\r\n m += d;\r\n f -= 8;\r\n b++;\r\n }\r\n 0 < f ? (c = a[b] << k & 255, g[l] |= c >>> d) : c = 0;\r\n 8 > d + f || (l++, m += 8 - d, f -= 8 - d, 512 == m && (y(), m = l = 0, g = []), g[l] = c << 8 - d & 255);\r\n m += f;\r\n return p;\r\n };\r\n p.finalize = function() {\r\n var a, b, c, e = \"\",\r\n d = [],\r\n h = [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"];\r\n g[l] |= 128 >>> (m & 7);\r\n l++;\r\n if (32 < l) {\r\n for (; 64 > l;) g[l++] = 0;\r\n y();\r\n l = 0;\r\n g = [];\r\n }\r\n for (; 32 > l;) g[l++] = 0;\r\n g.push.apply(g,x);\r\n y();\r\n for (b = a = 0; 8 > a; a++, b += 8) c = q[a][0], d[b] = c >>> 24 & 255, d[b + 1] = c >>> 16 & 255, d[b + 2] = c >>> 8 & 255, d[b + 3] = c & 255, c = q[a][1], d[b + 4] = c >>> 24 & 255, d[b + 5] = c >>> 16 & 255, d[b + 6] = c >>> 8 & 255, d[b +\r\n 7] = c & 255;\r\n for (a = 0; a < d.length; a++) e += h[d[a] >>> 4], e += h[d[a] & 15];\r\n return e;\r\n };\r\n\r\n return p;\r\n})();\r\n\r\nTi.API.info(\"test: \" + wp(\"test\"));\r\n{code}\r\n\r\n[INFO] : test: b913d5bbb8e461c2c5961cbe0edcdadfd29f068225ceb37da6defcf89849368f8c6c2eb6a4c4ac75775d032a0ecfdfe8550573062b653fe92fc7b8fb3b7be8d6", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-12T06:23:44.000+0000", "updated": "2014-01-12T06:24:21.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }