diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 09f8b10..3ce65aa 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -391,11 +391,30 @@
  */
 bool FirmwareBlobHandler::close(uint16_t session)
 {
+    auto item = lookup.find(session);
+    if (item == lookup.end())
+    {
+        return false;
+    }
+
+    if (item->second->dataHandler)
+    {
+        item->second->dataHandler->close();
+    }
+    item->second->imageHandler->close();
+    item->second->state = Session::State::closed;
+    /* Do not delete the active blob_id from the list of blob_ids, because that
+     * blob_id indicates there is data stored.  Delete will destroy it.
+     */
+
+    lookup.erase(item);
+
     fileOpen = false;
 
-    /* TODO: implement other aspects of closing out a session. */
-
-    return false;
+    /* TODO: implement other aspects of closing out a session, such as changing
+     * global firmware state.
+     */
+    return true;
 }
 
 bool FirmwareBlobHandler::expire(uint16_t session)
diff --git a/hash_handler.cpp b/hash_handler.cpp
index ce9208b..820ffbf 100644
--- a/hash_handler.cpp
+++ b/hash_handler.cpp
@@ -14,6 +14,11 @@
     return false;
 }
 
+void HashFileHandler::close()
+{
+    return;
+}
+
 bool HashFileHandler::write(std::uint32_t offset,
                             const std::vector<std::uint8_t>& data)
 {
diff --git a/hash_handler.hpp b/hash_handler.hpp
index c006194..66f68a4 100644
--- a/hash_handler.hpp
+++ b/hash_handler.hpp
@@ -19,7 +19,7 @@
     HashFileHandler() = default;
 
     bool open(const std::string& path) override;
-
+    void close() override;
     bool write(std::uint32_t offset,
                const std::vector<std::uint8_t>& data) override;
 
diff --git a/image_handler.hpp b/image_handler.hpp
index 28675ce..ed3455b 100644
--- a/image_handler.hpp
+++ b/image_handler.hpp
@@ -26,6 +26,11 @@
     virtual bool open(const std::string& path) = 0;
 
     /**
+     * close the image.
+     */
+    virtual void close() = 0;
+
+    /**
      * write data to the staged file.
      *
      * @param[in] offset - 0-based offset into the file.
diff --git a/static_handler.cpp b/static_handler.cpp
index 8cb20e0..c4fa602 100644
--- a/static_handler.cpp
+++ b/static_handler.cpp
@@ -14,6 +14,11 @@
     return false;
 }
 
+void StaticLayoutHandler::close()
+{
+    return;
+}
+
 bool StaticLayoutHandler::write(std::uint32_t offset,
                                 const std::vector<std::uint8_t>& data)
 {
diff --git a/static_handler.hpp b/static_handler.hpp
index edb3df5..0126315 100644
--- a/static_handler.hpp
+++ b/static_handler.hpp
@@ -20,7 +20,7 @@
         stagedFilename(temporaryName){};
 
     bool open(const std::string& path) override;
-
+    void close() override;
     bool write(std::uint32_t offset,
                const std::vector<std::uint8_t>& data) override;
 
diff --git a/test/Makefile.am b/test/Makefile.am
index aeb3758..e914c14 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -15,7 +15,8 @@
 	firmware_canhandle_unittest \
 	firmware_open_unittest \
 	firmware_write_unittest \
-	firmware_writemeta_unittest
+	firmware_writemeta_unittest \
+	firmware_close_unittest
 
 TESTS = $(check_PROGRAMS)
 
@@ -36,3 +37,6 @@
 
 firmware_writemeta_unittest_SOURCES = firmware_writemeta_unittest.cpp
 firmware_writemeta_unittest_LDADD = $(top_builddir)/firmware_handler.o
+
+firmware_close_unittest_SOURCES = firmware_close_unittest.cpp
+firmware_close_unittest_LDADD = $(top_builddir)/firmware_handler.o
diff --git a/test/firmware_close_unittest.cpp b/test/firmware_close_unittest.cpp
new file mode 100644
index 0000000..5bbd333
--- /dev/null
+++ b/test/firmware_close_unittest.cpp
@@ -0,0 +1,96 @@
+#include "data_mock.hpp"
+#include "firmware_handler.hpp"
+#include "image_mock.hpp"
+
+#include <vector>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+namespace blobs
+{
+using ::testing::Eq;
+using ::testing::Return;
+using ::testing::StrEq;
+
+TEST(FirmwareHandlerCloseTest, CloseSuceedsWithDataHandler)
+{
+    /* Boring test where you open a blob_id, then verify that when it's closed
+     * everything looks right.
+     */
+    DataHandlerMock dataMock;
+    ImageHandlerMock imageMock;
+
+    std::vector<HandlerPack> blobs = {
+        {FirmwareBlobHandler::hashBlobID, &imageMock},
+        {"asdf", &imageMock},
+    };
+    std::vector<DataHandlerPack> data = {
+        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+        {FirmwareBlobHandler::UpdateFlags::lpc, &dataMock},
+    };
+
+    auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(blobs, data);
+
+    EXPECT_CALL(dataMock, open()).WillOnce(Return(true));
+    EXPECT_CALL(imageMock, open(Eq(FirmwareBlobHandler::hashBlobID)))
+        .WillOnce(Return(true));
+
+    EXPECT_TRUE(handler->open(
+        0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
+        FirmwareBlobHandler::hashBlobID));
+
+    /* The active hash blob_id was added. */
+    auto currentBlobs = handler->getBlobIds();
+    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
+                            FirmwareBlobHandler::activeHashBlobID));
+
+    /* Set up close() expectations. */
+    EXPECT_CALL(dataMock, close());
+    EXPECT_CALL(imageMock, close());
+    EXPECT_TRUE(handler->close(0));
+
+    /* Close does not delete the active blob id.  This indicates that there is
+     * data queued.
+     */
+}
+
+TEST(FirmwareHandlerCloseTest, CloseSuceedsWithoutDataHandler)
+{
+    /* Boring test where you open a blob_id using ipmi, so there's no data
+     * handler, and it's closed and everything looks right.
+     */
+    DataHandlerMock dataMock;
+    ImageHandlerMock imageMock;
+
+    std::vector<HandlerPack> blobs = {
+        {FirmwareBlobHandler::hashBlobID, &imageMock},
+        {"asdf", &imageMock},
+    };
+    std::vector<DataHandlerPack> data = {
+        {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr},
+        {FirmwareBlobHandler::UpdateFlags::lpc, &dataMock},
+    };
+
+    auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(blobs, data);
+
+    EXPECT_CALL(imageMock, open(Eq(FirmwareBlobHandler::hashBlobID)))
+        .WillOnce(Return(true));
+
+    EXPECT_TRUE(handler->open(
+        0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
+        FirmwareBlobHandler::hashBlobID));
+
+    /* The active hash blob_id was added. */
+    auto currentBlobs = handler->getBlobIds();
+    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
+                            FirmwareBlobHandler::activeHashBlobID));
+
+    /* Set up close() expectations. */
+    EXPECT_CALL(imageMock, close());
+    EXPECT_TRUE(handler->close(0));
+}
+
+} // namespace blobs
diff --git a/test/firmware_open_unittest.cpp b/test/firmware_open_unittest.cpp
index 78c5d69..1975740 100644
--- a/test/firmware_open_unittest.cpp
+++ b/test/firmware_open_unittest.cpp
@@ -166,8 +166,7 @@
         1, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
         FirmwareBlobHandler::hashBlobID));
 
-    /* Close the file, currently ignoring its return value. */
-    handler->close(0);
+    EXPECT_TRUE(handler->close(0));
 
     EXPECT_CALL(imageMock1, open(StrEq(FirmwareBlobHandler::hashBlobID)))
         .WillOnce(Return(true));
@@ -210,7 +209,7 @@
     /* Close only active session, to verify it's failing on attempt to open a
      * specific blob_id.
      */
-    handler->close(0);
+    EXPECT_TRUE(handler->close(0));
 
     EXPECT_FALSE(handler->open(
         1, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi,
diff --git a/test/image_mock.hpp b/test/image_mock.hpp
index 6fbd87d..8259aa9 100644
--- a/test/image_mock.hpp
+++ b/test/image_mock.hpp
@@ -13,6 +13,7 @@
     virtual ~ImageHandlerMock() = default;
 
     MOCK_METHOD1(open, bool(const std::string&));
+    MOCK_METHOD0(close, void());
     MOCK_METHOD2(write, bool(std::uint32_t, const std::vector<std::uint8_t>&));
 };
 
