firmware: set up hash handler
Treat the hash file as just another file. It isn't just another file in
some contexts, but in writing data down it is.
Change-Id: I173b6d2a7d7da2db628e8b27ce58b64aea6b932a
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/Makefile.am b/Makefile.am
index 9956d51..7455b4d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,8 @@
firmware_handler.cpp \
static_handler.cpp \
lpc_handler.cpp \
- pci_handler.cpp
+ pci_handler.cpp \
+ hash_handler.cpp
libfirmwareblob_la_LDFLAGS = \
$(PHOSPHOR_LOGGING_LIBS) \
-version-info 0:0:0 -shared
diff --git a/hash_handler.cpp b/hash_handler.cpp
new file mode 100644
index 0000000..ce9208b
--- /dev/null
+++ b/hash_handler.cpp
@@ -0,0 +1,23 @@
+#include "hash_handler.hpp"
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace blobs
+{
+
+bool HashFileHandler::open(const std::string& path)
+{
+ this->path = path;
+ return false;
+}
+
+bool HashFileHandler::write(std::uint32_t offset,
+ const std::vector<std::uint8_t>& data)
+{
+ return false;
+}
+
+} // namespace blobs
diff --git a/hash_handler.hpp b/hash_handler.hpp
new file mode 100644
index 0000000..c006194
--- /dev/null
+++ b/hash_handler.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "image_handler.hpp"
+
+#include <cstdint>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace blobs
+{
+
+class HashFileHandler : public ImageHandlerInterface
+{
+ public:
+ /**
+ * Create a HashFileHandler.
+ */
+ HashFileHandler() = default;
+
+ bool open(const std::string& path) override;
+
+ bool write(std::uint32_t offset,
+ const std::vector<std::uint8_t>& data) override;
+
+ private:
+ std::string path;
+};
+
+} // namespace blobs