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

Match changes requested in the RFC process for 1.3 signing #23

Merged
merged 6 commits into from
Dec 15, 2015

Conversation

jaym
Copy link
Contributor

@jaym jaym commented Dec 5, 2015

The message format has been updated. We no longer hash user id and path. Hashing these things is no longer required. The reason they were hashing in v1.0/v1.1 is because the message was directly signed. This meant that there was a limit on the size of the message. v1.3 does not have this requirement as RSASSA-PKCS#1-v1_5 signs a hash of the message.

This function will tell if an Algorithm, Version pair is allowed
Hashing these things is no longer required. The reason
they were hashing in v1.0/v1.1 is because the message
was directly signed. This meant that there was a limit on
the size of the message.

v1.3 does not have this requirement as RSASSA-PKCS#1-v1_5
signs a hash of the message.
@markan
Copy link
Contributor

markan commented Dec 7, 2015

Generally looks good. The cleanup to eliminate the subcomponent hashing is quite worthwhile.

The one change I might make is adding RSA to signing algorithm name (RSA_SHA256or the like)

@jaym
Copy link
Contributor Author

jaym commented Dec 7, 2015

I'm not sure I understand. Do you mean instead of 1.3 use RSA_SHA256?

@btm
Copy link

btm commented Dec 9, 2015

SIGNING_ALGORITHM_RSA_SHA256 ?

@jaym
Copy link
Contributor Author

jaym commented Dec 9, 2015

oh i see the confusion. That constant should really just be called HASHING_ALGORITHM_x. I'm not sure I could change that as it is kind of public, so the SIGNING_ALGORITHM_SHA256 name was chosen to match SIGNING_ALGORITHM_SHA1

@stevendanna
Copy link
Contributor

cc @chef/lob

@markan
Copy link
Contributor

markan commented Dec 10, 2015

@jaym Sorry for not following up on that.
I was proposing changing

-define(SIGNING_ALGORITHM_SHA256, <<"sha256">>).

to
-define(SIGNING_ALGORITHM_RSA_SHA256, <<"rsa_sha256">>).
(along with the natural cascading fixups)

The idea is if in the future we needed to add ecdsa_sha256 or whatever it would be more obvious which encryption algorithm was in play.

@jaym
Copy link
Contributor Author

jaym commented Dec 10, 2015

@manderson26 renamed... I was worried the change wouldn't make sense, but I think it still does. Perhaps a quick glance through what changed, make sure it still reads in a sane way

%% This structure defines allowable hashing algorithms for each signing version.
%% The frist one in the list is considered to be the default if none is
%% specified
-define(SIGNING_VERSIONS, [{?SIGNING_VERSION_V1_0, [?SIGNING_ALGORITHM_SHA1]},
Copy link
Member

Choose a reason for hiding this comment

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

Instead of proplist, can we just have call into a matched fun header in chef_authn.erl? e.g.

signing_protocols_for_version(?SIGNING_VERSION_V1_0) ->
  [?SIGNING_ALGORITHM_SHA1]; 
signing_protocols_for_version(?SIGNING_VERSION_V1_1) -> 
  [?SIGNING_ALGORITHM_SHA1]; 
% etc

@marcparadise
Copy link
Member

This looks good, I just had the one minor comment above.

👍 once implemented

jaym added a commit that referenced this pull request Dec 15, 2015
Match changes requested in the RFC process for 1.3 signing
@jaym jaym merged commit defae88 into master Dec 15, 2015
@stevendanna stevendanna deleted the jdm/v1.3-rfc branch March 2, 2017 16:58
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.

6 participants