Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename boilerplate to kernel folder #16

Merged
merged 5 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/codeql-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ on:

jobs:
analyse:
name: CodeQL Analyse of boilerplate application
name: CodeQL Analyse of kernel application
strategy:
matrix:
include:
- SDK: "$NANOS_SDK"
artifact: boilerplate-app-nanoS
artifact: kernel-app-nanoS
- SDK: "$NANOX_SDK"
artifact: boilerplate-app-nanoX
artifact: kernel-app-nanoX
- SDK: "$NANOSP_SDK"
artifact: boilerplate-app-nanoSP
artifact: kernel-app-nanoSP
language: [ 'cpp' ]
runs-on: ubuntu-latest
container:
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ endif

include $(BOLOS_SDK)/Makefile.defines

ENABLE_PENDING_REVIEW_SCREEN = 1

# TODO: compile with the right path restrictions

# Application allowed derivation curves.
Expand All @@ -35,7 +33,7 @@ APP_LOAD_PARAMS += --path_slip21 "LEDGER-Wallet policy"
# Application version
APPVERSION_M = 2
APPVERSION_N = 1
APPVERSION_P = 6
APPVERSION_P = 7
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

APP_STACK_SIZE = 3072
Expand Down
2 changes: 1 addition & 1 deletion src/common/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "../cxram_stash.h"

#include "../boilerplate/sw.h"
#include "../kernel/sw.h"

#include "../debug-helpers/debug.h"

Expand Down
2 changes: 1 addition & 1 deletion src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "ux.h"

#include "boilerplate/io.h"
#include "kernel/io.h"
#include "commands.h"
#include "constants.h"

Expand Down
6 changes: 3 additions & 3 deletions src/handler/get_extended_pubkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include <stdint.h>

#include "boilerplate/io.h"
#include "boilerplate/dispatcher.h"
#include "boilerplate/sw.h"
#include "kernel/io.h"
#include "kernel/dispatcher.h"
#include "kernel/sw.h"
#include "../common/bip32.h"
#include "../commands.h"
#include "../constants.h"
Expand Down
4 changes: 2 additions & 2 deletions src/handler/get_master_fingerprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#include <stdint.h>

#include "boilerplate/dispatcher.h"
#include "boilerplate/sw.h"
#include "kernel/dispatcher.h"
#include "kernel/sw.h"
#include "../commands.h"
#include "../crypto.h"

Expand Down
4 changes: 2 additions & 2 deletions src/handler/get_wallet_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#include <stdint.h>

#include "boilerplate/io.h"
#include "boilerplate/sw.h"
#include "kernel/io.h"
#include "kernel/sw.h"
#include "../common/base58.h"
#include "../common/bip32.h"
#include "../common/buffer.h"
Expand Down
2 changes: 1 addition & 1 deletion src/handler/handlers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../boilerplate/dispatcher.h"
#include "../kernel/dispatcher.h"

void handler_get_extended_pubkey(dispatcher_context_t *dispatcher_context, uint8_t p2);
void handler_get_master_fingerprint(dispatcher_context_t *dispatcher_context, uint8_t p2);
Expand Down
4 changes: 2 additions & 2 deletions src/handler/lib/check_merkle_tree_sorted.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"

// this flow aborts if any element is larger than this size
Expand Down Expand Up @@ -41,4 +41,4 @@ static inline int call_check_merkle_tree_sorted(dispatcher_context_t *dispatcher
size,
NULL,
NULL);
}
}
2 changes: 1 addition & 1 deletion src/handler/lib/get_merkle_leaf_element.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"

/**
* TODO: docs
Expand Down
2 changes: 1 addition & 1 deletion src/handler/lib/get_merkle_leaf_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "../../common/write.h"
#include "../../common/merkle.h"
#include "../../common/varint.h"
#include "../../boilerplate/sw.h"
#include "../../kernel/sw.h"
#include "../client_commands.h"

#include "debug-helpers/debug.h"
Expand Down
4 changes: 2 additions & 2 deletions src/handler/lib/get_merkle_leaf_hash.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"

/**
* TODO: docs
Expand All @@ -9,4 +9,4 @@ int call_get_merkle_leaf_hash(dispatcher_context_t *dispatcher_context,
const uint8_t merkle_root[static 32],
uint32_t tree_size,
uint32_t leaf_index,
uint8_t out[static 32]);
uint8_t out[static 32]);
2 changes: 1 addition & 1 deletion src/handler/lib/get_merkle_leaf_index.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <string.h>

#include "../../boilerplate/sw.h"
#include "../../kernel/sw.h"
#include "get_merkle_leaf_hash.h"

#include "../client_commands.h"
Expand Down
4 changes: 2 additions & 2 deletions src/handler/lib/get_merkle_leaf_index.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"

/**
* TODO: docs
*/
int call_get_merkle_leaf_index(dispatcher_context_t *dispatcher_context,
size_t size,
const uint8_t root[static 32],
const uint8_t leaf_hash[static 32]);
const uint8_t leaf_hash[static 32]);
2 changes: 1 addition & 1 deletion src/handler/lib/get_merkle_preimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "get_merkle_preimage.h"

#include "../../boilerplate/sw.h"
#include "../../kernel/sw.h"
#include "../../common/buffer.h"
#include "../../crypto.h"
#include "../client_commands.h"
Expand Down
2 changes: 1 addition & 1 deletion src/handler/lib/get_merkle_preimage.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"

/**
* In this flow, the HWW sends a CCMD_GET_PREIMAGE command with a SHA256 hash.
Expand Down
2 changes: 1 addition & 1 deletion src/handler/lib/get_merkleized_map.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"

#include "check_merkle_tree_sorted.h"
Expand Down
4 changes: 2 additions & 2 deletions src/handler/lib/get_merkleized_map_value.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"
#include "../../common/read.h"

Expand Down Expand Up @@ -42,4 +42,4 @@ static inline int call_get_merkleized_map_value_u32_le(dispatcher_context_t *dis
*out = read_u32_le(result_raw, 0);

return 4;
}
}
4 changes: 2 additions & 2 deletions src/handler/lib/get_merkleized_map_value_hash.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"

/**
Expand All @@ -19,4 +19,4 @@ int call_get_merkleized_map_value_hash(dispatcher_context_t *dispatcher_context,
const merkleized_map_commitment_t *map,
const uint8_t *key,
int key_len,
uint8_t out[static 32]);
uint8_t out[static 32]);
2 changes: 1 addition & 1 deletion src/handler/lib/get_preimage.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <string.h>

#include "../../boilerplate/sw.h"
#include "../../kernel/sw.h"
#include "stream_preimage.h"

#include "../../crypto.h"
Expand Down
2 changes: 1 addition & 1 deletion src/handler/lib/get_preimage.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"

/**
* Given a sha256 hash, requests the corresponding pre-image to the host.
Expand Down
4 changes: 2 additions & 2 deletions src/handler/lib/policy.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/wallet.h"

/**
Expand Down Expand Up @@ -187,4 +187,4 @@ int is_policy_sane(dispatcher_context_t *dispatcher_context,
const policy_node_t *policy,
int wallet_version,
const uint8_t keys_merkle_root[static 32],
uint32_t n_keys);
uint32_t n_keys);
4 changes: 2 additions & 2 deletions src/handler/lib/psbt_parse_rawtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "get_merkleized_map_value_hash.h"
#include "stream_preimage.h"

#include "../../boilerplate/dispatcher.h"
#include "../../boilerplate/sw.h"
#include "../../kernel/dispatcher.h"
#include "../../kernel/sw.h"

#include "../../common/buffer.h"
#include "../../common/parser.h"
Expand Down
2 changes: 1 addition & 1 deletion src/handler/lib/psbt_parse_rawtx.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"
#include "../../constants.h"

Expand Down
4 changes: 2 additions & 2 deletions src/handler/lib/stream_merkle_leaf_element.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"

/**
Expand All @@ -16,4 +16,4 @@ int call_stream_merkle_leaf_element(dispatcher_context_t *dispatcher_context,
uint32_t leaf_index,
void (*len_callback)(size_t, void *),
void (*callback)(buffer_t *, void *),
void *callback_state);
void *callback_state);
4 changes: 2 additions & 2 deletions src/handler/lib/stream_merkleized_map_value.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"

/**
Expand All @@ -19,4 +19,4 @@ int call_stream_merkleized_map_value(dispatcher_context_t *dispatcher_context,
int key_len,
void (*len_callback)(size_t, void *),
void (*callback)(buffer_t *, void *),
void *callback_state);
void *callback_state);
2 changes: 1 addition & 1 deletion src/handler/lib/stream_preimage.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <string.h>

#include "../../boilerplate/sw.h"
#include "../../kernel/sw.h"
#include "stream_preimage.h"

#include "../../crypto.h"
Expand Down
2 changes: 1 addition & 1 deletion src/handler/lib/stream_preimage.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"

/**
* Given the hash of a leaf of a Merkle tree, requests the corresponding pre-image to the host. The
Expand Down
6 changes: 3 additions & 3 deletions src/handler/register_wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "os.h"
#include "cx.h"

#include "../boilerplate/dispatcher.h"
#include "../boilerplate/sw.h"
#include "../kernel/dispatcher.h"
#include "../kernel/sw.h"
#include "../common/bip32.h"
#include "../common/merkle.h"
#include "../common/read.h"
Expand Down Expand Up @@ -257,4 +257,4 @@ static bool is_policy_name_acceptable(const char *name, size_t name_len) {
if (name[i] < 0x20 || name[i] > 0x7E) return false;

return true;
}
}
6 changes: 3 additions & 3 deletions src/handler/sign_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include <stdint.h>

#include "boilerplate/io.h"
#include "boilerplate/dispatcher.h"
#include "boilerplate/sw.h"
#include "kernel/io.h"
#include "kernel/dispatcher.h"
#include "kernel/sw.h"
#include "../common/bip32.h"
#include "../commands.h"
#include "../constants.h"
Expand Down
4 changes: 2 additions & 2 deletions src/handler/sign_psbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include "lib_standard_app/crypto_helpers.h"

#include "../boilerplate/dispatcher.h"
#include "../boilerplate/sw.h"
#include "../kernel/dispatcher.h"
#include "../kernel/sw.h"
#include "../common/bitvector.h"
#include "../common/merkle.h"
#include "../common/psbt.h"
Expand Down
4 changes: 2 additions & 2 deletions src/handler/sign_psbt/compare_wallet_script_at_path.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/merkle.h"
#include "../../common/wallet.h"

Expand All @@ -15,4 +15,4 @@ int compare_wallet_script_at_path(dispatcher_context_t *dispatcher_context,
const uint8_t keys_merkle_root[static 32],
uint32_t n_keys,
const uint8_t expected_script[],
size_t expected_script_len);
size_t expected_script_len);
4 changes: 2 additions & 2 deletions src/handler/sign_psbt/extract_bip32_derivation.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "../../boilerplate/dispatcher.h"
#include "../../kernel/dispatcher.h"
#include "../../common/bip32.h"

/**
Expand All @@ -14,4 +14,4 @@ int extract_bip32_derivation(dispatcher_context_t *dc,
const uint8_t values_root[static 32],
uint32_t merkle_tree_size,
int index,
uint32_t out[static 1 + MAX_BIP32_PATH_STEPS]);
uint32_t out[static 1 + MAX_BIP32_PATH_STEPS]);
Loading
Loading