Skip to content

Commit

Permalink
update Ledger CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheirs committed Dec 12, 2023
1 parent cad059b commit 55aad15
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ jobs:
guidelines_enforcer:
name: Call Ledger guidelines_enforcer
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
with:
relative_app_directory: app
run_for_devices: '["nanos", "nanosp", "nanox"]'
1 change: 0 additions & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ endif

APP_LOAD_PARAMS = --curve secp256k1 $(COMMON_LOAD_PARAMS) --path $(APPPATH)

NANOS_STACK_SIZE := 1932
include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices

$(info TARGET_NAME = [$(TARGET_NAME)])
Expand Down
1 change: 1 addition & 0 deletions app/src/common/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "coin.h"
#include "zxerror.h"
#include <stdbool.h>

// transaction initializer for the buffer and transaction type.
void tx_context_fil();
Expand Down
14 changes: 7 additions & 7 deletions app/src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ static zxerr_t crypto_extractPublicKey(uint8_t *pubKey, uint16_t pubKeyLen, uint
privateKeyData,
chainCode,
NULL,
0))
0));

CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_256K1, privateKeyData, 32, &cx_privateKey))
CATCH_CXERROR(cx_ecfp_init_public_key_no_throw(CX_CURVE_256K1, NULL, 0, &cx_publicKey))
CATCH_CXERROR(cx_ecfp_generate_pair_no_throw(CX_CURVE_256K1, &cx_publicKey, &cx_privateKey, 1))
CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_256K1, privateKeyData, 32, &cx_privateKey));
CATCH_CXERROR(cx_ecfp_init_public_key_no_throw(CX_CURVE_256K1, NULL, 0, &cx_publicKey));
CATCH_CXERROR(cx_ecfp_generate_pair_no_throw(CX_CURVE_256K1, &cx_publicKey, &cx_privateKey, 1));
memcpy(pubKey, cx_publicKey.W, SECP256K1_PK_LEN);
error = zxerr_ok;

Expand Down Expand Up @@ -170,16 +170,16 @@ zxerr_t _sign(uint8_t *output, uint16_t outputLen, const uint8_t *message, uint1
privateKeyData,
NULL,
NULL,
0))
0));

CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_256K1, privateKeyData, 32, &cx_privateKey))
CATCH_CXERROR(cx_ecfp_init_private_key_no_throw(CX_CURVE_256K1, privateKeyData, 32, &cx_privateKey));
CATCH_CXERROR(cx_ecdsa_sign_no_throw(&cx_privateKey,
CX_RND_RFC6979 | CX_LAST,
CX_SHA256,
message,
messageLen,
signature->der_signature,
&signatureLength, &tmpInfo))
&signatureLength, &tmpInfo));

const err_convert_e err_c = convertDERtoRSV(signature->der_signature, tmpInfo, signature->r, signature->s, &signature->v);
if (err_c == no_error) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/crypto_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "crypto_helper.h"

// Implementation from methods that are needed for cpp_test
#if !defined (TARGET_NANOS) && !defined(TARGET_NANOS2) && !defined(TARGET_NANOX) && !defined(TARGET_STAX)
#if !defined(LEDGER_SPECIFIC)
#include "blake2.h"

char *crypto_testPubKey;
Expand Down
7 changes: 7 additions & 0 deletions ledger_app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[app]
build_directory = "./app/"
sdk = "C"
devices = ["nanos", "nanox", "nanos+"]

[tests]
unit_directory = "./tests/"

0 comments on commit 55aad15

Please sign in to comment.