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

key_app_writer writes wrong public key in der format #1257

Closed
RonEld opened this issue Jan 7, 2018 · 1 comment
Closed

key_app_writer writes wrong public key in der format #1257

RonEld opened this issue Jan 7, 2018 · 1 comment
Labels

Comments

@RonEld
Copy link
Contributor

RonEld commented Jan 7, 2018

Description

  • Type: Bug
  • Priority: Minor
    Reported in the support forum by Aryeh R.

Bug

OS
linux|windows

mbed TLS build:
Version: development
OS version: Ubuntu16.04 and windows10 (irrelevant in this bug)

Expected behavior
parsing the created public key should pass
Actual behavior
parsing the created der public key fails with error -0x3d62
Steps to reproduce

  • Generate a key pair
  • use key_app_writer to write a public key in der format
  • try parsing the public key
./gen_key type=rsa rsa_keysize=4096 filename=rsa_4096_private.der format=der
./key_app_writer mode=private filename=rsa_4096_private.der output_mode=public output_format=der output_file=rsa_4096_public.der
./key_app mode=public filename=rsa_4096_public.der

I believe the bug is here
The - 1 is redundant. It adds a leading zero byte, which causes a failure in the ASN1 parsing, as it is not the expected tag.

RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jan 7, 2018
Remove `- 1` for setting location of output buffer,
which added a leading zero which cause failure in ASN1 parsing.
Fixes Mbed-TLS#1257
@ciarmcom
Copy link

ciarmcom commented Jan 7, 2018

ARM Internal Ref: IOTSSL-1991

RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 26, 2018
Remove `- 1` for setting location of output buffer,
which added a leading zero which cause failure in ASN1 parsing.
Fixes Mbed-TLS#1257
RonEld pushed a commit to RonEld/mbedtls that referenced this issue Jun 26, 2018
Remove `- 1` for setting location of output buffer,
which added a leading zero which cause failure in ASN1 parsing.
Fixes Mbed-TLS#1257
mpg pushed a commit to mpg/mbedtls that referenced this issue Aug 9, 2024
…hmac-document-3.6

Backport 3.6: Document that MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does not force HMAC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants