diff --git a/include/jwt/base64.hpp b/include/jwt/base64.hpp index 2f2a646..fcf99d6 100644 --- a/include/jwt/base64.hpp +++ b/include/jwt/base64.hpp @@ -94,7 +94,7 @@ std::string base64_encode(const char* in, size_t len) int i = 0; int j = 0; - for (; i < len - 2; i += 3) { + for (; i < static_cast(len) - 2; i += 3) { const auto first = in[i]; const auto second = in[i+1]; const auto third = in[i+2]; diff --git a/include/jwt/impl/algorithm.ipp b/include/jwt/impl/algorithm.ipp index c9fe51a..55d6591 100644 --- a/include/jwt/impl/algorithm.ipp +++ b/include/jwt/impl/algorithm.ipp @@ -306,9 +306,9 @@ std::string PEMSign::public_key_ser( ECDSA_SIG_get0(ec_sig.get(), &ec_sig_r, &ec_sig_s); - auto r_len = BN_num_bytes(ec_sig_r); - auto s_len = BN_num_bytes(ec_sig_s); - auto bn_len = (degree + 7) / 8; + int r_len = BN_num_bytes(ec_sig_r); + int s_len = BN_num_bytes(ec_sig_s); + int bn_len = static_cast((degree + 7) / 8); if ((r_len > bn_len) || (s_len > bn_len)) { ec = AlgorithmErrc::SigningErr;