Skip to content

Commit

Permalink
if expiration<0, return false
Browse files Browse the repository at this point in the history
  • Loading branch information
qiluge committed Jul 13, 2020
1 parent 357daa3 commit b3b1b05
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,10 @@ public boolean verifyCredNotExpired(String cred) throws Exception {
JSONObject payloadObj = JSON.parseObject(new String(payloadBytes));
long currentTime = System.currentTimeMillis() / 1000;
long expiration = payloadObj.getLong("exp");
return expiration <= 0 || expiration >= currentTime;
if (expiration < 0) {
return false;
}
return expiration == 0 || expiration >= currentTime;
}

public boolean verifyCredIssuanceDate(String cred) throws Exception {
Expand Down

0 comments on commit b3b1b05

Please sign in to comment.