[9] RFR: 8138990: Implementation of HTTP Digest authentication may be more flexible

2015-12-04 Thread Artem Smotrakov

Hello,

Please review this small fix for DigestAuthentication class.

1. Added a check in DigestAuthentication.setNonce(String) that nonce is 
not null. NPE may happen if a buggy HTTP server returns 
"WWW-Authenticate" header which doesn't contain a "nonce" field. 
According to RFCs 2069 [1] and 2617 [2], this is not expected behaviour, 
but it would be better if an HTTP client threw a checked IOException 
instead of NPE.


2. Updated DigestAuthentication.setQop(String) method to accept both a 
whitespace and a comma as a delimiter. RFC 2617 [2] says that "qop" may 
contain more than one token, but it doesn't specify a delimiter for 
"qop" field in "WWW-Authenticate" header. There is an example of 
"WWW-Authenticate" header in RFC 2617 [2] where a comma is used as a 
delimiter of value in "qop" field.


3. Added a test for Digest authentication.

Bug: https://bugs.openjdk.java.net/browse/JDK-8138990
Webrev: http://cr.openjdk.java.net/~asmotrak/http_auth_digest/webrev.00/

[1] https://tools.ietf.org/html/rfc2069
[2] https://tools.ietf.org/html/rfc2617

Artem


Re: RFR [9] 8143554: UnsupportedOperationException is not thrown for unsupported options

2015-12-04 Thread Svetlana Nikandrova

Hi Artem,

thank you for your comments. You are right in both cases. I changed to 
"else if" and removed IAE exception from main().


Please see updated review:

http://cr.openjdk.java.net/~kshefov/8143554/webrev.01/ 



Thank you,
Svetlana

On 03.12.2015 17:02, Artem Smotrakov wrote:

Hi Svetlana,

I'll leave the mail review to official reviewers, a couple of minor 
comments about your test.


It seems to work fine, but you may want to use "else if" in 
UnsupportedOptionsTest.getOption() method because "Unsupported socket 
type" error can occure in case of supported socket type.


Not sure that IllegalAccessException can be thrown in main() method.

Artem

On 12/03/2015 04:06 PM, Svetlana Nikandrova wrote:

Hello,

please review a simple fix for:
https://bugs.openjdk.java.net/browse/JDK-8143554

See webrev here:
http://cr.openjdk.java.net/~kshefov/8143554/webrev.00/ 



Fix added explicit check for option support to getOption and 
setOption sockets' methods similar way as it was done prior jdk 9 in 
Sockets class.
Fix also exposed another problem with sockets' supported options: 
JDK-8143923  that 
cause new test failure test/java/net/SocketOption/OptionsTest.java. I 
added test to the ProblemList.


Thank you,
Svetlana