1 |
|
package issrg.pba.rbac; |
2 |
|
|
3 |
|
import issrg.pba.ParsedToken; |
4 |
|
import issrg.utils.ACNotFoundException; |
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
@author |
10 |
|
|
|
|
| 0% |
Uncovered Elements: 27 (27) |
Complexity: 7 |
Complexity Density: 0.56 |
|
11 |
|
public class DefaultRevocationChecker implements RevocationChecker { |
12 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 4 |
Complexity Density: 0.44 |
|
13 |
0
|
public boolean isRevoked(ParsedToken token) throws ACNotFoundException { ... |
14 |
0
|
if(token instanceof Revocable){ |
15 |
|
|
16 |
|
|
17 |
0
|
try{ |
18 |
0
|
byte[] webdavAC = issrg.utils.WebdavUtil.getRawAC(((Revocable)token).getValidationURL()); |
19 |
0
|
return compareACs(((Revocable)token).getOriginalAC(),webdavAC); |
20 |
|
}catch(ACNotFoundException valNotFound){ |
21 |
0
|
try{ |
22 |
0
|
byte[] revokedAC = issrg.utils.WebdavUtil.getRawAC(((Revocable)token).getValidationURL()); |
23 |
0
|
return compareACs(((Revocable)token).getOriginalAC(),revokedAC); |
24 |
|
}catch(ACNotFoundException revNotFound){ |
25 |
|
|
26 |
|
|
27 |
0
|
throw new ACNotFoundException("Neither validation or revocation attribute certificate were found"); |
28 |
|
} |
29 |
|
} |
30 |
|
} |
31 |
0
|
return true; |
32 |
|
} |
33 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.67 |
|
34 |
0
|
private boolean compareACs(byte[] originalAC,byte[] newAC){... |
35 |
|
|
36 |
0
|
if(originalAC.length!=newAC.length) return false; |
37 |
0
|
for(int i=0;i<originalAC.length;i++){ |
38 |
0
|
if(originalAC[i]!=newAC[i]) return false; |
39 |
|
} |
40 |
0
|
return true; |
41 |
|
} |
42 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
43 |
0
|
public boolean isRevoked(Object token) throws RevocationNotDecisiveException {... |
44 |
|
|
45 |
0
|
return false; |
46 |
|
} |
47 |
|
|
48 |
|
} |