Delete package sources that fail the signature check.
[oweals/opkg-lede.git] / libopkg / opkg_cmd.c
index 29ae0cdcdafd06e6aaae14ae805f80006a763b22..4059bb72ea8f4ebddd2b8eb879efe45ede38aa70 100644 (file)
@@ -182,6 +182,12 @@ opkg_update_cmd(int argc, char **argv)
                   else
                       opkg_msg(NOTICE, "Signature check failed.\n");
               }
+              if (err) {
+                  /* The signature was wrong so delete it */
+                  opkg_msg(NOTICE, "Remove wrong Signature file.\n");
+                  unlink (tmp_file_name);
+                  unlink (list_file_name);
+              }
               /* We shouldn't unlink the signature ! */
               // unlink (tmp_file_name);
               free (tmp_file_name);