tests/sys_crypto: remove use of BOARD_BLACKLIST variable#12645
tests/sys_crypto: remove use of BOARD_BLACKLIST variable#12645aabadie merged 4 commits intoRIOT-OS:masterfrom
Conversation
|
I could test on an 8bit board (from #12639) and one of the tests is broken. |
a5a0240 to
5952a5a
Compare
|
With the latest version of this PR, |
|
What's the exact error on the AVR platform when using a |
The problem is raising when testing upper bounds of the input_len parameter. If it's above 65535, an error is returned. The problem on 8/16bit architecture is that size_t is not a 32 bit integer, so the parameter value is 0 in this case, resulting in a valid value returned. |
|
Here is the issue on AVR: The comes from the following function Line 139 in 4d279ae size_t.
Do you have suggestions for a better fix ? |
|
I strongly prefer to keep the length field here
I'm wondering if the failing tests are valid for the platforms where Rationale:CCM mode contains a variable length field ( On the AVR platform (and probably also on the 16 bit platforms) What I would do is wrap the tests in: And maybe add an test to verify that the call returns an error when |
Sounds good, I'll update the PR accordingly. |
59e6a2e to
198863f
Compare
|
@bergzand, changed the PR following your suggestion. Directly rebased and squashed. Also tested on atmega256rfr2-xpro and now it works. |
|
@bergzand, may I squash this one ? |
c159dc2 to
7aace2c
Compare
|
On the |
|
@bergzand: I think this is ready to go in 😉 |
7aace2c to
8baac95
Compare
|
@bergzand, OK to squash ? |
Yes, please squash |
The tests doesn't work when length_encoding is above the maximum uint16 value. Also add a set that checks the right error code is returned with too small length_encoding.
8baac95 to
607aa6f
Compare
|
Done! |
Contribution description
This PR tries to get rid of the BOARD_BLACKLIST variable in
tests/sys_cryptoapplication. The approach is to try to fix the integer length issues raised when building on 8/16 bit architectures instead of just blacklisting the corresponding features.While doing, I think I found a potential bug in one of the decrypt function, see 4d214cc. On 8/16 bit architectures, the compiler was failing with "error: comparison is always false due to limited range of data type". Which makes sense when looking at the code.
After all these integer length issues were fixed, it was just a matter of moving some boards to the insufficient memory variable.
The test application now builds fine on some msp430 and AVR based boards.
I haven't tested the test script on MSP430/AVR8 boards because I don't have the hardware with me.
Testing procedure
The following commands should build and work fine (if test is supported):
Issues/PRs references
None