Skip to content

Commit 52f5a5e

Browse files
committed
Use flash address to check for empty keys
1 parent 109b943 commit 52f5a5e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

app/target.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,16 @@ static bool valid_application() {
106106

107107
int target_empty_keys() {
108108
unsigned int i;
109-
extern const unsigned char enc_priv_key[];
110-
extern const unsigned int enc_priv_key_len;
111-
extern const unsigned char ecdsa_pub_key[];
112-
extern unsigned int ecdsa_pub_key_len;
109+
uint8_t* encript_key = (uint8_t*)(0x08000300);
110+
uint8_t* signing_key = (uint8_t*)(0x08000400);
113111

114-
for(i = 0; i < enc_priv_key_len; i++) {
115-
if(enc_priv_key[i] != 0xFF)
112+
for(i = 0; i < 256; i++) {
113+
if(encript_key[i] != 0xFF)
116114
return 0;
117115
}
118116

119-
for(i = 0; i < ecdsa_pub_key_len; i++) {
120-
if(ecdsa_pub_key[i] != 0xFF)
117+
for(i = 0; i < 256; i++) {
118+
if(signing_key[i] != 0xFF)
121119
return 0;
122120
}
123121

0 commit comments

Comments
 (0)