Skip to content
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

ecp_internal.h results in undefined reference #1147

Closed
stevew817 opened this issue Oct 19, 2017 · 3 comments
Closed

ecp_internal.h results in undefined reference #1147

stevew817 opened this issue Oct 19, 2017 · 3 comments
Labels
bug component-crypto Crypto primitives and low-level interfaces

Comments

@stevew817
Copy link
Contributor

Description

  • Type: Bug
  • Priority: Minor

Bug

OS
mbed-OS

mbed TLS build:
Version: 2.6.0
OS version: 5.6 with ARMmbed/mbed-os#4825

Expected behavior
Compilation succeeds without errors nor warnings

Actual behavior
Warning: implicit declaration of function 'mbedtls_internal_ecp_xxx'. This is due to ECP_SHORTWEIERSTRASS being checked in the ecp_internal.h header which is supposed to supply the function prototypes, but the ECP_SHORTWEIERSTRASS define is only set in the ecp.c source file, after the header has already been pulled in.
https://github.com/ARMmbed/mbedtls/blob/005939db984168406d8fed04874379677cdd630f/include/mbedtls/ecp_internal.h#L101

As indicated by @RonEld in ARMmbed/mbed-os#4825 ECP_SHORTWEIERSTRASS is an internal define of mbed TLS and should therefore not be globally defined.

Steps to reproduce
Apply PR and build an mbed-os sample application using mbedTLS ECP.


Enhancement\Feature Request

Suggested enhancement
Remove the check on ECP_SHORTWEIERSTRASS from the header file, since the function prototypes should always be visible.

@RonEld
Copy link
Contributor

RonEld commented Oct 29, 2017

Hi @stevew817 Thanks you for reporting this
We will look in to this to understand what is the best approach to fix this

@ciarmcom
Copy link

ARM Internal Ref: IOTSSL-1860

@RonEld
Copy link
Contributor

RonEld commented Nov 1, 2017

HI @stevew817 I believe that #965 already fixes this issue

simonbutcher pushed a commit to gilles-peskine-arm/mbedtls that referenced this issue Jan 12, 2019
Some internal ECP functions which can be provided as alternative
implementations to accelerate ECC operations were not being included in the
doxygen generated documentation. This is because they were only being included
in the header if the preprocessor symbols ECP_SHORTWEIERSTRASS and
ECP_MONTGOMERY were included. Yet neither symbol is a config.h option, and were
actually symbols that were defined internally in ecp.c, only after
ecp_internal.h had been included.

The missing functions also have no implementation in the library and are only
defined as a means to provide acceleration through 3rd party implementation.

Surrounding the functions by the symbols ECP_SHORTWEIERSTRASS and ECP_MONTGOMERY
therefore is unnecessary, and stops the documentation from including them.

This commit therefore removes those guards.

Fixes Mbed-TLS#1147.
@RonEld RonEld added the component-crypto Crypto primitives and low-level interfaces label Feb 14, 2019
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Jul 2, 2020
Fix Mbed-TLS#941, Mbed-TLS#1412, Mbed-TLS#1147, Mbed-TLS#2017

Signed-off-by: Gilles Peskine <gilles.peskine@arm.com>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Jul 2, 2020
Fix Mbed-TLS#941, Mbed-TLS#1412, Mbed-TLS#1147, Mbed-TLS#2017

Signed-off-by: Gilles Peskine <gilles.peskine@arm.com>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Jul 2, 2020
Fix Mbed-TLS#941, Mbed-TLS#1412, Mbed-TLS#1147, Mbed-TLS#2017

Signed-off-by: Gilles Peskine <gilles.peskine@arm.com>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Jul 22, 2020
Fix Mbed-TLS#941, Mbed-TLS#1412, Mbed-TLS#1147, Mbed-TLS#2017

Signed-off-by: Gilles Peskine <gilles.peskine@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-crypto Crypto primitives and low-level interfaces
Projects
None yet
Development

No branches or pull requests

3 participants