-
Notifications
You must be signed in to change notification settings - Fork 128
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 acra-keys list
with keystore v1
#530
Fix acra-keys list
with keystore v1
#530
Conversation
The v1 keystore can have two paths for public and private keys. But most often they are the same. The `ListKeys` function of keystore doesn't check if these paths are the same, and if yes, enumerates all keys twice. Change this by checking the paths.
The filename is `secure_log_key` and it's parsed as a regular client key, which consists of `<client_id>_<purpose>_<kind>`. So in case of `secure_log_key` the client_id is `secure, which is not correct. Fix this by setting empty array as a ClientId.
[skip ci]
} | ||
} | ||
|
||
// copied from `acra-keys list` code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the good reason to move this function to keystore/utils.go
(probably) and use it in tests and acra-tools too, if we already need it in several places) Maybe in the future we will need it in one more place
Removes code duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The result of cossacklabs/acra#530.
* Replace v2 with v1 in some examples * Fix acra-keys list table The result of cossacklabs/acra#530.
This PR fixes issues with
acra-keys
that were discovered at cossacklabs/product-docs#245 (comment).The changes:
keystore.ListKeys
now lists files only once, if public key path is the same as private key one.secure
is no longer interpreted as client idChecklist
with new changes
CHANGELOG.md is updated (in case of notable or breaking changes)Benchmark results are attached (if applicable)Example projects and code samples are up-to-date (in case of API changes)