mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 12:25:42 +08:00
Implement plain password authentication partway. Tested, but no user
functionality yet.
This commit is contained in:
@@ -95,6 +95,16 @@ namespace OpenSim.Services.AuthenticationService
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
public bool Verify(UUID principalID, string token, int lifetime)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool VerifyEncrypted(byte[] cyphertext, byte[] key)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool Release(UUID principalID, string token)
|
||||
{
|
||||
return false;
|
||||
@@ -104,5 +114,10 @@ namespace OpenSim.Services.AuthenticationService
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected string GetToken(UUID principalID, int lifetime)
|
||||
{
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,24 @@ namespace OpenSim.Services.AuthenticationService
|
||||
{
|
||||
}
|
||||
|
||||
public string Authenticate(UUID principalID, string password)
|
||||
public string Authenticate(UUID principalID, string password, int lifetime)
|
||||
{
|
||||
AuthenticationData data = m_Database.Get(principalID);
|
||||
|
||||
if (!data.Data.ContainsKey("passwordHash") ||
|
||||
!data.Data.ContainsKey("passwordSalt"))
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
string hashed = Util.Md5Hash(Util.Md5Hash(password) + ":" +
|
||||
data.Data["passwordSalt"].ToString());
|
||||
|
||||
if (data.Data["passwordHash"].ToString() == hashed)
|
||||
{
|
||||
return GetToken(principalID, lifetime);
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
@@ -65,15 +81,5 @@ namespace OpenSim.Services.AuthenticationService
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
public bool Verify(UUID principalID, string token)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool VerifyEncrypted(byte[] cyphertext, byte[] key)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenSim.Services.AuthenticationService
|
||||
{
|
||||
}
|
||||
|
||||
public string Authenticate(UUID principalID, string password)
|
||||
public string Authenticate(UUID principalID, string password, int lifetime)
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
@@ -61,15 +61,5 @@ namespace OpenSim.Services.AuthenticationService
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
public bool Verify(UUID principalID, string token)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool VerifyEncrypted(byte[] cyphertext, byte[] key)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenSim.Services.Interfaces
|
||||
// the public key of the peer, which the connector must have
|
||||
// obtained using a remote GetPublicKey call.
|
||||
//
|
||||
string Authenticate(UUID principalID, string password);
|
||||
string Authenticate(UUID principalID, string password, int lifetime);
|
||||
byte[] AuthenticateEncrypted(byte[] cyphertext, byte[] key);
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
@@ -85,7 +85,7 @@ namespace OpenSim.Services.Interfaces
|
||||
// must be used to refresh. Unencrypted verification is still
|
||||
// performed, but doesn't refresh token lifetime.
|
||||
//
|
||||
bool Verify(UUID principalID, string token);
|
||||
bool Verify(UUID principalID, string token, int lifetime);
|
||||
bool VerifyEncrypted(byte[] cyphertext, byte[] key);
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user