Skip to content

Commit

Permalink
fix: UpgradePackBuilderFacade setting mbedtls global memory pool on s…
Browse files Browse the repository at this point in the history
…tack (#324)

fix: UpgradePackBuilderFacade setting mbedtls global memory pool on stack, causing a crash when combined with ConnectionMbedTls
  • Loading branch information
BarisTanyeri committed Jun 19, 2023
1 parent 7090a40 commit ec567d5
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "upgrade/pack_builder_instantiations/UpgradePackBuilderFacade.hpp"
#include "hal/generic/FileSystemGeneric.hpp"
#include "hal/generic/SynchronousRandomDataGeneratorGeneric.hpp"
#include "mbedtls/memory_buffer_alloc.h"
#include "upgrade/pack_builder/BinaryObject.hpp"
#include "upgrade/pack_builder/ImageEncryptorAes.hpp"
#include "upgrade/pack_builder/ImageEncryptorNone.hpp"
Expand All @@ -23,11 +22,7 @@ namespace main_

UpgradePackBuilderFacade::UpgradePackBuilderFacade(const application::UpgradePackBuilder::HeaderInfo& headerInfo)
: headerInfo(headerInfo)
{
// Initialize the MbedTLS memory pool
unsigned char memory_buf[100000];
mbedtls_memory_buffer_alloc_init(memory_buf, sizeof(memory_buf));
}
{}

void UpgradePackBuilderFacade::Build(const application::SupportedTargets& supportedTargets, const TargetAndFiles& requestedTargets, const std::string& outputFilename,
const BuildOptions& buildOptions, infra::JsonObject& configuration, const DefaultKeyMaterial& keys)
Expand Down

0 comments on commit ec567d5

Please sign in to comment.