Skip to content

Commit

Permalink
simplify verify issuance date logic
Browse files Browse the repository at this point in the history
  • Loading branch information
qiluge committed Jul 13, 2020
1 parent b3b1b05 commit 8de9d80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/ontio/ontid/OntId2.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ private boolean verifyJWTCredIssuanceDate(JWTCredential jwtCred) {
if (jwtCred.payload.iat < 0 || jwtCred.payload.nbf < 0) {
return false;
}
if (jwtCred.payload.nbf > 0 && current < jwtCred.payload.nbf) {
if (current < jwtCred.payload.nbf) {
return false;
}
return jwtCred.payload.iat == 0 || current >= jwtCred.payload.iat;
return current >= jwtCred.payload.iat;
}

public boolean verifyCredSignature(VerifiableCredential cred) throws Exception {
Expand Down

0 comments on commit 8de9d80

Please sign in to comment.