Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Conversation

@gdbelvin
Copy link
Contributor

@gdbelvin gdbelvin commented Aug 3, 2017

This PR transitions Key Transparency from the KT mapserver implementation onto the Trillian MapEnv which runs a proper trillian map server which more closely replicates KT behavior while using a Trillian backend.

This PR also deletes the now unused code. Closes #229

@gdbelvin gdbelvin force-pushed the trillian_verifier branch 2 times, most recently from e010218 to 0ad94ff Compare August 3, 2017 16:14
@gdbelvin gdbelvin requested review from cesarghali and liamsi August 3, 2017 16:19
@codecov-io
Copy link

codecov-io commented Aug 3, 2017

Codecov Report

Merging #727 into master will decrease coverage by 4.35%.
The diff coverage is 71.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #727      +/-   ##
==========================================
- Coverage   53.22%   48.86%   -4.36%     
==========================================
  Files          38       32       -6     
  Lines        3207     2566     -641     
==========================================
- Hits         1707     1254     -453     
+ Misses       1209     1121      -88     
+ Partials      291      191     -100
Impacted Files Coverage Δ
core/client/kt/verify.go 18.42% <40%> (-1.03%) ⬇️
integration/testutil.go 68.88% <78.57%> (+3.67%) ⬆️
core/tree/sparse/common.go 55.55% <80%> (-22.23%) ⬇️
core/keyserver/keyserver.go 0% <0%> (-36.37%) ⬇️
core/keyserver/validate.go 36.53% <0%> (-30.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f839b54...5a11511. Read the comment docs.

Copy link
Contributor

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for this pull request!

Besides few nits and questions this LGTM

if err != nil {
glog.Exitf("newMapServer: %v", err)
}
mconn, err := grpc.Dial(*mapURL, grpc.WithInsecure())
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not directly related to this pull but is the grpc-connection to the map-server always unencrypted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, Trillian is supposed to be a backend connection, not exposed to the internet so at the moment it's unencrypted.

if err != nil {
glog.Exitf("newReadonlyMapServer(): %v", err)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this new extra line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

// filtering case.
for i, p := range [][]byte{
nil, nil, cp(1), cp(2), nil, nil, cp(3), nil,
nil, cp(1), cp(2), nil, nil, cp(3), nil,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for removing this nil?

Also, if you keep it like this, update the comment above to:

// following profiles:
// [nil, 1, 2, 2, 2, 3, 3, 4, 5, 5, 5, 5, 5, 5, 6, 6, 5, 7, 7].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The trillian map server starts at revision 1 rather than revision 0.
This change shifts the test data by one epoch to accomodate that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation! Could you update the comment to reflect this change as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

{24, 10, 0, []int{24}, codes.OK}, // requesting the very last entry.
{1, 1000000, 17, []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}, codes.OK}, // DOS prevention.
{40, 10, 0, []int{}, codes.InvalidArgument}, // start epoch is beyond current epoch.
{-1, 1, 1, []int{0}, codes.InvalidArgument}, // start epoch is less than 0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this test be moved to integration instead of deleting it? If yes, I'm happy if we merge this pull an open an issue for that (I can give it a shot).

Copy link
Contributor

@liamsi liamsi Aug 3, 2017

Choose a reason for hiding this comment

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

Ah OK. A similar test (testing the same but from the client's perspective) already exist: https://github.com/google/keytransparency/pull/727/files/0ad94ff088be2e59b6832e5e8b258080bf6e0dc4#diff-f8b79d8d11b0c9af5cfa9f8d823cbb91R204

I've missed it because the test in question wasn't really changed. You can simply ignore this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. This functionality is more rigorously tested in integration/client_test.go

@gdbelvin gdbelvin force-pushed the trillian_verifier branch 3 times, most recently from 5d39158 to ae66d5f Compare August 4, 2017 12:11
@gdbelvin gdbelvin force-pushed the trillian_verifier branch from ae66d5f to 5a11511 Compare August 4, 2017 12:15
@liamsi
Copy link
Contributor

liamsi commented Aug 4, 2017

LGTM

@gdbelvin gdbelvin merged commit 14151ff into google:master Aug 4, 2017
@gdbelvin gdbelvin deleted the trillian_verifier branch August 4, 2017 12:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete Stale Code

3 participants