Commit 4bd82c0b authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1092: SaslServer props argument can be null.

The method signature defines that the 'props' argument is allowed to be null. Our
implementation should not throw a nullpointerexception.
parent 65218634
...@@ -132,7 +132,9 @@ public class SaslServerFactoryImpl implements SaslServerFactory ...@@ -132,7 +132,9 @@ public class SaslServerFactoryImpl implements SaslServerFactory
for ( final Mechanism mechanism : allMechanisms ) for ( final Mechanism mechanism : allMechanisms )
{ {
if ( mechanism.allowsAnonymous && props.containsKey( Sasl.POLICY_NOANONYMOUS ) && Boolean.parseBoolean( (String) props.get( Sasl.POLICY_NOANONYMOUS ) ) ) if ( props != null )
{
if ( mechanism.allowsAnonymous && props.containsKey( Sasl.POLICY_NOANONYMOUS ) && (Boolean) props.get( Sasl.POLICY_NOANONYMOUS ) )
{ {
// Do not include a mechanism that allows anonymous authentication when the 'no anonymous' policy is set. // Do not include a mechanism that allows anonymous authentication when the 'no anonymous' policy is set.
continue; continue;
...@@ -143,6 +145,7 @@ public class SaslServerFactoryImpl implements SaslServerFactory ...@@ -143,6 +145,7 @@ public class SaslServerFactoryImpl implements SaslServerFactory
// Do not include a mechanism that is susceptible to simple plain passive attacks when the 'no plaintext' policy is set. // Do not include a mechanism that is susceptible to simple plain passive attacks when the 'no plaintext' policy is set.
continue; continue;
} }
}
// Mechanism passed all filters. It should be part of the result. // Mechanism passed all filters. It should be part of the result.
result.add( mechanism.name ); result.add( mechanism.name );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment