this commit refactors the signature checks. First we introduce a common pm3 generic private / public key pair in order to allow for users to self sign their own modded device. The verification checks now looks at both hard coded public keys. If a vendor wants to add their own public key thus allowing for a simple way for us to identify their devices they can now do so. The downside is that the firmware mismatch detection becomes a bit dodgy. mem info; mem info -v; mem info -s -p <filename.pem>; mem info -s -p <filename.pem> -w contains the changes. OBS! when -w be careful to not overwrite your genuine RDV4 signature. As always, with great power comes great responsibility
This commit is contained in:
1 parent
1412b6882b
commit
b097e10aa3
11 files changed
+340
-178
No files matched your search
@@ -43,9 +43,13 @@ static uint32_t FLASHMEM_SPIBAUDRATE = FLASH_BAUD;
|
||||
|
||||
#ifndef AS_BOOTROM
|
||||
|
||||
|
||||
spi_flash_t spi_flash_data = {0};
|
||||
uint8_t spi_flash_pages64k = 4;
|
||||
static spi_flash_t spi_flash_data = {0};
|
||||
|
||||
spi_flash_t *flash_get_info(void) {
|
||||
return &spi_flash_data;
|
||||
}
|
||||
|
||||
|
||||
void FlashmemSetSpiBaudrate(uint32_t baudrate) {
|
||||
FLASHMEM_SPIBAUDRATE = baudrate;
|
||||
@@ -387,7 +391,7 @@ void Flashmem_print_status(void) {
|
||||
);
|
||||
}
|
||||
|
||||
Dbprintf(" Memory size............. " _YELLOW_("%d kB (%d pages * 64k)"), spi_flash_pages64k * 64, spi_flash_pages64k);
|
||||
Dbprintf(" Memory size............. " _YELLOW_("%d Kb") " ( %d pages * 64k )", spi_flash_pages64k * 64, spi_flash_pages64k);
|
||||
|
||||
uint8_t uid[8] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
Flash_UniqueID(uid);
|
||||
@@ -439,6 +443,7 @@ bool FlashDetect(void) {
|
||||
}
|
||||
}
|
||||
|
||||
spi_flash_data.pages64k = spi_flash_pages64k;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#define __FLASHMEM_H
|
||||
|
||||
#include "common.h"
|
||||
#include "pmflash.h"
|
||||
|
||||
|
||||
// Used Command
|
||||
#define ID 0x90
|
||||
@@ -135,11 +137,7 @@ uint16_t Flash_WriteData(uint32_t address, uint8_t *in, uint16_t len);
|
||||
uint16_t Flash_WriteDataCont(uint32_t address, uint8_t *in, uint16_t len);
|
||||
void Flashmem_print_status(void);
|
||||
|
||||
typedef struct {
|
||||
uint8_t manufacturer_id;
|
||||
uint8_t device_id;
|
||||
uint16_t jedec_id;
|
||||
} spi_flash_t;
|
||||
spi_flash_t *flash_get_info(void);
|
||||
|
||||
extern uint8_t spi_flash_pages64k;
|
||||
|
||||
|
||||
Reference in new issue
Block a user