From 0b4597444caa345b2a6cf9c3adbd849b5e893c7b Mon Sep 17 00:00:00 2001 From: Bartosz Wieczorek Date: Wed, 4 Jun 2025 14:11:36 +0200 Subject: [PATCH] fix subscribe message reqression --- PAM/ssh/bin/rublon_application.cpp | 3 +-- PAM/ssh/include/rublon/core_handler.hpp | 3 +-- PAM/ssh/include/rublon/websockets.hpp | 2 +- PAM/ssh/lib/pam.cpp | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/PAM/ssh/bin/rublon_application.cpp b/PAM/ssh/bin/rublon_application.cpp index 882f80f..4279918 100644 --- a/PAM/ssh/bin/rublon_application.cpp +++ b/PAM/ssh/bin/rublon_application.cpp @@ -79,8 +79,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] const char ** argv) { { CheckApplication ca; - auto ret = - ca.call(CH, {session.config().systemToken.data(), session.config().systemToken.size()}).or_else(mapError); + auto ret = ca.call(CH, session.config().systemToken).or_else(mapError); if(not ret.has_value()) { log(LogLevel::Error, "Check Application step failed, check configration"); return PAM_MAXTRIES; diff --git a/PAM/ssh/include/rublon/core_handler.hpp b/PAM/ssh/include/rublon/core_handler.hpp index d252949..4cda5d4 100755 --- a/PAM/ssh/include/rublon/core_handler.hpp +++ b/PAM/ssh/include/rublon/core_handler.hpp @@ -30,8 +30,7 @@ class CoreHandler : public CoreHandlerInterface< CoreHandler< HttpHandler > > { } void signRequest(Request & request) const { - request.headers["X-Rublon-Signature"] = - std::pmr::string{signData(request.body, config().secretKey).c_str(), request.headers.get_allocator()}; + request.headers["X-Rublon-Signature"] = signData(request.body, config().secretKey).c_str(); } bool hasSignature(const Response & response) const { diff --git a/PAM/ssh/include/rublon/websockets.hpp b/PAM/ssh/include/rublon/websockets.hpp index f2bef57..0ea6d72 100644 --- a/PAM/ssh/include/rublon/websockets.hpp +++ b/PAM/ssh/include/rublon/websockets.hpp @@ -136,7 +136,7 @@ class WebSocket { subscribe_message += R"msg(42["subscribe",{"channel":"transactionConfirmation.)msg"; subscribe_message += transaction_id.data(); - subscribe_message += "}]"; + subscribe_message += R"(")}])"; memcpy(buf + LWS_PRE, subscribe_message.data(), subscribe_message.size()); diff --git a/PAM/ssh/lib/pam.cpp b/PAM/ssh/lib/pam.cpp index 5bc0ffa..1276387 100644 --- a/PAM/ssh/lib/pam.cpp +++ b/PAM/ssh/lib/pam.cpp @@ -99,8 +99,7 @@ pam_sm_authenticate(pam_handle_t * pamh, [[maybe_unused]] int flags, [[maybe_unu { CheckApplication ca; - const auto & config = session.config(); - const auto ret = ca.call(CH, config.systemToken).or_else(mapError); + const auto ret = ca.call(CH, session.config().systemToken).or_else(mapError); if(not ret.has_value()) { log(LogLevel::Error, "Check Application step failed, check configration"); return PAM_MAXTRIES;