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
+7
-1
@@ -305,7 +305,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
// 64KB SRAM -> 524288 bits(max sample num) < 2^30
|
||||
uint32_t samples :
|
||||
uint32_t samples :
|
||||
LF_SAMPLES_BITS;
|
||||
bool realtime : 1;
|
||||
bool verbose : 1;
|
||||
@@ -473,6 +473,9 @@ typedef struct {
|
||||
#define CMD_SPIFFS_UNMOUNT 0x0131
|
||||
#define CMD_SPIFFS_WRITE 0x0132
|
||||
|
||||
#define CMD_FLASHMEM_GET_SIGNATURE 0x0147
|
||||
#define CMD_FLASHMEM_GET_INFO 0x0148
|
||||
|
||||
// We take +0x1000 when having a variant of similar function (todo : make it an argument!)
|
||||
#define CMD_SPIFFS_APPEND 0x1132
|
||||
|
||||
@@ -844,11 +847,13 @@ typedef struct {
|
||||
#define MIFARE_2K_MAX_BYTES 2048
|
||||
#define MIFARE_1K_MAX_BYTES 1024
|
||||
#define MIFARE_MINI_MAX_BYTES 320
|
||||
|
||||
#define FLAG_MASK_MF_SIZE 0x00C0
|
||||
#define FLAG_MF_MINI 0x0000
|
||||
#define FLAG_MF_1K 0x0040
|
||||
#define FLAG_MF_2K 0x0080
|
||||
#define FLAG_MF_4K 0x00C0
|
||||
|
||||
#define FLAG_SET_MF_SIZE(flags, size) {\
|
||||
flags = (flags & (~FLAG_MASK_MF_SIZE))|\
|
||||
(size == MIFARE_MINI_MAX_BYTES ? FLAG_MF_MINI : \
|
||||
@@ -857,6 +862,7 @@ typedef struct {
|
||||
(size == MIFARE_4K_MAX_BYTES ? FLAG_MF_4K : \
|
||||
0))));\
|
||||
}
|
||||
|
||||
// else we tell to take UID from block 0:
|
||||
#define IS_FLAG_MF_SIZE(flags, size) (\
|
||||
(flags & FLAG_MASK_MF_SIZE) == \
|
||||
|
||||
@@ -93,5 +93,11 @@ typedef struct {
|
||||
uint8_t signature[FLASH_MEM_SIGNATURE_LEN];
|
||||
} PACKED rdv40_validation_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t manufacturer_id;
|
||||
uint8_t device_id;
|
||||
uint16_t jedec_id;
|
||||
uint8_t pages64k;
|
||||
} PACKED spi_flash_t;
|
||||
|
||||
#endif // __PMFLASH_H
|
||||
Reference in new issue
Block a user