You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ka...@apache.org on 2006/02/27 14:00:07 UTC

svn commit: r381333 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/encryptionKey.out tests/store/encryptionKey.sql

Author: kahatlen
Date: Mon Feb 27 04:59:59 2006
New Revision: 381333

URL: http://svn.apache.org/viewcvs?rev=381333&view=rev
Log:
DERBY-788: 'store/encryptionKey.sql' fails on Solaris 10

Contributed by Kristian Waagan <Kr...@Sun.COM>.

'DERBY-788-1a.diff' is a patch that replaces the 16 byte key with a 8
byte key for the DES encryption algorithm used in the test
'store/encryptionKey.sql'. The test still exercises the intended parts
of the Derby code (according to my own analysis and that of
Sunitha). The patch makes the test stop failing on Solaris10 (with
security provider 'SunPCKS11-Solaris') .

One test case is changed; where it previously tested a key that was of
incorrect length (longer than 8 bytes, shorter than 16), it now tests
an incorrect key of the correct length. It is not possible to make the
test pass on Solaris10 with a key of incorrect length, because keys of
length less than 8 bytes are caught by a check in the code, and keys
longer than 8 bytes cause the underlying security provider to fail
('SunPCKS11-Solaris'). This issue will be addressed in DERBY-1001
(rewrite of test to a JUnit-test).

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptionKey.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey.sql

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptionKey.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptionKey.out?rev=381333&r1=381332&r2=381333&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptionKey.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/encryptionKey.out Mon Feb 27 04:59:59 2006
@@ -20,7 +20,7 @@
 --	   
 ------------------------------------------------------------------------------------
 -- case1:	give external encryptionKey instead of bootpassword
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 ij> create table t1(i1 int);
 0 rows inserted/updated/deleted
 ij> insert into t1 values(1);
@@ -33,7 +33,7 @@
 ij> connect 'jdbc:derby:encdbcbc_key;shutdown=true';
 ERROR 08006: Database 'encdbcbc_key' shutdown.
 ij> -- case 1.1 - right key
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 WARNING 01J01: Database 'encdbcbc_key' not created, connection made to existing database instead.
 ij(CONNECTION1)> select * from t1;
 I1         
@@ -44,17 +44,17 @@
 ij(CONNECTION1)> -- (-ve case) connect without the encryptionKey 
 --  connect with encryptionKey and keylength ( will ignore the keylength value)
 --  wrong length
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=616364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6163646566676868';
 ERROR XJ040: Failed to start database 'encdbcbc_key', see the next exception for details.
 ERROR XBCXK: The given encryption key does not match the encryption key used when creating the database. Please ensure that you are using the correct encryption key and try again. 
 ij(CONNECTION1)> -- wrong key
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=68626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6862636465666768';
 ERROR XJ040: Failed to start database 'encdbcbc_key', see the next exception for details.
 ERROR XBCXK: The given encryption key does not match the encryption key used when creating the database. Please ensure that you are using the correct encryption key and try again. 
 ij(CONNECTION1)> select * from t1;
 ERROR 08003: No current connection.
 ij(CONNECTION1)> -- correct key
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 WARNING 01J01: Database 'encdbcbc_key' not created, connection made to existing database instead.
 ij(CONNECTION2)> select * from t1;
 I1         
@@ -66,14 +66,14 @@
 ij(CONNECTION2)> connect 'jdbc:derby:encdbcbc_key;shutdown=true';
 ERROR 08006: Database 'encdbcbc_key' shutdown.
 ij(CONNECTION2)> -- connect to original db after backup
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 WARNING 01J01: Database 'encdbcbc_key' not created, connection made to existing database instead.
 ij(CONNECTION3)> select * from t1;
 I1         
 -----------
 1          
 ij(CONNECTION3)> -- case 3 :create db from backup using correct key
-connect 'jdbc:derby:encdbcbc_key2;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key2;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 ij(CONNECTION4)> select * from t1;
 I1         
 -----------
@@ -81,7 +81,7 @@
 ij(CONNECTION4)> connect 'jdbc:derby:encdbcbc_key2;shutdown=true';
 ERROR 08006: Database 'encdbcbc_key2' shutdown.
 ij(CONNECTION4)> -- create db from backup using wrong key
-connect 'jdbc:derby:encdbcbc_key3;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61226364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key3;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6122636465666768';
 ERROR XJ040: Failed to start database 'encdbcbc_key3', see the next exception for details.
 ERROR XBCXK: The given encryption key does not match the encryption key used when creating the database. Please ensure that you are using the correct encryption key and try again. 
 ij(CONNECTION4)> select * from t1;
@@ -89,14 +89,14 @@
 ij(CONNECTION4)> connect 'jdbc:derby:encdbcbc_key3;shutdown=true';
 ERROR XJ004: Database 'encdbcbc_key3' not found.
 ij(CONNECTION4)> -- create db from backup using correct key
-connect 'jdbc:derby:encdbcbc_12;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_12;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 ij(CONNECTION5)> select * from t1;
 I1         
 -----------
 1          
 ij(CONNECTION5)> connect 'jdbc:derby:encdbcbc_key12;shutdown=true';
 ERROR XJ004: Database 'encdbcbc_key12' not found.
-ij(CONNECTION5)> connect 'jdbc:derby:encdb;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+ij(CONNECTION5)> connect 'jdbc:derby:encdb;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 ij(CONNECTION6)> create table t1(i1 int ,c2 char(20));
 0 rows inserted/updated/deleted
 ij(CONNECTION6)> insert into t1 values(1,'a');
@@ -110,7 +110,7 @@
 ij(CONNECTION6)> connect 'jdbc:derby:encdb;shutdown=true';
 ERROR 08006: Database 'encdb' shutdown.
 ij(CONNECTION6)> disconnect;
-ij> connect 'jdbc:derby:encdb;restoreFrom=extinout/mybackup2/encdb;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+ij> connect 'jdbc:derby:encdb;restoreFrom=extinout/mybackup2/encdb;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 ij(CONNECTION6)> select * from t1;
 I1         |C2                  
 --------------------------------
@@ -123,7 +123,7 @@
 ERROR XBM01: Startup failed due to an exception. See next exception for details. 
 ERROR XBCXM: The length of the external encryption key must be an even number.
 ij> -- key contains illegal character(s)
-connect 'jdbc:derby:encddbdb_invkey;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=616263646566676869616263646565XY';
+connect 'jdbc:derby:encddbdb_invkey;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667XY';
 ERROR XJ041: Failed to create database 'encddbdb_invkey', see the next exception for details.
 ERROR XBM01: Startup failed due to an exception. See next exception for details. 
 ERROR XBCXN: The external encryption key contains one or more illegal characters. Allowed characters for a hexadecimal number are 0-9, a-f and A-F.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey.sql
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey.sql?rev=381333&r1=381332&r2=381333&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey.sql (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey.sql Mon Feb 27 04:59:59 2006
@@ -20,7 +20,7 @@
 --	   
 ------------------------------------------------------------------------------------
 -- case1:	give external encryptionKey instead of bootpassword
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 
 create table t1(i1 int);
 insert into t1 values(1);
@@ -30,7 +30,7 @@
 
 -- case 1.1 - right key
 
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 select * from t1;
 
 connect 'jdbc:derby:encdbcbc_key;shutdown=true';
@@ -38,13 +38,13 @@
 --  connect with encryptionKey and keylength ( will ignore the keylength value)
 
 --  wrong length
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=616364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6163646566676868';
 -- wrong key
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=68626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6862636465666768';
 select * from t1;
 
 -- correct key
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 select * from t1;
 
 -- case 2 backup
@@ -53,27 +53,27 @@
 
 -- connect to original db after backup
 
-connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 select * from t1;
 
 -- case 3 :create db from backup using correct key
-connect 'jdbc:derby:encdbcbc_key2;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key2;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 select * from t1;
 connect 'jdbc:derby:encdbcbc_key2;shutdown=true';
 
 -- create db from backup using wrong key
-connect 'jdbc:derby:encdbcbc_key3;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61226364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_key3;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6122636465666768';
 select * from t1;
 
 connect 'jdbc:derby:encdbcbc_key3;shutdown=true';
 
 -- create db from backup using correct key
-connect 'jdbc:derby:encdbcbc_12;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdbcbc_12;createFrom=extinout/bkup1/encdbcbc_key;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 select * from t1;
 
 connect 'jdbc:derby:encdbcbc_key12;shutdown=true';
 
-connect 'jdbc:derby:encdb;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdb;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 create table t1(i1 int ,c2 char(20));
 insert into t1 values(1,'a');
 select * from t1;
@@ -83,7 +83,7 @@
 connect 'jdbc:derby:encdb;shutdown=true';
 disconnect;
 
-connect 'jdbc:derby:encdb;restoreFrom=extinout/mybackup2/encdb;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667686961626364656568';
+connect 'jdbc:derby:encdb;restoreFrom=extinout/mybackup2/encdb;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=6162636465666768';
 select * from t1;
 disconnect;
 
@@ -92,5 +92,5 @@
 connect 'jdbc:derby:encddbdb_invkey;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=123456789';
 
 -- key contains illegal character(s)
-connect 'jdbc:derby:encddbdb_invkey;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=616263646566676869616263646565XY';
+connect 'jdbc:derby:encddbdb_invkey;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=61626364656667XY';