droplet 1.3.0
A multipurpose Discord bot with the hacker in mind
Loading...
Searching...
No Matches
AuthUtils.cpp File Reference
#include "AuthUtils.hpp"
#include <openssl/crypto.h>
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <array>
#include <sstream>
#include <stdexcept>
#include "Poco/HexBinaryEncoder.h"
#include "Poco/JWT/Signer.h"
#include "Poco/JWT/Token.h"
#include "Poco/SHA2Engine.h"
#include "Poco/Timestamp.h"
#include "Secrets.hpp"
Include dependency graph for AuthUtils.cpp:

Functions

bool constant_time_equal (std::string_view a, std::string_view b) noexcept
bool jwt_secret_is_strong (std::string_view secret) noexcept
std::string hashPassword (const std::string &password)
bool verifyPassword (const std::string &password, const std::string &storedHash)
bool jwt_grants_clearance (const std::string &jwt, const std::string &hmac_secret, int min_clearance)

Function Documentation

◆ constant_time_equal()

bool constant_time_equal ( std::string_view a,
std::string_view b )
nodiscardnoexcept

◆ hashPassword()

std::string hashPassword ( const std::string & password)
nodiscard

◆ jwt_grants_clearance()

bool jwt_grants_clearance ( const std::string & jwt,
const std::string & hmac_secret,
int min_clearance )
nodiscard

◆ jwt_secret_is_strong()

bool jwt_secret_is_strong ( std::string_view secret)
nodiscardnoexcept

◆ verifyPassword()

bool verifyPassword ( const std::string & password,
const std::string & storedHash )
nodiscard