From b933e292db1c00238e1289a215e77f0ef0fbe144 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 15 Mar 2018 03:02:36 +0100 Subject: [PATCH] bootloader: fix signatures_ok usage in usb.c after refactoring --- bootloader/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootloader/usb.c b/bootloader/usb.c index 1e2a752d9..4be378618 100644 --- a/bootloader/usb.c +++ b/bootloader/usb.c @@ -444,7 +444,7 @@ static void hid_rx_callback(usbd_device *dev, uint8_t ep) } if (brand_new_firmware || button.YesUp) { // check whether current firmware is signed - if (signatures_ok(NULL)) { + if (SIG_OK == signatures_ok(NULL)) { old_was_unsigned = false; // backup metadata backup_metadata(meta_backup); @@ -603,7 +603,7 @@ static void hid_rx_callback(usbd_device *dev, uint8_t ep) // 1) old firmware was unsigned // 2) firmware restore flag isn't set // 3) signatures are not ok - if (old_was_unsigned || (flags & 0x01) == 0 || !signatures_ok(NULL)) { + if (old_was_unsigned || (flags & 0x01) == 0 || SIG_OK != signatures_ok(NULL)) { memzero(meta_backup, sizeof(meta_backup)); } // copy new firmware header