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

Verifying a nil commitment silently passes #717

@AMarcedone

Description

@AMarcedone

https://github.com/google/keytransparency/blob/master/core/client/kt/verify.go#L70:

// VerifyCommitment verifies that the commitment in `in` is correct for userID.
func (Verifier) VerifyCommitment(userID, appID string, in *tpb.GetEntryResponse) error {
	if in.Committed != nil {
		entry := new(tpb.Entry)
		if err := proto.Unmarshal(in.GetLeafProof().GetLeaf().GetLeafValue(), entry); err != nil {
			return err
		}
		if err := commitments.Verify(userID, appID, entry.Commitment, in.Committed); err != nil {
			return err
		}
	}
	return nil
}

If in.committed == nil the verification silently passes (no error is thrown). Is this intended? If so, why?
I would expect an error to be raised when Committed == nil

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions