add crypto_printkey() for debug
This commit is contained in:
1 parent
7487320265
commit
56f63234f0
2 files changed
+15
No files matched your search
@@ -54,6 +54,19 @@ typedef struct
|
||||
uint8_t __padding__[1];
|
||||
} crypto_persistent_keys_t;
|
||||
|
||||
void crypto_printkey(void)
|
||||
{
|
||||
crypto_persistent_keys_t keys = {};
|
||||
|
||||
uint32_t keylen = sizeof(keys);
|
||||
fsutil_read_file(CRYPTO_KEYFILE, 0, keylen, &keys, &keylen);
|
||||
|
||||
if (keys.valid0 == 0x55 && keys.valid1 == 0xAA && keys.instance == CRYPTO_INSTANCE)
|
||||
{
|
||||
dbgDumpMemoryCFormat("uint8_t keys[] = ", &keys, sizeof(keys));
|
||||
}
|
||||
}
|
||||
|
||||
void crypto_init(void)
|
||||
{
|
||||
// uint32_t err_code;
|
||||
|
||||
@@ -61,6 +61,8 @@ extern void crypto_transportEncrypt(uint8_t* key, uint8_t* nonce, uint8_t* plain
|
||||
extern uint8_t crypto_transportDecrypt(uint8_t* key, uint8_t* nonce, uint8_t* ciphertext, uint16_t clength, uint8_t* plaintext, uint16_t* plength);
|
||||
extern uint8_t crypto_advertise(void);
|
||||
|
||||
void crypto_printkey(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user