From d8a98b5fdb4a5b933a2b3dd5ca5cddc9f22c43dc Mon Sep 17 00:00:00 2001 From: StiviiK Date: Sat, 27 Jul 2019 10:49:02 +0200 Subject: [PATCH] Addendum to last commit --- module/CFunctions.cpp | 2 +- module/Utils.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/CFunctions.cpp b/module/CFunctions.cpp index b0d928e..29ba48c 100644 --- a/module/CFunctions.cpp +++ b/module/CFunctions.cpp @@ -28,7 +28,7 @@ int CFunctions::sign_jwt_token(lua_State* lua_vm) const auto func_ref = luaL_ref(lua_vm, LUA_REGISTRYINDEX); // Read other arguments - const auto claims = Utils::parse_named_table(lua_vm, 2); + const auto claims = Utils::parse_table(lua_vm, 2); const auto algorithm = jwt_algorithm(reinterpret_cast(lua_touserdata(lua_vm, 3))); const auto private_key_path = lua_tostring(lua_vm, 4); std::string private_key = private_key_path; diff --git a/module/Utils.h b/module/Utils.h index 4f27662..f07b19d 100644 --- a/module/Utils.h +++ b/module/Utils.h @@ -16,7 +16,7 @@ static const int index_key = -2; enum jwt_algorithm : size_t { - jwt_algorithm_none = 0x12345678ABCDEF, + jwt_algorithm_none = 0x123456789ABCDEF, jwt_algorithm_hs256 = jwt_algorithm_none << 1, jwt_algorithm_hs384 = jwt_algorithm_none << 2, jwt_algorithm_hs512 = jwt_algorithm_none << 3, @@ -28,7 +28,7 @@ enum jwt_algorithm : size_t class Utils { public: - static inline std::unordered_map parse_named_table(lua_State* lua_vm, const int index) + static inline std::unordered_map parse_table(lua_State* lua_vm, const int index) { unordered_map result;