bbonkr / crypto-js

Automatically exported from code.google.com/p/crypto-js
0 stars 0 forks source link

Crypto-JS v2.5.3 is reacting differently on Embed devices (Samsung Smart TV (sdk 2.XX)) and Desktop/Web #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

Crypto-JS v2.5.3 is reacting differently on Embed devices (Samsung Smart TV 
(sdk 2.XX)) and Desktop/Web

Its reacting differently on Desktop browse and Samsung Smart TV app (basically 
a html that is running on TV internal browse, i am not sure about the detail of 
the browse).

secret = Crypto.HMAC(Crypto.SHA256, str, key, { asBytes: true });
result = Crypto.util.bytesToBase64(secret);
alert(result); // Different results on Desktop and embed device.

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by miteshis...@gmail.com on 30 Mar 2012 at 12:25

GoogleCodeExporter commented 9 years ago
I'll try to discover what I can, but it's hard to test without a smart TV 
available.

Original comment by Jeff.Mott.OR on 30 Mar 2012 at 1:05

GoogleCodeExporter commented 9 years ago
Okey, it seems to be working fine if I remove the check

if(typeof btoa=="function")
        return btoa(g.bytesToString(b));

from bytesToBase64() in crypto-sha256-hmac.js.

Original comment by miteshis...@gmail.com on 30 Mar 2012 at 1:17

GoogleCodeExporter commented 9 years ago
I assume, it's a check if you have this uility/function available in the 
browser you used it directly.
However, this check make your inscription browser dependent...

Original comment by miteshis...@gmail.com on 31 Mar 2012 at 7:40

GoogleCodeExporter commented 9 years ago
Indeed. I'll remove the check and use of btoa.

Original comment by Jeff.Mott.OR on 31 Mar 2012 at 7:52

GoogleCodeExporter commented 9 years ago
As I said earlier, I don't have a smart TV for testing, but I removed the use 
of "btoa" in r497 and released in v2.5.4. Presumably this will resolve the 
issue.

Original comment by Jeff.Mott.OR on 30 May 2012 at 2:14