mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-14 16:58:34 +00:00
Merge pull request #17 from TheQuantumPhysicist/master
Fix more signed/unsigned warnings.
This commit is contained in:
commit
549235f009
2 changed files with 3 additions and 3 deletions
|
@ -414,7 +414,7 @@ std::error_code jwt_object::verify(
|
|||
auto p_exp = payload()
|
||||
.get_claim_value<uint64_t>(registered_claims::expiration);
|
||||
|
||||
if (curr_time > (p_exp + dparams.leeway)) {
|
||||
if (static_cast<uint64_t>(curr_time) > static_cast<uint64_t>(p_exp + dparams.leeway)) {
|
||||
ec = VerificationErrc::TokenExpired;
|
||||
return ec;
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ std::error_code jwt_object::verify(
|
|||
auto p_exp = payload()
|
||||
.get_claim_value<uint64_t>(registered_claims::not_before);
|
||||
|
||||
if ((p_exp - dparams.leeway) > curr_time) {
|
||||
if (static_cast<uint64_t>(p_exp - dparams.leeway) > static_cast<uint64_t>(curr_time)) {
|
||||
ec = VerificationErrc::ImmatureSignature;
|
||||
return ec;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ TEST (DecodeTest, DecodeNoneAlgSign)
|
|||
EXPECT_TRUE (obj.has_claim("aud"));
|
||||
EXPECT_TRUE (obj.has_claim("exp"));
|
||||
|
||||
EXPECT_EQ (obj.payload().get_claim_value<uint64_t>("exp"), 1513863371);
|
||||
EXPECT_EQ (obj.payload().get_claim_value<uint64_t>("exp"), static_cast<uint64_t>(1513863371));
|
||||
}
|
||||
|
||||
TEST (DecodeTest, DecodeWrongAlgo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue