Skip to content

Commit

Permalink
Bump ethereum-plugin-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Apr 3, 2024
1 parent 569d064 commit 4014c78
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ethereum-plugin-sdk
7 changes: 5 additions & 2 deletions fuzzing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ set(CMAKE_C_STANDARD_REQUIRED True)
# compatible with ClusterFuzzLite
if (NOT DEFINED ENV{LIB_FUZZING_ENGINE})
set(COMPILATION_FLAGS_ "-fsanitize=fuzzer,address,undefined,signed-integer-overflow")
else()
else()
set(COMPILATION_FLAGS_ "$ENV{LIB_FUZZING_ENGINE} $ENV{CFLAGS}")
endif()
endif()
string(REPLACE " " ";" COMPILATION_FLAGS ${COMPILATION_FLAGS_})

add_compile_options(-Wall -Wextra -g -pedantic)
Expand Down Expand Up @@ -96,6 +96,9 @@ add_executable(fuzz
${ETH_DIR}/src/common_utils.c
${ETH_DIR}/src/plugin_utils.c

# sdk utils
${BOLOS_SDK}src/ledger_assert.c

# cxng
${BOLOS_SDK}/lib_cxng/src/cx_hash.c
${BOLOS_SDK}/lib_cxng/src/cx_sha256.c
Expand Down
9 changes: 9 additions & 0 deletions fuzzing/mocks.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "plugin.h"
#include "lcx_common.h"
#include "lcx_hash.h"
#include <stddef.h>

size_t strlcat(char *dst, const char *src, size_t size) {
size_t srclen; /* Length of source string */
Expand Down Expand Up @@ -33,3 +36,9 @@ size_t strlcpy(char *dst, const char *src, size_t size) {

return (srclen);
}

cx_err_t cx_keccak_256_hash_iovec(const cx_iovec_t *iovec,
size_t iovec_len,
uint8_t digest[static CX_KECCAK_256_SIZE]) {
return CX_OK;
}
1 change: 0 additions & 1 deletion src/handle_query_contract_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ static bool set_beneficiary_ui(ethQueryContractUI_t *msg, context_t *context) {
return getEthAddressStringFromBinary(
context->beneficiary,
msg->msg + 2, // +2 here because we've already prefixed with '0x'.
msg->pluginSharedRW->sha3,
chainid);
}

Expand Down

0 comments on commit 4014c78

Please sign in to comment.