Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-jams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-jams
Commits
bc326721
Commit
bc326721
authored
4 years ago
by
Felix Sidokhine
Browse files
Options
Downloads
Patches
Plain Diff
added a timeout and a failure option on device revocation
parent
f8bdbdba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jams-server/src/main/java/net/jami/jams/server/core/workflows/RevokeDeviceFlow.java
+10
-5
10 additions, 5 deletions
...net/jami/jams/server/core/workflows/RevokeDeviceFlow.java
with
10 additions
and
5 deletions
jams-server/src/main/java/net/jami/jams/server/core/workflows/RevokeDeviceFlow.java
+
10
−
5
View file @
bc326721
...
...
@@ -20,7 +20,6 @@ public class RevokeDeviceFlow {
public
static
DeviceRevocationResponse
revokeDevice
(
String
username
,
RevocationRequest
request
){
DeviceRevocationResponse
response
=
new
DeviceRevocationResponse
();
try
{
StatementList
statementList
=
new
StatementList
();
StatementElement
st1
=
new
StatementElement
(
"owner"
,
"="
,
username
,
"AND"
);
StatementElement
st2
=
new
StatementElement
(
"deviceId"
,
"="
,
request
.
getIdentifier
().
toString
(),
""
);
...
...
@@ -31,13 +30,19 @@ public class RevokeDeviceFlow {
log
.
error
(
"Could not find device!"
);
return
null
;
}
certificateAuthority
.
revokeCertificate
(
request
);
if
(
certificateAuthority
.
getLatestCRL
().
get
().
getRevokedCertificates
().
toArray
().
length
!=
0
)
{
response
.
setSuccess
(
true
);
long
statTime
=
System
.
currentTimeMillis
();
while
(
certificateAuthority
.
getLatestCRL
().
get
()
.
getRevokedCertificate
(
device
.
getCertificate
().
getSerialNumber
())
==
null
){
log
.
warn
(
"Certificate has not yet appeared in CRL!"
);
if
(
System
.
currentTimeMillis
()
-
statTime
>
1000
){
log
.
error
(
"The certificate has not appered within 1 second, we are considering the operation has failed"
);
response
.
setSuccess
(
false
);
return
response
;
}
}
//Finally we return the successful response
response
.
setSuccess
(
true
);
return
response
;
}
catch
(
Exception
e
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment