Skip to content

Commit

Permalink
Add Integrity attribute to Signing Purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Jul 8, 2022
1 parent d74b387 commit 9dffde4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ func setupEnvelopeAndTrustStore(t *testing.T, suite *Suite) (*Envelope, error) {
case tools.PurposeKeyEncapsulation:
e.suite.Provides.Add(RecipientAuthentication)
case tools.PurposeSigning:
e.suite.Provides.Add(Integrity)
e.suite.Provides.Add(SenderAuthentication)
case tools.PurposeIntegratedCipher:
e.suite.Provides.Add(Confidentiality)
Expand Down
1 change: 1 addition & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func newSession(e *Envelope) (*Session, error) { //nolint:maintidx

case tools.PurposeSigning:
s.signers = append(s.signers, logic)
s.toolRequirements.Add(Integrity)
s.toolRequirements.Add(SenderAuthentication)

case tools.PurposeIntegratedCipher:
Expand Down
2 changes: 1 addition & 1 deletion suites.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (
SuiteSignV1 = registerSuite(&Suite{
ID: "sign_v1",
Tools: []string{"Ed25519(BLAKE2b-256)"},
Provides: newEmptyRequirements().Add(SenderAuthentication),
Provides: newEmptyRequirements().Add(Integrity).Add(SenderAuthentication),
SecurityLevel: 128,
Status: SuiteStatusRecommended,
})
Expand Down
2 changes: 2 additions & 0 deletions suites_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func suiteBullshitCheck(suite *Suite) error { //nolint:maintidx

case tools.PurposeSigning:
s.signers = append(s.signers, logic)
s.toolRequirements.Add(Integrity)
s.toolRequirements.Add(SenderAuthentication)

case tools.PurposeIntegratedCipher:
Expand Down Expand Up @@ -417,6 +418,7 @@ func computeSuiteAttributes(toolIDs []string, assumeKey bool) *Suite {
newSuite.Provides.Add(RecipientAuthentication)

case tools.PurposeSigning:
newSuite.Provides.Add(Integrity)
newSuite.Provides.Add(SenderAuthentication)

case tools.PurposeIntegratedCipher:
Expand Down

0 comments on commit 9dffde4

Please sign in to comment.