Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
fa0e4bb2
Commit
fa0e4bb2
authored
Dec 04, 2015
by
Dave Cridland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-631 Add logging to trace fault
parent
09a11a0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
ScramSha1SaslServer.java
...a/org/jivesoftware/openfire/sasl/ScramSha1SaslServer.java
+5
-1
No files found.
src/java/org/jivesoftware/openfire/sasl/ScramSha1SaslServer.java
View file @
fa0e4bb2
...
...
@@ -40,6 +40,8 @@ import org.jivesoftware.openfire.auth.InternalUnauthenticatedException;
import
org.jivesoftware.openfire.auth.ScramUtils
;
import
org.jivesoftware.openfire.user.UserManager
;
import
org.jivesoftware.openfire.user.UserNotFoundException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* Implements the SCRAM-SHA-1 server-side mechanism.
...
...
@@ -47,7 +49,7 @@ import org.jivesoftware.openfire.user.UserNotFoundException;
* @author Richard Midwinter
*/
public
class
ScramSha1SaslServer
implements
SaslServer
{
private
static
final
Logger
Log
=
LoggerFactory
.
getLogger
(
ScramSha1SaslServer
.
class
);
private
static
final
Pattern
CLIENT_FIRST_MESSAGE
=
Pattern
.
compile
(
"^(([pny])=?([^,]*),([^,]*),)(m?=?[^,]*,?n=([^,]*),r=([^,]*),?.*)$"
),
CLIENT_FINAL_MESSAGE
=
Pattern
.
compile
(
"(c=([^,]*),r=([^,]*)),p=(.*)$"
);
...
...
@@ -320,6 +322,7 @@ public class ScramSha1SaslServer implements SaslServer {
String
saltshaker
=
UserManager
.
getUserProvider
().
loadUser
(
username
).
getSalt
();
byte
[]
salt
;
if
(
saltshaker
==
null
)
{
Log
.
debug
(
"No salt found, so resetting password."
);
String
password
=
AuthFactory
.
getPassword
(
username
);
AuthFactory
.
setPassword
(
username
,
password
);
salt
=
DatatypeConverter
.
parseBase64Binary
(
UserManager
.
getUserProvider
().
loadUser
(
username
).
getSalt
());
...
...
@@ -328,6 +331,7 @@ public class ScramSha1SaslServer implements SaslServer {
}
return
salt
;
}
catch
(
UserNotFoundException
|
UnsupportedOperationException
|
ConnectionException
|
InternalUnauthenticatedException
e
)
{
Log
.
warn
(
"Exception in SCRAM.getSalt():"
,
e
);
byte
[]
salt
=
new
byte
[
32
];
random
.
nextBytes
(
salt
);
return
salt
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment