Erase CERTDO on terminate.
authorJeremy Drake <jeremydrake+gnuk@eacceleration.com>
Tue, 1 Aug 2017 23:00:28 +0000 (16:00 -0700)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 2 Aug 2017 02:13:02 +0000 (11:13 +0900)
When both certdo and lifecycle support are enabled, flash_terminate
neglected to erase the certdo pages.  It now does so.

ChangeLog
THANKS
src/flash.c

index ba821a0..115fcc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-02  Jeremy Drake  <jeremydrake+gnuk@eacceleration.com>
+
+       * src/flash.c (flash_terminate): Erase Certificate DO, too.
+
 2017-08-01  NIIBE Yutaka  <gniibe@fsij.org>
 
        * src/openpgp.c (FILE_CARD_TERMINATED_OPENPGP): Remove.
diff --git a/THANKS b/THANKS
index 47a328b..e031b33 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -18,6 +18,7 @@ Daniel Kahn Gillmor   dkg@fifthhorseman.net
 Elliott Mitchell
 Hironobu SUZUKI                hironobu@h2np.net
 Jan Suhr               jan@suhr.info
+Jeremy Drake           jeremydrake+gnuk@eacceleration.com
 Jonathan McDowell      noodles@earth.li
 Kaz Kojima             kkojima@rr.iij4u.or.jp
 Kenji Rikitake
index 60582e1..0f25b36 100644 (file)
@@ -154,6 +154,11 @@ flash_terminate (void)
   flash_erase_page ((uint32_t)(&_data_pool + flash_page_size));
   data_pool = &_data_pool;
   last_p = &_data_pool + FLASH_DATA_POOL_HEADER_SIZE;
+#if defined(CERTDO_SUPPORT)
+  flash_erase_page ((uint32_t)&ch_certificate_start);
+  if (FLASH_CH_CERTIFICATE_SIZE > flash_page_size)
+    flash_erase_page ((uint32_t)(&ch_certificate_start + flash_page_size));
+#endif
 }
 
 void