Issue Details (XML | Word | Printable)

Key: DERBY-324
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Olav Sandstaa
Reporter: Olav Sandstaa
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

AES encryption test fails on Solaris 10

Created: 30/May/05 10:55 PM   Updated: 13/May/06 09:35 PM
Return to search
Component/s: Test
Affects Version/s: 10.1.1.0
Fix Version/s: 10.1.3.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works aes_sol10.diff 2005-06-16 07:21 PM 1 kB
File Licensed for inclusion in ASF works aes_sol10.stat 2005-06-16 07:21 PM 0.1 kB
Environment: Solaris 10 (both Sparc and x86) jdk 1.4 and 1.5.

Resolution Date: 13/May/06 09:35 PM


 Description  « Hide
The store/aes.sql test on Solaris 10 produces the following diff report:

*** Start: aes jdk1.4.2_02 2005-05-30 12:13:17 ***
206 del
< ERROR XJ001: Java exception: 'Wrong keysize: must be equal to 128, 192 or 256: java.security.InvalidParameterException'.
206a206
> ERROR XJ001: Java exception: 'AES key length must be 128, 192, or 256 bits: java.security.InvalidParameterException'.
Test Failed.
*** End: aes jdk1.4.2_02 2005-05-30 12:14:06 ***

The cause of this problem is that on most OSs, the java.security.InvalidParameterException thrown by the JVM when an invalid encryption key length is requested contains a message with the following text:

  Wrong keysize: must be equal to 128, 192 or 256

while on Solaris 10 the message contained in the exception has been changed to:

  AES key length must be 128, 192, or 256 bits

The reason for this is most likely that a different encryption library is included in Solaris 10 compared
to the other OSs, either as part of the JVM or as a native library.

The problem occurs on Solaris 10 running on both x86 and Sparc processors. It occurs both with jdk 1.4 and jdk 1.5.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Myrna van Lunteren added a comment - 02/Jun/05 08:15 AM
From this description I cannot find out if this is really ok behavior or not.

If someone from Sun can pull some strings & find out it would help.

If the behavior is OK, then we are seeing a false diff, and it could be worked around by modifying the store/aes_sed.properties file.
Something like:
currently:
substitute=ERROR XJ001: Java exception: 'Keysize must;ERROR XJ001: Java exception: 'Wrong keysize: must

change it to:
substitute=ERROR XJ001: Java exception: 'Keysize must;ERROR XJ001: Java exception: 'Wrong keysize: must,ERROR XJ001: Java exception: 'AES key length must be 128, 192, or 256 bits: java.security.InvalidParameterException,ERROR XJ001: Java exception: 'Wrong keysize: must be equal to 128, 192 or 256: java.security.InvalidParameterException

Sunitha Kambhampati added a comment - 02/Jun/05 08:30 AM
The behavior is OK. I think its only error message diff needs to be sed out.
 
It would be great if someone who has access to the solaris machine/env where the diff occurred can test out by modifying the aes_sed.properties as Myrna suggested.


Olav Sandstaa added a comment - 02/Jun/05 09:38 PM
I too think this behavior is OK. The message text returned with the exception basically gives the
same explaination for why the operation failed. There is no reason for why we can expect message
strings like this be the same between platforms.

I will test out the sed filter proposed by Myrna on a few Solaris 10 machines.

Olav Sandstaa added a comment - 13/Jun/05 04:05 AM
I have tried to modify the aes_sed.properties file as suggested by Myrna. I had to trim down the size of the pattern/substitute parts to get rid of all the commas in the message strings. Unfortunately, I still have a problem with one comma. The original error message seen on most platforms contains the following sub-string:

   128, 192 or 256

while the new message string seen on Solaris 10 contains an extra comma:

   128, 192, or 256

Since neither the pattern nor the substitute part of the sed script are allowed to contain a comma, I am unable to get rid of the comma after 192. Any suggestions on how I can use the aes_sed.properties script to get rid of this or alternative ways to make the output from this test match the master file?

Olav Sandstaa added a comment - 16/Jun/05 07:22 PM
This patch fixes a problem in the AES test when running it on Solaris 10. The problem occurred due to a exception message text has been changed on Solaris 10. The problem is fixed by extending the substitute section of the aes_sed.properties file.

derbyall has been run on Solaris10 (sparc and x86) to verify that the problem is gone and on Solaris9 (sparc and x86) and Linux to verify that the change
does not influence on JVM producing the original error message text. Although some tests failed none of these seems related to this fix.

Bernt M. Johnsen added a comment - 16/Aug/05 11:17 PM
comitted

Olav Sandstaa added a comment - 19/Aug/05 05:06 PM
The AES encryption test runs without errors on Solaris 10.

Bernt M. Johnsen added a comment - 11/May/06 04:15 PM
Merge to 10.1.3

Bernt M. Johnsen added a comment - 13/May/06 09:35 PM
Committed revision 406114 on 10.1 branch