Build botan with ExternalProject and without amalgamation
All checks were successful
/ Build the server (push) Successful in 3m4s

This commit is contained in:
2023-10-23 18:30:35 +02:00
parent 13579acd8f
commit 023ef2ec49
11 changed files with 52 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
#include <memory>
#include <csignal>
#include <botan_all.h>
#include <botan/hash.h>
#include <botan/hex.h>
#include <corvusoft/restbed/request.hpp>
#include <corvusoft/restbed/resource.hpp>
#include <corvusoft/restbed/session.hpp>
@@ -32,7 +33,7 @@ int main() {
{
auto md5_hash = Botan::HashFunction::create_or_throw("MD5");
md5_hash->update(index_html_bytes);
index_etag = Botan::hex_encode(md5_hash->final());
index_etag = "\"" + Botan::hex_encode(md5_hash->final()) + "\"";
}
auto mrpc_resource = std::make_shared<restbed::Resource>();

View File

@@ -1,4 +1,7 @@
#include <botan_all.h>
#include <botan/argon2fmt.h>
#include <botan/hex.h>
#include <botan/mac.h>
#include <botan/base32.h>
#include "server_internal.hxx"
std::string hash_password(const std::string &password) {

View File

@@ -2,6 +2,7 @@
#include <fstream>
#include <stack>
#include <unordered_set>
#include <botan/base64.h>
#include "server_internal.hxx"
mrpc::Node node_to_node(const std::shared_ptr<Node>& node) {

View File

@@ -1,6 +1,8 @@
#include <asio.hpp>
#include <botan_all.h>
#include <botan_asio/asio_stream.h>
#include <botan/certstor_system.h>
#include <botan/tls_session_manager_noop.h>
#include <botan/base64.h>
#include <spdlog/spdlog.h>
#include "server_internal.hxx"
@@ -80,7 +82,11 @@ void Server::send_mail(const std::string &email, const std::string &title, const
asio::io_service ctx;
auto ssl_ctx = std::make_shared<Botan::TLS::Context>(
std::make_shared<CredMan>(),
std::make_shared<Botan::AutoSeeded_RNG>(),
#if defined(BOTAN_HAS_SYSTEM_RNG)
std::make_unique<Botan::System_RNG>(),
#else
std::make_unique<Botan::AutoSeeded_RNG>(),
#endif
std::make_shared<Botan::TLS::Session_Manager_Noop>(),
std::make_shared<Policy>()
);

View File

@@ -1,3 +1,4 @@
#include <botan/otp.h>
#include "server_internal.hxx"
std::shared_ptr<Token> Server::get_token(const std::string &token) {

View File

@@ -1,7 +1,7 @@
#ifndef FILESERVER_SERVER_INTERNAL_HXX
#define FILESERVER_SERVER_INTERNAL_HXX
#include <botan_all.h>
#include <botan/rng.h>
#include "server.hxx"
// TODO log user action with __FUNC__
@@ -10,8 +10,10 @@
#define check_user_optional() check_user() return "Unauthorized"
#if defined(BOTAN_HAS_SYSTEM_RNG)
#include <botan/system_rng.h>
static std::unique_ptr<Botan::RNG> auth_rng = std::make_unique<Botan::System_RNG>();
#else
#include <botan/auto_rng.h>
static std::unique_ptr<Botan::RNG> auth_rng = std::make_unique<Botan::AutoSeeded_RNG>();
#endif