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

Bring changes from upstream #1

Open
wants to merge 93 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
0482065
Merge pull request #5 from ZondaX/master
TamtamHero May 2, 2019
1aee422
Merge pull request #6 from ZondaX/master
TamtamHero May 3, 2019
e2b4cf4
Merge pull request #7 from ZondaX/master
Jun 13, 2019
7582029
adding target it to getVersion
jleni Jul 1, 2019
af85410
cache pubkeys
jleni Jul 1, 2019
b46201d
Adding heartbeats / bumping to 1.6.1
jleni Aug 29, 2019
25e5f8b
extending stack size
jleni Aug 29, 2019
740e6d9
introducing actions
jleni Sep 3, 2019
1cdc254
fixing actions
jleni Sep 3, 2019
e5d7b95
refactor bip32 path handling
jleni Sep 3, 2019
790e93e
refactor view_{sign_idle}
jleni Sep 3, 2019
493380e
reorganizing txs
jleni Sep 3, 2019
4773cb6
splitting S and X
jleni Sep 3, 2019
bbfb1f6
replacing old views
jleni Sep 3, 2019
4d76445
Fixing paging
jleni Sep 3, 2019
a746dad
fixes
jleni Sep 3, 2019
79f50d6
refactoring parsing. step 1
jleni Oct 1, 2019
f174721
unifying json parsing
jleni Oct 1, 2019
06a7f0f
reduce parameter passing
jleni Oct 1, 2019
16d5b28
encapsulating display functionality
jleni Oct 1, 2019
6b94b7c
removing unnecessary indirection
jleni Oct 1, 2019
1f6354d
abstract away functions
jleni Oct 2, 2019
64adf18
improve initialization
jleni Oct 3, 2019
0f2a63f
refactoring error handling (wip)
jleni Oct 3, 2019
a37e53e
wip
jleni Oct 3, 2019
f0a5096
further improvements
jleni Oct 3, 2019
2afd7cc
struct refactoring
jleni Oct 7, 2019
fc97e91
amount formatter
jleni Oct 9, 2019
f3a52f6
improving workflow
jleni Oct 9, 2019
02dcbf8
reducing max tokens in Nano X
jleni Oct 12, 2019
7297397
using explicit_bzero as per guidelines
jleni Oct 12, 2019
5f4aa0c
refactoring + security improvements
jleni Oct 14, 2019
8ff615b
bump to v2.0.3
jleni Oct 14, 2019
ef97f84
Accept empty fee field
jleni Oct 22, 2019
e16f281
force validation before showing
jleni Oct 22, 2019
60d9b70
Improve tx validation + tests
jleni Oct 27, 2019
8784e97
converting errors correctly
jleni Oct 27, 2019
bf0b4fc
improve handling of empty memo fields
jleni Oct 27, 2019
fb6b177
Merge pull request #9 from ZondaX/master
Nov 13, 2019
90416b4
upgrading to SDK v1.6
jleni Nov 17, 2019
9b74962
cleaning templates
jleni Nov 17, 2019
6855aef
bump to 2.1.4
jleni Nov 17, 2019
22509e2
clarify repo purpose
jleni Nov 18, 2019
235b5ee
partially upgrade to 1.6 FlowUI
jleni Nov 26, 2019
6358143
update zxlib
jleni Dec 6, 2019
57f9294
Remove Tendermint from main menu
jleni Dec 6, 2019
02b5e07
nanoX fix
jleni Dec 13, 2019
a7f7eb4
clean up
jleni Dec 29, 2019
339052d
Merge pull request #8 from ZondaX/nanox_fix
jleni Dec 29, 2019
9e7d9ef
updating zxlib
jleni Dec 30, 2019
dbbf4e0
Merge pull request #9 from ZondaX/master
jleni Dec 30, 2019
d96adcb
Update Makefile
thomas-rj Feb 12, 2020
dd6968d
improve app package
jleni Feb 17, 2020
c571081
Merge pull request #10 from Zondax/master
jleni Feb 17, 2020
835e708
reintroduce load and delete
jleni Mar 2, 2020
ff4df5e
Merge pull request #11 from Zondax/master
jleni Mar 2, 2020
50935ee
workaround for empty strings in nano X
jleni Mar 4, 2020
03529e2
Merge pull request #12 from Zondax/empty_memo
jleni Mar 4, 2020
fde83f4
Add P1 documentation in INS_GET_ADDR_SECP256K1
gagbo Mar 11, 2020
b1b9f62
Merge pull request #13 from gagbo/patch-1
jleni Mar 23, 2020
0df86e4
remove warnings
jleni Mar 5, 2020
a60bd13
Upgrade project structure
jleni Mar 26, 2020
ab25233
upgrade to v3.0.1
jleni Mar 26, 2020
bf841db
disable automatic publishing
jleni Mar 27, 2020
f8f7d07
Merge pull request #14 from Zondax/master
jleni Mar 27, 2020
d736248
Revert version to 2.10.0
jleni Mar 30, 2020
e0a6dc3
Merge pull request #25 from Zondax/master
jleni Mar 30, 2020
f5bfce5
Upgrade to v2.11.0 (#1)
jleni Apr 12, 2020
5f3335d
Merge pull request #26 from Zondax/master
jleni Apr 12, 2020
bbcd6e1
Merge pull request #2 from Zondax/master
TamtamHero Apr 29, 2020
cb88e36
fix hdpath formatting
jleni Apr 30, 2020
b70cf96
upgraded zxlib
jleni May 1, 2020
03c7c50
remove U2F, improve checks
jleni May 2, 2020
0a71fbb
add zemu tests
jleni May 2, 2020
cb3bb53
Update readme
jleni May 2, 2020
db9d352
improving hdpath UI
jleni May 2, 2020
940cd95
clean up + improved zemu tests
jleni May 3, 2020
65a21e9
set zemu link default
jleni May 3, 2020
b645680
adding gitignore/gitkeep
jleni May 3, 2020
3a31913
add latest zxlib
jleni May 3, 2020
c29214f
disable autopublishing
jleni May 3, 2020
4083d58
Fix X compilation issue
jleni May 4, 2020
8b71230
Merge pull request #3 from Zondax/master
hcleonis May 4, 2020
fd2ba8b
Upgrade to Upgrade to v2.13.0 (#2)
jleni Jun 3, 2020
62e2247
Fixing NanoX UI
jleni Jun 5, 2020
8d2b46a
fixing flashing issue
jleni Jun 5, 2020
26a785e
Adding test+fix for combined txs (#3)
jleni Jun 9, 2020
7e20150
Merged PR #5 into v2.14.0
Jun 9, 2020
a511b01
Upgrade to v2.15.0 (#4)
jleni Jun 14, 2020
d11d3aa
Feature/hdpath expert (#5)
jleni Jun 15, 2020
2755e74
do not show gas in simple mode (#6)
jleni Jun 16, 2020
cbd3c8c
fixing Nano X address UI (#7)
jleni Jun 17, 2020
6c194da
only allow skipping review in expert mode
jleni Jun 17, 2020
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
100 changes: 100 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
version: 2
jobs:
build:
docker:
- image: zondax/circleci:latest
steps:
- checkout
- run: git submodule update --init --recursive
- run: cmake -DDISABLE_DOCKER_BUILDS=ON -DCMAKE_BUILD_TYPE=Debug . && make
# Unfortunately need to disable leak sanitizer https://github.com/google/sanitizers/issues/916
# Still run all other ASAN components
- run: GTEST_COLOR=1 ASAN_OPTIONS=detect_leaks=0 ctest -VV

build_ledger:
docker:
- image: zondax/builder-bolos:latest
environment:
- BOLOS_SDK=/home/zondax/project/deps/nanos-secure-sdk
- BOLOS_ENV=/opt/bolos
steps:
- checkout
# Docker entrypoint is not considered
- run: git submodule update --init --recursive
- run:
name: Build
command: |
source /home/zondax/.cargo/env
cd /home/zondax/project
make

test_zemu:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/repo
environment:
BASH_ENV: "/opt/circleci/.nvm/nvm.sh"
steps:
- checkout
- run: git submodule update --init --recursive
- run:
name: Build Ledger app
command: |
make
- run:
name: Install node + yarn
command: |
nvm install 13.12.0
nvm use 13.12.0
npm install -g yarn
- run:
name: Build/Install build js deps
command: |
nvm use 13.12.0
make zemu_install
- run:
name: Workaround/Pull docker
command: |
docker pull zondax/builder-zemu
- run:
name: Run zemu tests
command: |
nvm use 13.12.0
make zemu_test

build_package:
docker:
- image: zondax/builder-bolos:latest
environment:
- BOLOS_SDK=/home/zondax/project/deps/nanos-secure-sdk
- BOLOS_ENV=/opt/bolos
steps:
- checkout
- run: git submodule update --init --recursive
- run:
name: Build
command: |
source /home/zondax/.cargo/env
cd /home/zondax/project
make
- store_artifacts:
path: /home/zondax/project/app/pkg/zxtool.sh
- run: /home/zondax/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete $(/home/zondax/project/app/pkg/zxtool.sh version) /home/zondax/project/app/pkg/zxtool.sh

workflows:
version: 2

default:
jobs:
- build
- build_ledger
- test_zemu
# - build_package:
# requires:
# - build
# - build_ledger
# - test_zemu
# filters:
# branches:
# only:
# - master
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

[*.{c,h,cpp,hpp}]
indent_style = space
indent_size = 4

[*.{yml,sh}]
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://www.jetbrains.com/help/clion/configuring-debugger-options.html#gdbinit-lldbinit
#
# You need to create `$HOME/.gdbinit` with the following content:
# set auto-load local-gdbinit on
# add-auto-load-safe-path /

set architecture arm
handle SIGILL nostop pass noprint
add-symbol-file app/bin/app.elf 0x40000000
set backtrace limit 20
b *0x40000000
116 changes: 71 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,64 +1,90 @@
# Created by .ignore support plugin (hsz.mobi)
### C template
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# OS related files
.DS_Store

# Others
cmake-build-debug/
\.idea/workspace\.xml
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

\cmake-build-debug
\.idea/
src/ledger/bin/
src/ledger/debug/
src/ledger/obj/
src/goclient/vendor
pkg/
src/goclient/goclient

src/ledger/pkgdemo/loaddemo\.sh

src/ledger/pkgdemo/app\.hex

obj/app\.elf
/tmp/
/deps/nano2-sdk/

# Created by cmake
googletest-download/
googletest-src/
googletest-build/
CMakeFiles/
CMakeCache.txt
unittests
*.cmake
Testing/
cmake-build-fuzz/

debug/app\.map

debug/app\.asm

bin/app\.hex

bin/app\.elf

src/glyphs\.h

src/glyphs\.c
# Others
/cmake-build-debug/
/cmake-build-fuzz/
\.idea
/app/bin/
/app/debug/
/app/obj/

\deps/*
!\deps/nanos-secure-sdk
\deps/nano2-sdk
!\deps/ledger-zxlib
!\deps/tinycbor
!\deps/BLAKE

app/src/glyphs.c

app/src/glyphs.h
/build
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "deps/nanos-secure-sdk"]
path = deps/nanos-secure-sdk
url = https://github.com/LedgerHQ/nanos-secure-sdk.git
93 changes: 93 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#*******************************************************************************
#* (c) 2018 Zondax GmbH
#*
#* Licensed under the Apache License, Version 2.0 (the "License");
#* you may not use this file except in compliance with the License.
#* You may obtain a copy of the License at
#*
#* http://www.apache.org/licenses/LICENSE-2.0
#*
#* Unless required by applicable law or agreed to in writing, software
#* distributed under the License is distributed on an "AS IS" BASIS,
#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#* See the License for the specific language governing permissions and
#* limitations under the License.
#********************************************************************************
cmake_minimum_required(VERSION 3.0)
project(ledger-cosmos VERSION 0.0.0)
enable_testing()

cmake_policy(SET CMP0025 NEW)
set(CMAKE_CXX_STANDARD 11)

include(cmake/conan/CMakeLists.txt)
add_subdirectory(cmake/gtest)

string(APPEND CMAKE_CXX_FLAGS " -fsanitize=address -fno-omit-frame-pointer")
string(APPEND CMAKE_LINKER_FLAGS " -fsanitize=address -fno-omit-frame-pointer")

##############################################################
##############################################################
# static libs
file(GLOB_RECURSE JSMN_SRC
deps/jsmn/src/jsmn.c
)

file(GLOB_RECURSE LIB_SRC
app/src/json/json_parser.c
app/src/tx_parser.c
app/src/tx_display.c
app/src/tx_validate.c
app/src/parser.c
app/src/parser_impl.c
deps/ledger-zxlib/app/common/app_mode.c
)

add_library(app_lib STATIC
${LIB_SRC}
${JSMN_SRC}
)

target_include_directories(app_lib PUBLIC
deps/ledger-zxlib/include
deps/jsmn/src
app/src
app/src/common
deps/ledger-zxlib/app/common
)

##############################################################
##############################################################
# Tests
file(GLOB_RECURSE TESTS_SRC
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)

add_executable(unittests ${TESTS_SRC})
target_include_directories(unittests PUBLIC
${gtest_SOURCE_DIR}/include
${gmock_SOURCE_DIR}/include
${CONAN_INCLUDE_DIRS_FMT}
${CONAN_INCLUDE_DIRS_JSONCPP}
deps/jsmn/src
)

target_link_libraries(unittests PRIVATE
gtest_main
app_lib
CONAN_PKG::fmt
CONAN_PKG::jsoncpp)

add_test(unittests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittests)
set_tests_properties(unittests PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests)

file(GLOB_RECURSE FUZZING_SRC
${CMAKE_CURRENT_SOURCE_DIR}/fuzzing/fuzzingMain.cpp
tests/util/common.cpp
)

add_executable(fuzzing_stub ${FUZZING_SRC})
target_include_directories(fuzzing_stub PUBLIC
app/src
deps/jsmn/src
)
target_link_libraries(fuzzing_stub app_lib)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018 ZondaX GmbH
Copyright 2018-2020 Zondax GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading