Author: david.lloyd(a)jboss.com
Date: 2010-03-23 22:31:56 -0400 (Tue, 23 Mar 2010)
New Revision: 5834
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/ServerInitialAuthenticationHandler.java
Log:
JBREM-1213: send an auth reject if the SASL server fails to create
Modified:
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/ServerInitialAuthenticationHandler.java
===================================================================
---
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/ServerInitialAuthenticationHandler.java 2010-03-18
03:22:46 UTC (rev 5833)
+++
remoting3/trunk/jboss-remoting/src/main/java/org/jboss/remoting3/remote/ServerInitialAuthenticationHandler.java 2010-03-24
02:31:56 UTC (rev 5834)
@@ -66,7 +66,14 @@
if (serverFactory != null) {
log.trace("Selected SASL mechanism %s", name);
final String realm =
connectionProviderContext.getEndpoint().getName();
- final SaslServer server = serverFactory.createSaslServer(name,
"remote", realm, saslPropertyMap, authenticationProvider.getCallbackHandler());
+ final SaslServer server;
+ try {
+ server = serverFactory.createSaslServer(name,
"remote", realm, saslPropertyMap, authenticationProvider.getCallbackHandler());
+ } catch (IOException e) {
+ log.warn("Failed to create SASL server for mechanism
\"%s\": %s", name, e);
+ rejectAuth();
+ return;
+ }
remoteConnection.setMessageHandler(new
ServerAuthenticationHandler(remoteConnection, server, connectionProviderContext, this));
log.trace("Sending initial challenge");
final byte[] resp;