-
-
Notifications
You must be signed in to change notification settings - Fork 709
Update libtropic
and ts-tvl
#5424
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
Conversation
[no changelog]
[no changelog]
[no changelog]
[no changelog]
[no changelog]
[no changelog]
|
model | device_test | click_test | persistence_test |
---|---|---|---|
T2T1 | |||
T3B1 | |||
T3T1 | |||
T3W1 |
Latest CI run: 16523575572
d99c71c
to
e3fe064
Compare
[no changelog]
e3fe064
to
3236769
Compare
@@ -86,6 +88,8 @@ def configure( | |||
paths += ["vendor/libtropic/src"] | |||
defines += ["USE_TREZOR_CRYPTO"] | |||
defines += [("LT_USE_TREZOR_CRYPTO", "1")] | |||
# This is a workaround for an error caused by the redefinition of the macro `STATIC`, which is initially defined in `SConscript.unix` and later redefined in `libtropic_common.h`. As an adverse effect of defining `TEST`, all functions declared in `libtropic.c` become non-static, causing `lt_asn1_der.c` to be compiled even though it is not used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to fix this issue properly. @cepetr Could you help me with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STATIC
is defined not only in SConscript.unix
, but also in mpconfig.h
, which is included (and heavily used) in many micropython C files, as well as in our modtrezorxxx
files. Since we also include libtropic
in these files, this causes a collision. Somebody needs to step aside... and it's probably not going to be MicroPython.
I believe no library should use the STATIC
symbol in its public interface, as libtropic
currently does. BTW, there's a similar potential issue with the UNUSED
symbol, which need not (and should not) be defined in libtropic_common.h
.
I think the easiest and the most correct solution is to rename STATIC
to LT_STATIC
(or something similar) on the libtropic
side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the easiest and the most correct solution is to rename STATIC to LT_STATIC (or something similar) on the libtropic side.
Hmm, I was hoping we could find a more elegant solution. I opened tropicsquare/libtropic#177.
I believe no library should use the STATIC symbol in its public interface, as libtropic currently does. BTW, there's a similar potential issue with the UNUSED symbol, which need not (and should not) be defined in libtropic_common.h.
It seems to me that this should not be a problem, as UNUSED
is used only within libtropic
's *.c
files, and these files do not include our header files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We include libtropic.h
, that includes libtropic_common.h
, so there's potential collision with our definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I didn't realize that UNUSED
is defined in libtropic.h
, even though it doesn't need to be, since it is only used in *.c
files.
Closing in favour of #5525. |
This pull request builds on of #5416 (the oldest commit) and #5421 (the second oldest commit).
The pull request updates
libtropic
andts-tvl
to their latest stable releases.As side effect, it removes the
tropic.get_certificate()
function, which I found no use for in the firmware and which depends on alibtropic
function whose API has changed.