{ "id": "100219", "key": "AC-1906", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-20T16:03:42.000+0000", "created": "2012-08-30T13:54:34.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "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": "The implementation of md5 checksum for Android is broken for binary blobs.\r\n\r\nIn https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/utils/src/java/ti/modules/titanium/utils/UtilsModule.java the method\r\n\r\n\tpublic String md5HexDigest(Object obj)\r\n\t{\r\n\t\tString data = convertToString(obj);\r\n\t\tif (data != null) {\r\n\t\t\treturn DigestUtils.md5Hex(data);\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\nis incorrect since converting a blob to a string before computing md5 on it gives incorrect md5 checksums. The correct implementation should be\r\n\r\n\tpublic String md5HexDigest(Object obj)\r\n\t{\r\n if (obj instanceof String) {\r\n\t\t\treturn DigestUtils.md5Hex((String)obj);\r\n\t\t} else if (obj instanceof TiBlob) {\r\n\t\t\treturn DigestUtils.md5Hex(((TiBlob) obj).getBytes());\r\n }\r\n\t\treturn null;\r\n\t}", "attachment": [], "flagged": false, "summary": "md5 checksum for blobs on Android broken", "creator": { "name": "jdlundin", "key": "jdlundin", "displayName": "Johan Lundin", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jdlundin", "key": "jdlundin", "displayName": "Johan Lundin", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android titanium mobile sdk", "comment": { "comments": [ { "id": "243164", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixed in master: https://github.com/appcelerator/titanium_mobile/commit/affe0d6fe188bf7aa58e0a08319a057ba36ad226#android/modules/utils/src/java/ti/modules/titanium/utils/UtilsModule.java", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T16:03:42.000+0000", "updated": "2013-03-20T16:03:42.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }