cryptoErase.cpp (2b5454d316b564e63b6f5afa5e0018a014d81365) cryptoErase.cpp (b2c86be3b1c6bf26dbfbcf3e3a3f3322472023e9)
1#include "cryptErase.hpp"
2#include "cryptsetupInterface.hpp"
3#include "erase.hpp"
4
5#include <libcryptsetup.h>
6
7#include <phosphor-logging/lg2.hpp>
8#include <xyz/openbmc_project/Common/error.hpp>

--- 12 unchanged lines hidden (view full) ---

21 std::unique_ptr<estoraged::CryptsetupInterface> inCryptIface) :
22 Erase(devPathIn),
23 cryptIface(std::move(inCryptIface))
24{}
25
26void CryptErase::doErase()
27{
28 /* get cryptHandle */
1#include "cryptErase.hpp"
2#include "cryptsetupInterface.hpp"
3#include "erase.hpp"
4
5#include <libcryptsetup.h>
6
7#include <phosphor-logging/lg2.hpp>
8#include <xyz/openbmc_project/Common/error.hpp>

--- 12 unchanged lines hidden (view full) ---

21 std::unique_ptr<estoraged::CryptsetupInterface> inCryptIface) :
22 Erase(devPathIn),
23 cryptIface(std::move(inCryptIface))
24{}
25
26void CryptErase::doErase()
27{
28 /* get cryptHandle */
29 CryptHandle cryptHandle(std::string(devPath).c_str());
29 CryptHandle cryptHandle{devPath};
30 /* cryptLoad */
31 if (cryptIface->cryptLoad(cryptHandle.get(), CRYPT_LUKS2, nullptr) != 0)
32 {
33 lg2::error("Failed to load the key slots for destruction",
34 "REDFISH_MESSAGE_ID",
35 std::string("OpenBMC.0.1.EraseFailure"));
36 throw ResourceNotFound();
37 }

--- 43 unchanged lines hidden ---
30 /* cryptLoad */
31 if (cryptIface->cryptLoad(cryptHandle.get(), CRYPT_LUKS2, nullptr) != 0)
32 {
33 lg2::error("Failed to load the key slots for destruction",
34 "REDFISH_MESSAGE_ID",
35 std::string("OpenBMC.0.1.EraseFailure"));
36 throw ResourceNotFound();
37 }

--- 43 unchanged lines hidden ---