Skip to content

Conversation

DorKatzelnick
Copy link
Contributor

  • add consnter info to router config
  • add router info to consenter config
  • router's certificate pinning in SubmitConfig
  • add configSubmitter to router, without forwarding config requests

issue: #192

config/config.go Outdated
}
func (config *Configuration) ExtractRouterInParty() nodeconfig.RouterInfo {
partyID := config.LocalConfig.NodeLocalConfig.PartyID
party := config.SharedConfig.PartiesConfig[partyID-1]
Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot assume that PartiesConfig[partyID-1] corresponds to the correct party.
Instead, you should iterate over PartiesConfig and check if PartiesConfig[i].PartyID == partyID.

config/config.go Outdated
func (config *Configuration) ExtractConsenterInParty() nodeconfig.ConsenterInfo {
partyID := config.LocalConfig.NodeLocalConfig.PartyID
consenterInfos := config.ExtractConsenters()
return consenterInfos[partyID-1]
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, loop over consenterInfos to find the correct party


// compare the two certificates
if !bytes.Equal(pemBlock.Bytes, cert.Raw) {
return fmt.Errorf("error: access denied; client certificatte is different than the router's certificate")
Copy link
Contributor

Choose a reason for hiding this comment

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

client certificate is different from the router's certificate.

func (sc *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error) {
return nil, fmt.Errorf("SubmitConfig not implemented")
func (c *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error) {
err := c.validateRouterFromContext(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

you can do this in the same line with the if statement

func (c *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error) {
err := c.validateRouterFromContext(ctx)
if err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe wrap the err

add router info to consenter config
router's certificate pinning in SubmitConfig
add configSubmitter to router, without forwarding config requests

Signed-off-by: Dor.Katzelnick <Dor.Katzelnick@ibm.com>
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.

3 participants