Skip to content

Commit

Permalink
Code style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Jun 25, 2024
1 parent 22146a7 commit c4dd43f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/realmd/AuthSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ void AuthSocket::_HandleReconnectChallenge()

// Escape the user input used in DB to avoid further SQL injection
// Memory will be freed on AuthSocket object destruction
self->m_login = (const char*)body->username;
self->m_login = (char const*)body->username;
self->m_safelogin = self->m_login;
LoginDatabase.escape_string(self->m_safelogin);

Expand Down Expand Up @@ -1406,9 +1406,10 @@ bool AuthSocket::VerifyPinData(uint32 pin, PINData const& clientData)
return !memcmp(hash.AsDecStr(), clientHash.AsDecStr(), 20);
}

uint32 AuthSocket::GenerateTotpPin(const std::string& secret, int interval) {
uint32 AuthSocket::GenerateTotpPin(std::string const& secret, int interval)
{
std::vector<uint8> decoded_key((secret.size() + 7) / 8 * 5);
int key_size = base32_decode((const uint8_t*)secret.data(), decoded_key.data(), decoded_key.size());
int key_size = base32_decode((uint8_t const*)secret.data(), decoded_key.data(), decoded_key.size());

if (key_size == -1)
{
Expand Down
2 changes: 1 addition & 1 deletion src/realmd/AuthSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class AuthSocket : public IO::Networking::AsyncSocket<AuthSocket>
std::shared_ptr<ByteBuffer> GenerateLogonProofResponse(Sha1Hash sha);
void LoadRealmlistAndWriteIntoBuffer(ByteBuffer &pkt);
bool VerifyPinData(uint32 pin, PINData const& clientData);
uint32 GenerateTotpPin(const std::string& secret, int interval);
uint32 GenerateTotpPin(std::string const& secret, int interval);

void _HandleLogonChallenge();
void _HandleLogonProof();
Expand Down
8 changes: 4 additions & 4 deletions src/shared/IO/Filesystem/FileHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace IO { namespace Filesystem {
{
public:
~FileHandle();
FileHandle(const FileHandle&) = delete;
FileHandle& operator=(const FileHandle&) = delete;
FileHandle(FileHandle const&) = delete;
FileHandle& operator=(FileHandle const&) = delete;
FileHandle(FileHandle&&) = delete;
FileHandle& operator=(FileHandle&&) = delete;

Expand All @@ -39,8 +39,8 @@ namespace IO { namespace Filesystem {
{
public:
explicit FileHandleReadonly(HANDLE nativeFileHandle) : FileHandle(nativeFileHandle) {};
FileHandleReadonly(const FileHandleReadonly&) = delete;
FileHandleReadonly& operator=(const FileHandleReadonly&) = delete;
FileHandleReadonly(FileHandleReadonly const&) = delete;
FileHandleReadonly& operator=(FileHandleReadonly const&) = delete;
FileHandleReadonly(FileHandleReadonly&&) = delete;
FileHandleReadonly& operator=(FileHandleReadonly&&) = delete;

Expand Down
4 changes: 2 additions & 2 deletions src/shared/IO/Networking/impl/windows/AsyncServerListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class AsyncServerListener {
explicit AsyncServerListener(SOCKET acceptorNativeSocket, HANDLE completionPort)
: m_acceptorNativeSocket(acceptorNativeSocket), m_completionPort(completionPort) {}

AsyncServerListener(const AsyncServerListener&) = delete;
AsyncServerListener& operator=(const AsyncServerListener&) = delete;
AsyncServerListener(AsyncServerListener const&) = delete;
AsyncServerListener& operator=(AsyncServerListener const&) = delete;
AsyncServerListener(AsyncServerListener&&) = delete;
AsyncServerListener& operator=(AsyncServerListener&&) = delete;

Expand Down
4 changes: 2 additions & 2 deletions src/shared/IO/Networking/impl/windows/AsyncSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace IO { namespace Networking {
public:
explicit AsyncSocket(SocketDescriptor const& socketDescriptor) : m_socket(socketDescriptor) {}
~AsyncSocket();
AsyncSocket(const AsyncSocket&) = delete;
AsyncSocket& operator=(const AsyncSocket&) = delete;
AsyncSocket(AsyncSocket const&) = delete;
AsyncSocket& operator=(AsyncSocket const&) = delete;
AsyncSocket(AsyncSocket&&) = delete;
AsyncSocket& operator=(AsyncSocket&&) = delete;

Expand Down
4 changes: 2 additions & 2 deletions src/shared/IO/Timer/impl/windows/AsyncSystemTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace IO { namespace Timer { namespace impl { namespace windows {
public:
explicit AsyncSystemTimer();
~AsyncSystemTimer() = default;
AsyncSystemTimer(const AsyncSystemTimer&) = delete;
AsyncSystemTimer& operator=(const AsyncSystemTimer&) = delete;
AsyncSystemTimer(AsyncSystemTimer const&) = delete;
AsyncSystemTimer& operator=(AsyncSystemTimer const&) = delete;
AsyncSystemTimer(AsyncSystemTimer&&) = delete;
AsyncSystemTimer& operator=(AsyncSystemTimer&&) = delete;

Expand Down

0 comments on commit c4dd43f

Please sign in to comment.