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

Expect bytes in create_ and verify_signature; do not serialize #162

Merged
merged 1 commit into from
Feb 19, 2019

Conversation

awwad
Copy link
Contributor

@awwad awwad commented Jan 10, 2019

This is related to #161.

Currently, ssl's create_signature() and verify_signature() assume they know too much about the data. Rather than just taking bytes, these functions assume the data is compatible with securesystemslib.formats.encode_canonical(), which I don't think is appropriate (and is problematic for using other formats, like ASN.1/DER, which are not).

The caller knows what their data is and how to serialize it (including whether or not to canonicalize it in some fashion); ssl.keys is too low level to be doing this. I talked this over with @lukpueh of in-toto, as the other major client of securesystemslib, and it serves in-toto's interests as well.

Updated testing. Did not touch code style, even though I'd love to....

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

The caller knows what their data is and how to serialize it (including
whether or not to canonicalize it in some fashion); ssl.keys is too
low level to be doing this.  (I talked this over with Lukas and it
serves his interests for in-toto as well.)

Updated testing.  Did not touch code style, even though I'd love to....

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
@awwad awwad requested a review from lukpueh January 10, 2019 20:56
Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

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

Approving this PR and confirming that I also welcome this change (in-toto/in-toto@e5ca543 shows why).

@awwad awwad merged commit beb3109 into master Feb 19, 2019
awwad added a commit that referenced this pull request Apr 3, 2019
Largely resolves Issue #161, especially given the merge of
PR #162.

See GitHub:
#161
#162

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
lukpueh added a commit to lukpueh/securesystemslib that referenced this pull request Aug 13, 2019
Adopt create and verify signature snippets in documentation to
accept data to be signed as bytes instead of strings, as changed
in secure-systems-lab#162.
lukpueh added a commit to lukpueh/securesystemslib that referenced this pull request Aug 14, 2019
Adopt create and verify signature snippets in documentation to
accept data to be signed as bytes instead of strings, as changed
in secure-systems-lab#162.
lukpueh added a commit to lukpueh/in-toto that referenced this pull request Sep 3, 2019
secure-systems-lab/securesystemslib#162 removes data
canonicalization and encoding from signature creation/verification
functions and leaves it to the caller.

This commit changes invocation of sslib signature
creation/verification functions to pass the pre-canonicalized and
-encoded bytes representation of a signable instead of its
dictionary representation, which aligns with the way it calls
gpg signature creation/verification functions.
lukpueh added a commit to lukpueh/in-toto that referenced this pull request Sep 3, 2019
secure-systems-lab/securesystemslib#162 removes data
canonicalization and encoding from signature creation/verification
functions and leaves it to the caller.

This commit changes invocation of sslib signature
creation/verification functions to pass the pre-canonicalized and
-encoded bytes representation of a signable instead of its
dictionary representation, which aligns with the way it calls
gpg signature creation/verification functions.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
lukpueh added a commit to lukpueh/securesystemslib that referenced this pull request Sep 4, 2019
Adopt create and verify signature snippets in documentation to
accept data to be signed as bytes instead of strings, as changed
in secure-systems-lab#162.
lukpueh added a commit to lukpueh/securesystemslib that referenced this pull request Sep 4, 2019
Adopt create and verify signature snippets in documentation to
accept data to be signed as bytes instead of strings, as changed
in secure-systems-lab#162.
lukpueh pushed a commit that referenced this pull request Sep 4, 2019
Largely resolves Issue #161, especially given the merge of
PR #162.

See GitHub:
#161
#162

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
tanishqjasoria pushed a commit to tanishqjasoria/securesystemslib that referenced this pull request Jan 30, 2020
Largely resolves Issue secure-systems-lab#161, especially given the merge of
PR secure-systems-lab#162.

See GitHub:
secure-systems-lab#161
secure-systems-lab#162

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
tanishqjasoria pushed a commit to tanishqjasoria/securesystemslib that referenced this pull request Jan 30, 2020
Adopt create and verify signature snippets in documentation to
accept data to be signed as bytes instead of strings, as changed
in secure-systems-lab#162.
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.

2 participants