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

Compilation for MBEDTLS_ARC4_C disabled and MBEDTLS_CIPHER_NULL_CIPHER enabled #1719

Closed
TrinityTonic opened this issue Jun 12, 2018 · 2 comments · Fixed by #1737
Closed

Compilation for MBEDTLS_ARC4_C disabled and MBEDTLS_CIPHER_NULL_CIPHER enabled #1719

TrinityTonic opened this issue Jun 12, 2018 · 2 comments · Fixed by #1737
Labels

Comments

@TrinityTonic
Copy link

Description

  • Type: Bug
  • Priority: Minor

Bug

mbed TLS build:
Version: 2.9.0 and probably older

Scenario:
Configuration file has MBEDTLS_ARC4_C disabled and MBEDTLS_CIPHER_NULL_CIPHER enabled. This will lead to a compilation error ('mbedtls_cipher_base_t' has no member named 'stream_func') coming from module cipher.c. This is because MBEDTLS_CIPHER_MODE_STREAM is enabled when MBEDTLS_CIPHER_NULL_CIPHER is enabled, which IMO should not be implemented like this.

@RonEld
Copy link
Contributor

RonEld commented Jun 14, 2018

@TrinityTonic thank you for raising this issue!
I believe MBEDTLS_CIPHER_MODE_STREAM should be defined when MBEDTLS_CIPHER_NULL_CIPHER is enabled, as the streram function is null_crypt_stream()
However, this compilation error should not happen, and this needs further investigation.
I believe the root cause is that MBEDTLS_CIPHER_MODE_STREAM is defined in cipher.c, while all the callback functions are defined in cipher_wrap.c, and stream_func is defined in cipher_internal.h
From brief view, I believe the MBEDTLS_CIPHER_MODE_STREAM definition should move to cipher_internal.h

@ciarmcom
Copy link

ARM Internal Ref: IOTSSL-2365

RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 18, 2018
Move definition of `MBEDTLS_CIPHER_MODE_STREAM` to header file
(`mbedtls_cipher_internal.h`), because it is used by more than
one file. Raised by TrinityTonic in Mbed-TLS#1719
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 18, 2018
Add entry in ChangeLog for compilation error fix of Mbed-TLS#1719
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 28, 2018
Move definition of `MBEDTLS_CIPHER_MODE_STREAM` to header file
(`mbedtls_cipher_internal.h`), because it is used by more than
one file. Raised by TrinityTonic in Mbed-TLS#1719
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 28, 2018
Add entry in ChangeLog for compilation error fix of Mbed-TLS#1719
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 28, 2018
Move definition of `MBEDTLS_CIPHER_MODE_STREAM` to header file
(`mbedtls_cipher_internal.h`), because it is used by more than
one file. Raised by TrinityTonic in Mbed-TLS#1719
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 28, 2018
Add entry in ChangeLog for compilation error fix of Mbed-TLS#1719
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jul 1, 2018
Move definition of `MBEDTLS_CIPHER_MODE_STREAM` to header file
(`mbedtls_cipher_internal.h`), because it is used by more than
one file. Raised by TrinityTonic in Mbed-TLS#1719
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jul 1, 2018
Add entry in ChangeLog for compilation error fix of Mbed-TLS#1719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants