Switch to cmake + vcpkg, builds on linux, windows needs verification.

Code has been modified to be portable.
This commit is contained in:
eelke 2026-10-17 16:21:22 +02:00
parent c1a5ac1aad
commit 49f6619a4e
34 changed files with 678 additions and 327 deletions

View file

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <string>
std::string HumanReadableBytes(uint64_t bytes);

View file

@ -9,7 +9,7 @@
#include <botan/base64.h>
#include <botan/mac.h>
#include <botan/block_cipher.h>
#include <boost/lexical_cast.hpp>
#include <botan/exceptn.h>
using namespace Botan;
@ -33,7 +33,7 @@ public:
* distinct key which is derived by hashing the wrapped key name with HMAC.
*/
const std::vector<uint8_t> wrapped_name =
nist_key_wrap_padded(cast_char_ptr_to_uint8(name.data()),
nist_key_wrap_padded(reinterpret_cast<const uint8_t*>(name.data()),
name.size(),
*m_cipher);
@ -47,7 +47,7 @@ public:
secure_vector<uint8_t> get(const std::string& name, const std::string_view &wrapped_key) const
{
const std::vector<uint8_t> wrapped_name =
nist_key_wrap_padded(cast_char_ptr_to_uint8(name.data()),
nist_key_wrap_padded(reinterpret_cast<const uint8_t*>(name.data()),
name.size(),
*m_cipher);

View file

@ -19,7 +19,11 @@ namespace Botan {
class PasswordManagerException: public std::exception {
public:
using std::exception::exception; //(char const* const _Message);
PasswordManagerException() = default;
explicit PasswordManagerException(const char *message) : m_message(message) {}
const char *what() const noexcept override { return m_message.c_str(); }
private:
std::string m_message;
};
class PasswordManagerLockedException: public PasswordManagerException {