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

Fix delegation key import/export GUN inference logic #1067

Merged

Conversation

riyazdf
Copy link
Contributor

@riyazdf riyazdf commented Dec 21, 2016

The logic to infer the GUN from the path PEM header will panic when importing an exported delegation key. This is because the path will look like tuf_keys/<KEY_ID> and this logic will attempt to shorten an empty string slice: https://github.com/docker/notary/blob/v0.4.2/utils/keys.go#L114

This only affects v0.4.2 - the integration test I added here passes on master without any other code changes. Targeting a v0.4.3 hotfix, if we are to release one.

Closes #1066

@riyazdf riyazdf changed the title Delegation key import export Fix delegation key import export gun inference Dec 21, 2016
@riyazdf riyazdf changed the title Fix delegation key import export gun inference Fix delegation key import/export GUN inference logic Dec 21, 2016
@riyazdf riyazdf force-pushed the delegation-key-import-export branch 2 times, most recently from c617fb5 to ba2f421 Compare December 23, 2016 01:53
… slash

Also updates a test to fix the expected vs actual values.

Signed-off-by: Riyaz Faizullabhoy <[email protected]>
@riyazdf riyazdf force-pushed the delegation-key-import-export branch from ba2f421 to fe187a2 Compare December 23, 2016 02:57
Copy link
Contributor

@endophage endophage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! LGTM

@cyli cyli merged commit 9211198 into notaryproject:hotfix/0.4.3 Jan 3, 2017
@riyazdf riyazdf deleted the delegation-key-import-export branch January 3, 2017 22:25
@chengjinshengtaichanyejituan

keyihebingma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants