Updates to NTLM authentication component/provider to line up with new password encryptor code.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2762 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-05-04 15:37:18 +00:00
parent a937dfa608
commit 05cd2c05b9
3 changed files with 38 additions and 14 deletions

View File

@@ -19,6 +19,7 @@ package org.alfresco.repo.security.authentication.ntlm;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.Security;
@@ -599,7 +600,7 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
String username = (String) ntlmToken.getPrincipal();
String plainPwd = (String) ntlmToken.getCredentials();
byte[] ntlm1Pwd = m_encryptor.generateEncryptedPassword( plainPwd, authSess.getEncryptionKey(), PasswordEncryptor.NTLM1);
byte[] ntlm1Pwd = m_encryptor.generateEncryptedPassword( plainPwd, authSess.getEncryptionKey(), PasswordEncryptor.NTLM1, null, null);
// Send the logon request to the authentication server
//
@@ -684,6 +685,12 @@ public class NTLMAuthenticationComponentImpl extends AbstractAuthenticationCompo
throw new AuthenticationServiceException("JCE provider error", ex);
}
catch (InvalidKeyException ex)
{
// Problem creating key during encryption
throw new AuthenticationServiceException("Invalid key error", ex);
}
catch (IOException ex)
{
// Error connecting to the authentication server

View File

@@ -19,6 +19,7 @@ package org.alfresco.repo.security.authentication.ntlm;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.Security;
@@ -519,7 +520,7 @@ public class NTLMAuthenticationProvider implements AuthenticationProvider
String username = (String) ntlmToken.getPrincipal();
String plainPwd = (String) ntlmToken.getCredentials();
byte[] ntlm1Pwd = m_encryptor.generateEncryptedPassword( plainPwd, authSess.getEncryptionKey(), PasswordEncryptor.NTLM1);
byte[] ntlm1Pwd = m_encryptor.generateEncryptedPassword( plainPwd, authSess.getEncryptionKey(), PasswordEncryptor.NTLM1, null, null);
// Send the logon request to the authentication server
//
@@ -560,6 +561,12 @@ public class NTLMAuthenticationProvider implements AuthenticationProvider
throw new AuthenticationServiceException("JCE provider error", ex);
}
catch (InvalidKeyException ex)
{
// Problem creating key during encryption
throw new AuthenticationServiceException("Invalid key error", ex);
}
catch (IOException ex)
{
// Error connecting to the authentication server