Skip to content

Conversation

@tomato42
Copy link
Member

@tomato42 tomato42 commented Apr 29, 2021

Add support for reading and writing curve parameters.

TODO:

  • reading and writing DER EC params
  • reading and writing PEM EC params
  • reading and writing VerifyingKey with explicit params
  • reading and writing SigningKey with explicit params

fixes #39

@tomato42 tomato42 added the feature functionality to be implemented label Apr 29, 2021
@tomato42 tomato42 added this to the v0.17.0 milestone Apr 29, 2021
@tomato42 tomato42 self-assigned this Apr 29, 2021
@lgtm-com
Copy link

lgtm-com bot commented Apr 29, 2021

This pull request introduces 3 alerts when merging b6755ff into b4c4203 - view on LGTM.com

new alerts:

  • 2 for Module-level cyclic import
  • 1 for Unused import

@tomato42 tomato42 force-pushed the explicit-curve-params branch 4 times, most recently from 2b8db09 to 2f355cc Compare May 1, 2021 18:51
@tomato42 tomato42 requested a review from ep69 May 5, 2021 11:02
:term:`uncompressed`, :term:`compressed`, and :term:`hybrid` encodings.
Note: generally you will want to call the from_bytes method of
either a child class, either PointJacobi or Point.
Copy link

Choose a reason for hiding this comment

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

Too much "either", please rephrase.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

:return: x and y coordinates of the encoded point
:rtype: tuple(int, int)
"""
if valid_encodings is None:
Copy link

Choose a reason for hiding this comment

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

Also make sure there is nothing unexpected in valid_encodings?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@classmethod
def setUpClass(cls):
# minimal, but with cofactor (excludes seed when compared to
# OpenSSL output
Copy link

Choose a reason for hiding this comment

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

missing )

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

tomato42 added 7 commits May 21, 2021 00:08
For decoding points it's not necessary to have all the data
useful for decoding public keys.

This will also make it possible to decode explicit EC parameters,
as decoding of a public key requires knowledge of the curve's base
point and the base point is in defined in the parameters, creating
a chicken and an egg problem with using the VerifyingKey.from_string()
to parse the base point.
as some standards, like PKIX in X.509 certificates, don't allow
for explicit curve paramters, provide an API that limits the
supported formats
@tomato42 tomato42 force-pushed the explicit-curve-params branch from 725b3c8 to 77cabc0 Compare May 20, 2021 22:15
Copy link

@ep69 ep69 left a comment

Choose a reason for hiding this comment

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

Re-reviewed the code around my previous comments, no objections.

@tomato42 tomato42 merged commit 634e5b0 into tlsfuzzer:master May 26, 2021
@tomato42 tomato42 deleted the explicit-curve-params branch May 26, 2021 14:31
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 this pull request may close these issues.

Support for keys generated by ecdsatool (explicit curve parameters)

2 participants