You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org> on 2006/02/13 10:52:18 UTC

[jira] Created: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Upgrade default security mechanism in client to use encrypted userid password if client can support it.
-------------------------------------------------------------------------------------------------------

         Key: DERBY-962
         URL: http://issues.apache.org/jira/browse/DERBY-962
     Project: Derby
        Type: Improvement
  Components: Network Client  
    Reporter: Sunitha Kambhampati
     Fix For: 10.2.0.0


Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 

Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  

Some thoughts:
-- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
-- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.

-- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-962?page=all ]
     
Kathey Marsden resolved DERBY-962:
----------------------------------

    Resolution: Fixed

Checked this into the trunk:

Date: Thu Mar 16 17:11:50 2006
New Revision: 386501

URL: http://svn.apache.org/viewcvs?rev=386501&view=rev


> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962.diff.txt, Derby962.stat.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Sunitha Kambhampati <ks...@gmail.com>.
Thanks Kathey for looking at this patch.

Kathey Marsden (JIRA) wrote:

>Your table is very useful and I think it should be incorporated into the test  or code comments.  Perhaps the following could be clarified. 
>  
>
I'll add the table into the test comments.  I am actually working on 
putting a page on Wiki for the security mechanism related information 
that I have been working on.

>In the code, I am unsure about the impact of adding this code to the static initializer block.    I know you had asked about it earlier and I wish I had insight to the implications but just don't.   Hopefully someone else does.
>
>  
>
I think the static init block in the ClientBaseDataSource is ok, but I 
was worried about implications of putting it in the ClientDriver static 
init block.

>Maybe it would be good to change SECMEC_HAS_NOT_EXPLICITLY_SET   to something like SECMEC_DEFAULT for clarification.  Something about the negatives in variable names always confuses me.
>  
>
This variable is used to indicate that the security mechanism has not 
been set on datasource or connection request.  I can change it to 
SECMEC_DEFAULT if that is preferred. 

Its just that SECMEC_DEFAULT seems to suggest that it is the default 
security mechanism which it isnt.  The default security mechanism for 
the client is USRIDONL (0x04)

Thanks again Kathey for reviewing this patch.
Sunitha.

[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12369929 ] 

Kathey Marsden commented on DERBY-962:
--------------------------------------

Thanks Sunitha for working on this issue and working toward a secure network client and server.
I looked at your table and the code patch diff, but did not apply it because I had trouble doing so, so this review is probably pretty rough. 

Your table is very useful and I think it should be incorporated into the test  or code comments.  Perhaps the following could be clarified. 

-  In your explanation of columns in the table you refer to the columns as a), b) etc.  It would be good to put those letters in the column headers.

- In your explanations section also list how the numeric values map to the security mechanisms for reference.
  It is further down on the page, but I noticed that after loooking them up.

- The first section of the table is for the case where  no security mechanism is specified.  It would be good to call that  out in a header as  you do before the other sections of the table.


In the code, I am unsure about the impact of adding this code to the static initializer block.    I know you had asked about it earlier and I wish I had insight to the implications but just don't.   Hopefully someone else does.

 static
+    {
+        try
+        {
+            // The EncryptionManager class will instantiate objects of the required 
+            // security algorithms that are needed for EUSRIDPWD
+            // An exception will be thrown if support is not available
+            // in the JCE implementation in the JVM in which the client
+            // is loaded.
+            new org.apache.derby.client.am.EncryptionManager(null);
+            SUPPORTS_EUSRIDPWD = true;
+        }catch(Exception e)
+        {
+            // if an exception is thrown, ignore exception.
+            // set SUPPORTS_EUSRIDPWD to false indicating that the client 
+            // does not support EUSRIDPWD security mechanism
+            SUPPORTS_EUSRIDPWD = false;
+        }
+    }


Maybe it would be good to change SECMEC_HAS_NOT_EXPLICITLY_SET   to something like SECMEC_DEFAULT for clarification.  Something about the negatives in variable names always confuses me.

Kathey




> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12366173 ] 

Sunitha Kambhampati commented on DERBY-962:
-------------------------------------------

The current behavior even if the security mechanism is explicitly set in the connection url, the upgrade is done--  should this happen.

I think we should not upgrade (override) if user has explicitly set the security mechanism. Thoughts ?

see ClientBaseDataSource# getUpgradedSecurityMechanism()  for code where the upgrade from USRIDONL to USRIDPWD is done.


> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>      Fix For: 10.2.0.0

>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-962?page=all ]

Sunitha Kambhampati updated DERBY-962:
--------------------------------------

    Attachment: d962_javadoc.2.diff.txt

Thanks Kathey.  Please look at this patch (d962_javadoc.2.diff.txt) 

I ran javadoc and  did clobber and ant all ok.  Thanks. 

> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962.diff.txt, Derby962.stat.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt, d962_javadoc.2.diff.txt, d962_javadoc.diff.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12370598 ] 

Kathey Marsden commented on DERBY-962:
--------------------------------------


I don't have any more comments on this patch. It looks good to me.  Thanks for putting the summary in the test. I think that will really help anyone  looking at this in the future.   It would be great if someone else could look at this patch too.  I will check in first thing tomorrow  if we don't get any more comments.


Thanks

Kathey





> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962.diff.txt, Derby962.stat.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Sunitha Kambhampati <ks...@gmail.com>.
Bryan Pendleton (JIRA) wrote:

>    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12366521 ] 
>
>Bryan Pendleton commented on DERBY-962:
>---------------------------------------
>
>I agree, Sunitha. If the user says something like:
>
>connect 'jdbc:derby://localhost:1527/testdb;create=true;securityMechanism=4;user=bryan;password=bryan'; 
>
>we should not quietly change the securityMechanism to 3 and quietly send the password in the clear. That's a bad default to have.
>
>  
>
Thanks Bryan for your input. 

Sunitha.

[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12366521 ] 

Bryan Pendleton commented on DERBY-962:
---------------------------------------

I agree, Sunitha. If the user says something like:

connect 'jdbc:derby://localhost:1527/testdb;create=true;securityMechanism=4;user=bryan;password=bryan'; 

we should not quietly change the securityMechanism to 3 and quietly send the password in the clear. That's a bad default to have.

The user has given us conflicting information, and we should ask them to either change the securityMechanism to one which supports a password, or remove the password.

I can see the appeal of quietly upgrading to a secure securityMechanism (one which doesn't expose the password over the wire), but in general my preference would be to give them an error saying that their request is ambiguous, rather than trying to guess what sort of alternate securityMechanism they may have wanted.


> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>      Fix For: 10.2.0.0

>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-962?page=all ]

Sunitha Kambhampati updated DERBY-962:
--------------------------------------

    Attachment: d962_javadoc.diff.txt

d962_javadoc.diff.txt  patch to fix javadoc warnings in ClientBaseDataSource.

I ran javadoc and I did a  successful build (clobber and ant all).   I'd appreciate it a committer could commit this. Thanks. 

Thanks Deepa for reporting this. 


> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962.diff.txt, Derby962.stat.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt, d962_javadoc.diff.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12370422 ] 

Kathey Marsden commented on DERBY-962:
--------------------------------------

Sunitha said:
>This variable is used to indicate that the security mechanism has not been >set on datasource or connection request.  I can change it to >SECMEC_DEFAULT if that is preferred.
>Its just that SECMEC_DEFAULT seems to suggest that it is the default >security mechanism which it isnt.  The default security mechanism for the client is USRIDONL (0x04)

I tend to think that  the default security mechanism is not USRIDONLY but in fact is  variable depending on whether password is specified and whether  the JVM can support EUSRIDPPWD, but the name as you have it is ok.  I don't feel that strongly about it.



> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-962?page=all ]

Sunitha Kambhampati updated DERBY-962:
--------------------------------------

    Attachment: Derby962_forreview.diff.txt
                Derby962_forreview.stat.txt

This patch 'Derby962.forreview.diff.txt' is a patch for review. This patch needs derby 1080 for it to work. Also there is one testfile which is common between the derby-1080 and this patch and hence it is likely this patch may not apply cleanly once derby1080 gets reviewed and committed.  I generated the diff keeping the changes of derby1080 for the test file (derbynet/testSecMec.java).

This patch 'Derby962.forreview.diff.txt' improves the upgrade security mechanism logic to do the following.

1. If securityMechanism is explicitly specified in the connection request then client will not override it.
2. Dynamically figure out if the jvm in which the client is loaded, supports encrypted userid and 
password security (EUSRIDPWD) or not and use this information to upgrade to a more secure default 
security mechanism.
3. Thus if user has not specified the security mechanism, in that case the client will try to see if 
it can upgrade the security mechanism and use the new upgraded security mechanism for connection to the server.

Logic in ClientBaseDataSource#getUpgradedSecurityMechanism()
+     * This method has logic to upgrade security mechanism to a better (more secure) one 
+     * if it is possible.   Currently derby server only has support for USRIDPWD,USRIDONL,
+     * EUSRIDPWD and this method only considers these possibilities. 
+     * USRIDPWD, EUSRIDPWD require a password, USRIDONL is the only security mechanism
+     * which does not require password.
+     * 1. if password is not available, then security mechanism possible is USRIDONL
+     * 2. if password is available, if client supports EUSRIDPWD, then EUSRIDPWD is 
+     * returned
+     * 3. if password is available, if client does not support EUSRIDPWD, then USRIDPWD
+     * is returned.

Testing:
-- Added tests with possible permutations for user, password and security mechanism on a connection request.  
see derbynet/testSecMec.java#testAllCombinationsOfUserPasswordSecMecInput()

I have attached a table to this jira entry (962_table.txt) that gives information about what security mechanism the client sends to the server on different possible inputs.  

-- Ran derbyall on linux/ibm142 ok with known failures.
-- Ran derbynet/testSecMec.java on windows with sane classes for both derbynet(JCC2.4 and JCC2.6) 
/derbynetclientmats with ibm131/ibm15/jdk131/jdk15/ibm142/jdk142.

Please note: this patch depends and requires fix for derby1080. Most likely when 1080 gets reviewed and committed, this patch may not cleanly apply. 

Can someone please review this change. Thanks.  


> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12370534 ] 

Sunitha Kambhampati commented on DERBY-962:
-------------------------------------------

With the patch Derby962.diff.txt,  derbyall run finished on linux/ibm142 with the known failures ( SurTest, NSInSameJVM).  

> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962.diff.txt, Derby962.stat.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-962?page=all ]

Sunitha Kambhampati reassigned DERBY-962:
-----------------------------------------

    Assign To: Sunitha Kambhampati

> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0

>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-962?page=all ]

Sunitha Kambhampati updated DERBY-962:
--------------------------------------

    Attachment: Derby962.diff.txt
                Derby962.stat.txt

This issue was blocked by derby-1080.  Now that 1080 is committed, I have regenerated the patch for 962 and am attaching Derby962.diff.txt and Derby962.stat.txt.    

The changes in this patch are the same as compared to the changes in Derby962_forreview.txt that were specific to derby 962,  except for the following:
-- I have added the table that was in  962_table.txt into the test code  per Kathey's comments and also added some comments from the jira to the test code. 

I ran derbynetclientmats and derbynetmats ok on linux/ibm142 with the known failures in Surtest.    I ran testSecMec on windows with JCC2.4, JCC2.6 and derbyclient on ibm and sun jvms , versions 131,141,142,15 ok. 

derbyall is still running. I will post results here as they finish. 

Can someone please review this change. Thanks. 

> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962.diff.txt, Derby962.stat.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Francois Orsini <fr...@gmail.com>.
This sounds good Sunitha.

On 2/20/06, Sunitha Kambhampati <ks...@gmail.com> wrote:
> Francois Orsini wrote:
>
> >On 2/20/06, Sunitha Kambhampati <ks...@gmail.com> wrote:
> >
> >
> >>Are you planning to submit patch to add USRSSBPWD support for 10.2 ?
> >>
> >>
> >>
> >
> >Yes absolutely.
> >
> >
> Great!  Thanks.
>
> For derby962 - I'll add upgrade default security mechanism logic to use
> encrypted userid/password. But later, when we have the USRSSBPWD support
> in derby, we can update our upgrade logic.
>
> Maybe the order (descending) eventually could be - EUSRIDPWD ,
> USRSSBPWD, USRIDPWD, USRIDONL.
> ie start with default security mechanism to be EUSRIDPWD if support is
> available and go downwards.
>
> Thanks,
> Sunitha.
>

Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Sunitha Kambhampati <ks...@gmail.com>.
Francois Orsini wrote:

>On 2/20/06, Sunitha Kambhampati <ks...@gmail.com> wrote:
>  
>
>>Are you planning to submit patch to add USRSSBPWD support for 10.2 ?
>>
>>    
>>
>
>Yes absolutely.
>
>
Great!  Thanks.

For derby962 - I'll add upgrade default security mechanism logic to use 
encrypted userid/password. But later, when we have the USRSSBPWD support 
in derby, we can update our upgrade logic.

Maybe the order (descending) eventually could be - EUSRIDPWD , 
USRSSBPWD, USRIDPWD, USRIDONL. 
ie start with default security mechanism to be EUSRIDPWD if support is 
available and go downwards.

Thanks,
Sunitha.

Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Francois Orsini <fr...@gmail.com>.
On 2/20/06, Sunitha Kambhampati <ks...@gmail.com> wrote:
> Francois Orsini wrote:
>
> >Well yes the length of the DH KA prime in the DRDA specs is 256 bits -
> >I talked to the Open Group some months ago to try and propose an
> >addendum to increase the length of the modulus and allow a 512-bit
> >(strong) prime but I was suggested to use some other and defined
> >security mechanism as part of the DRDA specs (like encrypted
> >connections ;-)), but I worked on strong password substitute
> >(USRSSBPWD) which of course is quite different than 'EUSRIDPWD' scheme
> >but at the end both do NOT send a clear password across the
> >wire...USRSSBPWD sends the userid in clear whereas EUSRIDPWD does not.
> >
> >
> >
> Hi Francois,
>
> Are you planning to submit patch to add USRSSBPWD support for 10.2 ?
>

Yes absolutely. I have been disrupted by some family issues lately -
am hoping to be able to post the changes this week or next...

--francois

> Thanks,
> Sunitha.
>

Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Sunitha Kambhampati <ks...@gmail.com>.
Francois Orsini wrote:

>Well yes the length of the DH KA prime in the DRDA specs is 256 bits -
>I talked to the Open Group some months ago to try and propose an
>addendum to increase the length of the modulus and allow a 512-bit
>(strong) prime but I was suggested to use some other and defined
>security mechanism as part of the DRDA specs (like encrypted
>connections ;-)), but I worked on strong password substitute
>(USRSSBPWD) which of course is quite different than 'EUSRIDPWD' scheme
>but at the end both do NOT send a clear password across the
>wire...USRSSBPWD sends the userid in clear whereas EUSRIDPWD does not.
>
>  
>
Hi Francois,

Are you planning to submit patch to add USRSSBPWD support for 10.2 ?

Thanks,
Sunitha.

Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Francois Orsini <fr...@gmail.com>.
Well yes the length of the DH KA prime in the DRDA specs is 256 bits -
I talked to the Open Group some months ago to try and propose an
addendum to increase the length of the modulus and allow a 512-bit
(strong) prime but I was suggested to use some other and defined
security mechanism as part of the DRDA specs (like encrypted
connections ;-)), but I worked on strong password substitute
(USRSSBPWD) which of course is quite different than 'EUSRIDPWD' scheme
but at the end both do NOT send a clear password across the
wire...USRSSBPWD sends the userid in clear whereas EUSRIDPWD does not.

I personally think a prime of 256-bit is weak (512 is really the
minimum recommended with many applications using even 1024-bit primes
during DH KA exchanges for governement applications...) for DH KA but
of course the shared-key generation operation is a costly one, hence a
prime of 512-bit would be ok.

With USRSSBPWD, the password is not sent encrypted but a strong-hashed
substitute one...If the DH KA prime imposed by DRDA would just not be
256 but allow something larger, then I believe 'EUSRIDPWD' mechanism
would be the preferred mechanism of choice - this is just my humble
opinion of course...

For information about the DRDA prime restriction of 32 bytes and the
defined value in the specs, have a look at the 'Generating the Shared
Private Key' p. 281 of DRDA, Version 3, Volume 3: Distributed Data
Management (DDM) Architecture...

Hope this helps a bit,

--francois

Anyway, Sun JCE and some early version of the IBM JCE

On 2/18/06, Bryan Pendleton <bp...@amberpoint.com> wrote:
>  > Current client  driver supports encrypted userid/password (EUSRIDPWD)
>  > via the use of DH key-agreement protocol - however current Open Group
>  > DRDA specifications imposes small prime and base generator values
>  > (256 bits) that prevents other JCE's  (apt from ibm jce) to be used
>  > as java cryptography providers.
>
> If it's not too much trouble, can you cite chapter and verse here? I find
> myself a little surprised that DRDA actually *requires* a short key
> length; I would have thought that it might default to a short length, but
> would allow longer lengths to be used if the user desired.
>
> I hunted around a bit, and here's what I saw:
>
>    EDTASECOVR, page 324 of V.3:
>
>      The ENCALG parameter indicates the encryption algorithm to use. This
>      example assumes that the default DES encryption security algorithm
>      is specified. The ENCKEYLEN parameter indicates the encryption key
>      length to use. This example assumes that the default 56-bit encryption
>      is specified.
>
>    ENCKEYLEN, page 332 of V.3:
>
>      The Encryption Key Length (ENCKEYLEN) specifies the encryption key
>      length to be used with ENCALG to encrypt and decrypt the security
>      context information. ENCKEYLEN is used by the encryption security
>      mechanisms.
>
> Please educate me; I am a rank beginner on this crypto stuff.
>
> thanks,
>
> bryan
>
>
>
>
>

Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Bryan Pendleton <bp...@amberpoint.com>.
Sunitha Kambhampati wrote:
> It is in the DDM manual, page 281 and 282..
...
> Hope this helps,

Yes, thank you very much. (And thanks to Francois, too, for
the additional perspective).

The DRDA specs can be somewhat, well, intimidating at times; it's
nice to have guides to help me through them.

thanks,

bryan



Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Sunitha Kambhampati <ks...@gmail.com>.
Bryan Pendleton wrote:

> > Current client  driver supports encrypted userid/password (EUSRIDPWD)
> > via the use of DH key-agreement protocol - however current Open Group
> > DRDA specifications imposes small prime and base generator values
> > (256 bits) that prevents other JCE's  (apt from ibm jce) to be used
> > as java cryptography providers.
>
> If it's not too much trouble, can you cite chapter and verse here? 

It is in the DDM manual, page 281 and 282..  Section: Generating the 
shared private key.
DRDA's diffie helman agreed public values for prime are 256 bits.  The 
spec gives the public values for the prime, generator and the size of 
exponent required for DH .
"These values must be used as is to generate  a shared private key."

Hope this helps,
Sunitha.


Re: [jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by Bryan Pendleton <bp...@amberpoint.com>.
 > Current client  driver supports encrypted userid/password (EUSRIDPWD)
 > via the use of DH key-agreement protocol - however current Open Group
 > DRDA specifications imposes small prime and base generator values
 > (256 bits) that prevents other JCE's  (apt from ibm jce) to be used
 > as java cryptography providers.

If it's not too much trouble, can you cite chapter and verse here? I find
myself a little surprised that DRDA actually *requires* a short key
length; I would have thought that it might default to a short length, but
would allow longer lengths to be used if the user desired.

I hunted around a bit, and here's what I saw:

   EDTASECOVR, page 324 of V.3:

     The ENCALG parameter indicates the encryption algorithm to use. This
     example assumes that the default DES encryption security algorithm
     is specified. The ENCKEYLEN parameter indicates the encryption key
     length to use. This example assumes that the default 56-bit encryption
     is specified.

   ENCKEYLEN, page 332 of V.3:

     The Encryption Key Length (ENCKEYLEN) specifies the encryption key
     length to be used with ENCALG to encrypt and decrypt the security
     context information. ENCKEYLEN is used by the encryption security
     mechanisms.

Please educate me; I am a rank beginner on this crypto stuff.

thanks,

bryan





[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12366737 ] 

Sunitha Kambhampati commented on DERBY-962:
-------------------------------------------

I just started looking at this issue on how to know if the jvm in which the client is running can support encrypted userid and password mechanism or not;  to decide if we can upgrade the default security mechanism.  

I wanted to share some thoughts I have, so I could get early feedback from the list.

Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  

-- org.apache.derby.client.am.EncryptionManager (EM) constructor is responsible for instantiating the appropriate Provider and the KeyPairGenerator.  The Sun JCE throws java.security.InvalidAlgorithmParameterException exception when trying to use the 256bits prime. 

I think we can conclude if the EM throws an exception, then the JCE doesnt support the required algorithms.
=> An exception from this constructor indicates that it is not possible to use encrypted userid/password.

The next step seems to me to decide where to put the call to new EncryptionManager(EM)
#A.Put in static initializer block in ClientBaseDataSource and store the result in a static variable.  The ClientBaseDataSource seems to be place where all the url attribute values' gets and sets methods are present. Also the upgrade logic for the security mechanism is in this class.

something like:
static boolean SUPPORTS_EUSRIDPWD = false;
static
{
    try
    {
        
        new org.apache.derby.client.am.EncryptionManager(null);
        SUPPORTS_EUSRIDPWD = true;
    }catch(Exception e)
    {
       //ignore
    }
}

---------------

#B. Another place this check could go was in the ClientDriver itself since this will be loaded  in the JVM. In the static initializer of ClientDriver, new of EM can be done to check if it will go through OK. If so, a static 'protected' variable in ClientDriver can be used to store the state that the driver supports the algorithms required for encrypted userid/password.

1. Are there any issues with adding code to the static initializer block of the Client Driver. I see the following comment in ClientDriver which sounds a little scary to me. 

static {
       // This may possibly hit the race-condition bug of java 1.1.
        // The Configuration static clause should execute before the following line does.
	 if (Configuration.exceptionsOnLoadResources != null) {
......
}

I can see that the Configuration static initializer needs to run before the access to the static variable Configuration.exceptionsOnLoadResources. 

I'm curious and would like to look at it sometime. If someone could point me to some reference of this bug, I'd be grateful. I googled but didnt find any related to the static intializer blocks. 
--------------

#C Explicitly check the jvm and decide.  Not a good way for e.g. if SunJCE supports the DH with 256 bits prime some day, we would have to remember to remove this check that disables encrypted userid/password for this particular JVM. 

I like #A because it seems clean.    What do others think ? 

Comments/Thoughts.

Thanks much,
Sunitha. 

> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>      Fix For: 10.2.0.0

>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Sunitha Kambhampati (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-962?page=all ]

Sunitha Kambhampati updated DERBY-962:
--------------------------------------

    Attachment: 962_table.txt

Table with combinations of userid/password/security mechanism and what client sends to the server. Uploading now, so I can include this link in the testcase comment..

> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-962) Upgrade default security mechanism in client to use encrypted userid password if client can support it.

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-962?page=comments#action_12370931 ] 

Kathey Marsden commented on DERBY-962:
--------------------------------------

Hi Sunitha,

Looking at your diff I understand why the first @see was taken out because it was not in a javadoc comment,
but these two were less clear to me.

It seems like it would be good instead to keep the @see but use the 
@see  #method(Type argname, Type argname,...) format for these two:

@@ -807,7 +807,7 @@
      * return the security mechanism 
      * if security mechanism has not been set explicitly on datasource
      * then upgrade the security mechanism to a more secure one if possible
-     * @see #getUpgradedSecurityMechanism()
+     * See getUpgradedSecurityMechanism()
      * @return the security mechanism
      */
     public short getSecurityMechanism() {
@@ -819,7 +819,7 @@
      * if security mechanism has not been set explicitly on datasource
      * then upgrade the security mechanism to a more secure one if possible
      * @param password  password of user
-     * @see #getUpgradedSecurityMechanism()
+     * See getUpgradedSecurityMechanism()
      * @return the security mechanism
      */
     public short getSecurityMechanism(String password) {

> Upgrade default security mechanism in client to use encrypted userid password if client can support it.
> -------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-962
>          URL: http://issues.apache.org/jira/browse/DERBY-962
>      Project: Derby
>         Type: Improvement
>   Components: Network Client
>     Reporter: Sunitha Kambhampati
>     Assignee: Sunitha Kambhampati
>      Fix For: 10.2.0.0
>  Attachments: 962_table.txt, Derby962.diff.txt, Derby962.stat.txt, Derby962_forreview.diff.txt, Derby962_forreview.stat.txt, d962_javadoc.diff.txt
>
> Currently in the client, if userid and password are set in the connection url, the default security mechanism is upgraded to USRIDPWD (which is clear text userid and password).  This seems to be a security hole here. 
> Current client  driver supports encrypted userid/password (EUSRIDPWD) via the use of DH key-agreement protocol - however current Open Group DRDA specifications imposes small prime and base generator values (256 bits) that prevents other JCE's  (apt from ibm jce) to be used as java cryptography providers.  
> Some thoughts:
> -- client can make a check to see if it the jvm it is running in supports the encryption necessary for EUSRIDPWD. If it supports, then the client can upgrade to EUSRIDPWD. 
> -- if the jvm the client is running is , doesnt support encryption requirements for EUSRIDPWD, then the security mechanism will be set to USRIDPWD.
> -- DERBY-528 will add support for strong userid and password which is another option to send encrypted passwords across the wire. When this gets added, maybe this can be considered as one of the upgrade options after EUSRIDPWD. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira