Skip to content

When used as a submodule, PSA source files pick up the wrong config.h #141

@gilles-peskine-arm

Description

@gilles-peskine-arm

Description

When Mbed Crypto is used as a submodule in Mbed TLS, only the config.h of Mbed TLS should be used. But PSA source files use the ones in the submodule.

Steps to reproduce:

git clone https://github.com/ARMmbed/mbedtls
cd mbedtls
git submodule update
rm crypto/include/mbedtls/config.h
make

Expected behavior: since Mbed Crypto is used as a submodule in Mbed TLS, the config.h file under crypto should not be used.

Actual behavior:

…
  CC    psa_crypto.c
In file included from ../include/psa/crypto.h:25:0,
                 from psa_crypto.c:31:
../include/psa/crypto_platform.h:41:31: fatal error: ../mbedtls/config.h: No such file or directory
compilation terminated.
Makefile:146: recipe for target 'psa_crypto.o' failed
make[2]: *** [psa_crypto.o] Error 1
Makefile:152: recipe for target 'libmbedcrypto.a' failed
make[1]: *** [libmbedcrypto.a] Error 2
Makefile:19: recipe for target 'lib' failed
make: *** [lib] Error 2

Validation: to make sure that the wrong config.h is not used, we should do a build where its contents are replaced by something that will cause a build error, e.g. #barf.

Issue request type

[ ] Question
[ ] Enhancement
[x] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions