Closed Bug 434101 Opened 16 years ago Closed 15 years ago

AES Decryption doesn't work with Java Liveconnect

Categories

(Core Graveyard :: Java: Live Connect, defect)

1.9.0 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: ben, Unassigned)

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5

In Firefox 3 b5 on Windows, AES decryption (specifically, doFinal of javax.crypto.Cipher) doesn't return the correct result.  It isn't my Java environment because the code runs properly on Firefox 2.

Reproducible: Always

Steps to Reproduce:
1.Navigate to testliveconnect.html (see attached)
Actual Results:  
[0,1,2,3]
[1,1,1,1]
Does encryption work? false

Expected Results:  
[0,1,2,3]
[0,1,2,3]
Does encryption work? true

Java: (build 1.6.0_05-b13)
Attached file Test for the issue
Fixed a small problem where the failed text was already there before the test is run.
Attachment #321332 - Attachment is obsolete: true
Component: General → Java: Live Connect
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → live-connect
Hardware: PC → All
It's been a while since this bug has been touched.  Has any one else been able to confirm this bug?
Confirmed with Java 1.5.0 on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008052912 Firefox/3.0. The attached testcase works on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/2008040414 Firefox/2.0.0.14.
(In reply to comment #4)
> Confirmed with Java 1.5.0 on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9)
> Gecko/2008052912 Firefox/3.0. The attached testcase works on Mozilla/5.0 (X11;
> U; Linux i686; en-US; rv:1.8.1.14) Gecko/2008040414 Firefox/2.0.0.14.
> 

So, the bug is confirmed on windows in Fx3, and doesn't occur on Linux in Fx2?  Correct?  Do you plan in testing on Linux in Fx3?
On Mac, I get this (the "result" that is not the "expected results"):

[0,1,2,3]
[1,1,1,1]
Does encryption work? false

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061004 Firefox/3.0

So, I'm hoping that it occurs in Linux too so I can mark it for all platforms instead of just Windows.  Of course, I'm using an Intel mac, so no idea what happens on PPC.
[00:33:29] <@gavin> Tom: logan confirmed the bug exists on linux fx3
[00:33:37] <@gavin> and confirmed that it doesn't exist on linux fx2

Confirming
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → 1.9.0 Branch
Use Java reflection to create and populate a byte array instead of relying on Java Liveconnect.  Fix tested on Mac OS X and Windows.
This was an attempt to show that Java Liveconnect's array conversion returns an array with all 1's when converting JS arrays to Java byte arrays.  I did show that, but I also found another regression: FF3's LiveConnect can't construct strings from byte arrays.

In Firefox 2 (expected results):
[64,65,66,67]
[64,65,66,67]

In Firefox 3:
TypeError: invalid new expression result \x01\x01\x01\x01
TypeError: invalid new expression result @ABC
Something I didn't mention above: this bug is indicative of a bigger problem.  Java Liveconnect no longer properly converts Javascript arrays into Java arrays (at least for bytes).  Java Liveconnect always returns arrays full of 1's.

There is another bug describing this problem: https://bugzilla.mozilla.org/show_bug.cgi?id=434658.
(In reply to comment #11)
> Something I didn't mention above: this bug is indicative of a bigger problem. 
> Java Liveconnect no longer properly converts Javascript arrays into Java arrays
> (at least for bytes).  Java Liveconnect always returns arrays full of 1's.
> 
> There is another bug describing this problem:
> https://bugzilla.mozilla.org/show_bug.cgi?id=434658.
> 

Yes, but bug 434658 was posted 3 days after this one.  What gavin is asking in comment 8 is if you know when it started.  An easy way to do this is try actual beta versions, they're archived on the FTP.  You can find beta 1 here:
ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0b1/
and later versions by going to the main releases directory and trying other betas or release candidates.
Since bug 434658 has been resolved as works-for-me and the attached test is now in fact working for me, resolving as WORKSFORME.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: