forked from LedgerHQ/app-celo-spender
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from blooo-io/fix/audit-fix
Fix vulnerability reported from the audit
- Loading branch information
Showing
10 changed files
with
687 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,82 @@ | ||
/** | ||
* @file celo.h | ||
* @brief Header file containing function declarations and definitions for the Celo application. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include "ethUstream.h" | ||
#include "tokens.h" | ||
|
||
/** | ||
* @brief Sends the status code to the SE proxy hardware abstraction layer. | ||
* | ||
* @param sw The status code to be sent. | ||
*/ | ||
void io_seproxyhal_send_status(uint32_t sw); | ||
|
||
/** | ||
* @brief Formats the signature output. | ||
* | ||
* @param signature The signature to be formatted. | ||
*/ | ||
void format_signature_out(const uint8_t* signature); | ||
|
||
/** | ||
* @brief Sets the result and retrieves the public key. | ||
* | ||
* @return The status code for the operation. | ||
*/ | ||
uint32_t set_result_get_publicKey(); | ||
|
||
/** | ||
* @brief Resets the application context. | ||
*/ | ||
void reset_app_context(); | ||
|
||
/** | ||
* @brief Retrieves the known token based on the token address. | ||
* | ||
* @param tokenAddr The address of the token. | ||
* @return A pointer to the token definition. | ||
*/ | ||
tokenDefinition_t* getKnownToken(uint8_t *tokenAddr); | ||
|
||
/** | ||
* @brief Custom processor for transaction context. | ||
* | ||
* @param context The transaction context. | ||
* @return The custom status code. | ||
*/ | ||
customStatus_e customProcessor(txContext_t *context); | ||
|
||
/** | ||
* @brief Initializes the transaction context. | ||
* | ||
* @param context The transaction context. | ||
* @param sha3 The SHA3 context. | ||
* @param content The transaction content. | ||
* @param customProcessor The custom processor function. | ||
* @param extra Additional data for the custom processor. | ||
*/ | ||
void initTx(txContext_t *context, cx_sha3_t *sha3, txContent_t *content, ustreamProcess_t customProcessor, void *extra); | ||
|
||
/** | ||
* @brief Finalizes the parsing process. | ||
* | ||
* @param direct Flag indicating if the parsing is direct. | ||
*/ | ||
void finalizeParsing(bool direct); | ||
|
||
// TODO: this should not be exposed | ||
/** | ||
* @brief Enumeration representing the application state. | ||
*/ | ||
typedef enum { | ||
APP_STATE_IDLE, | ||
APP_STATE_SIGNING_TX, | ||
APP_STATE_SIGNING_MESSAGE | ||
} app_state_t; | ||
|
||
extern volatile uint8_t appState; | ||
extern volatile uint8_t appState; /**< The application state. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.