The selftest program fails with MBEDTLS_CTR_DRBG_USE_128_BIT_KEY #290

Closed
opened 2019-10-07 08:52:22 -05:00 by gilles-peskine-arm · 2 comments
gilles-peskine-arm commented 2019-10-07 08:52:22 -05:00 (Migrated from github.com)

Description

Steps to reproduce:

scripts/config.pl set MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
make
programs/test/selftest ctr_drbg

Expected behavior: passed

Actual behavior: failed

Reason for the failure: we only have test data with AES-256, not with AES-128.

Reasons this was not detected before:

  • We normally run self-tests as part of the test suite, but the test case in test_suite_ctr_drbg.data has depends_on:!MBEDTLS_CTR_DRBG_USE_128_BIT_KEY, so the selftest is skipped when using AES-128. No such skipping happens in the selftest program.
  • Even if we did run the selftests from the test suite, we don't actually enable MBEDTLS_CTR_DRBG_USE_128_BIT_KEY anywhere in all.sh (https://github.com/ARMmbed/mbed-crypto/issues/289).

How I detected this: in https://github.com/ARMmbed/mbed-crypto/pull/287 I moved MBEDTLS_CTR_DRBG_USE_128_BIT_KEY to the mbed TLS feature support section where it belongs, so it got picked up by config.pl full. We do run selftest in that configuration on the CI, albeit only on Windows.

Issue request type

[ ] Question
[ ] Enhancement
[ ] Bug
### Description Steps to reproduce: ``` scripts/config.pl set MBEDTLS_CTR_DRBG_USE_128_BIT_KEY make programs/test/selftest ctr_drbg ``` Expected behavior: `passed` Actual behavior: `failed` Reason for the failure: we only have test data with AES-256, not with AES-128. Reasons this was not detected before: * We normally run self-tests as part of the test suite, but the test case in `test_suite_ctr_drbg.data` has `depends_on:!MBEDTLS_CTR_DRBG_USE_128_BIT_KEY`, so the selftest is skipped when using AES-128. No such skipping happens in the selftest program. * Even if we did run the selftests from the test suite, we don't actually enable `MBEDTLS_CTR_DRBG_USE_128_BIT_KEY` anywhere in `all.sh` (https://github.com/ARMmbed/mbed-crypto/issues/289). How I detected this: in https://github.com/ARMmbed/mbed-crypto/pull/287 I moved `MBEDTLS_CTR_DRBG_USE_128_BIT_KEY` to the `mbed TLS feature support` section where it belongs, so it got picked up by `config.pl full`. We do run `selftest` in that configuration on the CI, albeit only on Windows. ### Issue request type [ ] Question [ ] Enhancement [ ] Bug
ciarmcom commented 2019-10-07 10:58:07 -05:00 (Migrated from github.com)

Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-945

*Internal Jira reference: https://jira.arm.com/browse/IOTCRYPT-945*
adbridge commented 2019-11-04 06:17:50 -06:00 (Migrated from github.com)

Apologies, this was closed in error by the automated bot - re-opening.

Apologies, this was closed in error by the automated bot - re-opening.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-ARMmbed/mbed-crypto#290
No description provided.