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

TrustStore: Inserter handles chains #3494

Merged
merged 5 commits into from
Dec 10, 2019

Conversation

oncilla
Copy link
Contributor

@oncilla oncilla commented Dec 9, 2019

This PR adds the capability to handle certificate inserts to the inserter.

Fixes #3472


This change is Reviewable

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @lukedirtwalker)


go/lib/infra/modules/trust/v2/main_test.go, line 121 at r2 (raw file):

}

func loadChain(t *testing.T, desc ChainDesc) decoded.Chain {

add help message to all require statements

@scrye scrye self-requested a review December 10, 2019 12:14
Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 6 files at r1, 3 of 3 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @oncilla)


go/lib/infra/modules/trust/v2/inserter.go, line 147 at r2 (raw file):

	if found, err := ins.db.TRCExists(ctx, decTRC); err != nil || found {
		return false, err

I think this changes the semantics of shouldInsertTRC.

Previously, we had:

true, nil -> return false, nil
true, error -> return false, error
false, nil -> continue
false, error -> return true, error

Now, we have:

true, nil -> return false, nil
true, error -> return false, error
false, nil -> continue
false, error -> return false (!), error

Is it intentional?


go/lib/infra/modules/trust/v2/inserter.go, line 199 at r2 (raw file):

		return false, serrors.WrapStr("error validating the certificate chain", err)
	}
	t, err := trcProvider(ctx, chain.Issuer.Subject.I, chain.Issuer.Issuer.TRCVersion)

That Issuer.Issuer does not read nicely. Can one of the fields be renamed to something more appropriate?

Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 4 files reviewed, 3 unresolved discussions (waiting on @oncilla and @scrye)


go/lib/infra/modules/trust/v2/inserter.go, line 147 at r2 (raw file):

Previously, scrye (Sergiu Costea) wrote…

I think this changes the semantics of shouldInsertTRC.

Previously, we had:

true, nil -> return false, nil
true, error -> return false, error
false, nil -> continue
false, error -> return true, error

Now, we have:

true, nil -> return false, nil
true, error -> return false, error
false, nil -> continue
false, error -> return false (!), error

Is it intentional?

I think it makes sense to always return default values on errors. Therefore I changed it.


go/lib/infra/modules/trust/v2/inserter.go, line 199 at r2 (raw file):

Previously, scrye (Sergiu Costea) wrote…

That Issuer.Issuer does not read nicely. Can one of the fields be renamed to something more appropriate?

hm that is kind of hard wired into design already.
https://github.com/scionproto/scion/blob/master/doc/ControlPlanePKI.md#certificate-section-issuer
I think if we want to change it certainly not in this PR.


go/lib/infra/modules/trust/v2/main_test.go, line 121 at r2 (raw file):

Previously, Oncilla wrote…

add help message to all require statements

Done.

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r4.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @scrye)


go/lib/infra/modules/trust/v2/inserter.go, line 199 at r2 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

hm that is kind of hard wired into design already.
https://github.com/scionproto/scion/blob/master/doc/ControlPlanePKI.md#certificate-section-issuer
I think if we want to change it certainly not in this PR.

Agreed, it's not nice to read.
But in the end it is the issuer of an issuer certificate, so 🤷‍♂️

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @scrye)

Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 3 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor Author

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r5.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@lukedirtwalker lukedirtwalker merged commit 2de21b4 into scionproto:master Dec 10, 2019
@oncilla oncilla deleted the pub-trust-inserter branch December 11, 2019 07:53
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.

TrustStore: Merge Inserter
3 participants