Code improvements / Fix warnings
- Fix CodeQL warnings - Port lots of improvements/fixes from PR #225 - replace 'array_hexstr' and '%*H' format by sdk function 'format_hex' - Add 'noreturn' attribute in 'main.c'
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "feature_performPrivacyOperation.h"
|
||||
#include "common_ui.h"
|
||||
#include "uint_common.h"
|
||||
|
||||
#define P2_PUBLIC_ENCRYPTION_KEY 0x00
|
||||
#define P2_SHARED_SECRET 0x01
|
||||
@@ -106,11 +107,11 @@ void handlePerformPrivacyOperation(uint8_t p1,
|
||||
for (uint8_t i = 0; i < 32; i++) {
|
||||
privateKeyData[i] = tmpCtx.publicKeyContext.publicKey.W[32 - i];
|
||||
}
|
||||
snprintf(strings.common.fullAmount,
|
||||
sizeof(strings.common.fullAmount) - 1,
|
||||
"%.*H",
|
||||
32,
|
||||
privateKeyData);
|
||||
format_hex(privateKeyData,
|
||||
32,
|
||||
strings.common.fullAmount,
|
||||
sizeof(strings.common.fullAmount) - 1);
|
||||
|
||||
if (p2 == P2_PUBLIC_ENCRYPTION_KEY) {
|
||||
ui_display_privacy_public_key();
|
||||
} else {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#ifndef _PERFORM_PRIVACY_OPERATION_H_
|
||||
#define _PERFORM_PRIVACY_OPERATION_H_
|
||||
|
||||
#include "shared_context.h"
|
||||
|
||||
uint32_t set_result_perform_privacy_operation(void);
|
||||
|
||||
#endif // _PERFORM_PRIVACY_OPERATION_H_
|
||||
|
||||
Reference in New Issue
Block a user