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 invalid private key DER file #2239

Merged
merged 2 commits into from Mar 6, 2019

Conversation

Projects
None yet
5 participants
@cwalther
Copy link
Contributor

commented Nov 28, 2018

Description

The same bug as reported in #1257 and fixed in #1258 for public key output also exists in the private key output: When writing the private key in DER format, the contents of the file are shifted by one byte, which makes it an invalid DER file.

Status

READY

Requires Backporting

Yes: mbedtls-2.1, mbedtls-2.7

Migrations

NO

Todos

Steps to test or reproduce

programs/pkey/gen_key
programs/pkey/key_app_writer mode=private filename=keyfile.key output_mode=private output_file=keyfile.der output_format=der
programs/pkey/key_app mode=private filename=keyfile.der 

Expected result:

  . Loading the private key ... ok
  . Key information    ...
...

Actual result:

  . Loading the private key ... failed
  !  mbedtls_pk_parse_keyfile returned -0x3d00
  !  Last error was: PK - Invalid key tag or value
@cwalther

This comment has been minimized.

Copy link
Contributor Author

commented Nov 28, 2018

ChangeLog: Apparently I’m supposed to make an entry there, but I’m not sure where it should go – I was expecting an “unreleased” section at the top of the file, but don’t see one.
Backports: Am I supposed to make separate pull requests for those, or will the maintainers just cherry-pick the change?

@RonEld

This comment has been minimized.

Copy link
Contributor

commented Nov 28, 2018

@cwalther Thank you for your contribution!

As I believe this is your Mbed account, your CLA is valid.

As for the ChangeLog, if there is no section to put new entries, we simply create one. You can look at this commit for reference.
This usually happens if no PR has been merged since a release, so no section has been created yet

Please make a new commit to htis PR, with the section and the ChangeLog entry

@cwalther

This comment has been minimized.

Copy link
Contributor Author

commented Nov 28, 2018

Thanks for the quick response!

Yes, this is the correct Mbed account.

@RonEld

RonEld approved these changes Dec 4, 2018

@RonEld RonEld requested a review from AndrzejKurek Dec 4, 2018

@RonEld

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

Backports available at #2400 and #2401

@RonEld

This comment has been minimized.

Copy link
Contributor

commented Feb 6, 2019

Both backports have been fully approved, so removing the "needs backports" label.
cc @sbutcher-arm

@RonEld RonEld removed the needs: backports label Feb 6, 2019

@Patater Patater merged commit e0f90f6 into ARMmbed:development Mar 6, 2019

1 of 2 checks passed

continuous-integration/jenkins/pr-head This commit cannot be built
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.