Skip to content

DECLARE_CURVE_SPECS(ECC_CURVE_FIELD_COUNT) makes a NULL spec_ints array #6689

@dientc

Description

@dientc

Version

5.6.3

Description

This issue happens while we try to verify a ECC signature and wc_ecc_verify_hash_ex function is invoked. Inside this function, DECLARE_CURVE_SPECS(ECC_CURVE_FIELD_COUNT) is used to make a spec_ints array.

However, in debugging we've found that marco DECLARE_CURVE_SPECS does not work well, spec_ints is NULL. See attached image. This leads to further crashing.

After having some investigation, we see if we replace ECC_CURVE_FIELD_COUNT by a hardcode (i.e. 5 ) or using a define, then it works well.

I suspect if passing an enum value as a parameter to a macro can cause this problem. I tried some experiment to test a same scenario in other source with my compiler, it still works.

C Compiler: Tasking TriCore

image

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions