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

Loading veryfying key from pem or der always defaults to sha1 hash function #72

Closed
bar-bog opened this issue Jul 12, 2017 · 1 comment · Fixed by #167
Closed

Loading veryfying key from pem or der always defaults to sha1 hash function #72

bar-bog opened this issue Jul 12, 2017 · 1 comment · Fixed by #167
Assignees
Labels
feature functionality to be implemented
Milestone

Comments

@bar-bog
Copy link

bar-bog commented Jul 12, 2017

Hi,
first I want to say that your package is great :) Helped me a lot while testing ecdsa on my device.
I have noticed that when you read the verifying key from pem or der format you can't specify hashing function and it defaults to sha1. I think it would be great to have it as a parameter as public key does not specify it.
Maybe I could help you with contribution?

@tomato42
Copy link
Member

tomato42 commented Sep 5, 2018

the default hash function is a public field of the class:
https://github.com/warner/python-ecdsa/blob/0d3d29e9cbc002cae610974b7d934b9accd8134a/src/ecdsa/keys.py#L31

so you can change it after loading it from the file

that being said, both from_string and from_public_point accept the default hash function (the hashfunc parameter), so I don't see why from_pem and from_der couldn't be extended similarly

@tomato42 tomato42 added this to the someday/future milestone Sep 5, 2018
@tomato42 tomato42 added help wanted feature functionality to be implemented labels Sep 5, 2018
@tomato42 tomato42 modified the milestones: someday/future, v0.15 Oct 7, 2019
@tomato42 tomato42 self-assigned this Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature functionality to be implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants