Fix linter warnings
This commit is contained in:
parent
1125f87df4
commit
fa3982d07a
7 changed files with 16 additions and 16 deletions
4
core.go
4
core.go
|
@ -304,7 +304,7 @@ func (s *Session) Open(letter *Letter) ([]byte, error) { //nolint:gocognit,gocyc
|
|||
for i := len(s.integratedCiphers) - 1; i >= 0; i-- {
|
||||
data, err = s.integratedCiphers[i].AuthenticatedDecrypt(data, associatedData)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: [%s] %s", ErrIntegrityViolation, s.integratedCiphers[i].Info().Name, err)
|
||||
return nil, fmt.Errorf("%w: [%s] %w", ErrIntegrityViolation, s.integratedCiphers[i].Info().Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -312,7 +312,7 @@ func (s *Session) Open(letter *Letter) ([]byte, error) { //nolint:gocognit,gocyc
|
|||
for i := len(s.ciphers) - 1; i >= 0; i-- {
|
||||
data, err = s.ciphers[i].Decrypt(data)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: decryption failed: [%s] %s", ErrIntegrityViolation, s.ciphers[i].Info().Name, err)
|
||||
return nil, fmt.Errorf("%w: decryption failed: [%s] %w", ErrIntegrityViolation, s.ciphers[i].Info().Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ const (
|
|||
Qui voluptates quod omnis rerum. Soluta dolore quia eius quo similique accusamus. Quisquam fugiat sed voluptatibus eos earum sed. Numquam quia at commodi aut esse ducimus enim.
|
||||
Enim nihil architecto architecto. Reprehenderit at assumenda labore. Et ut sed ut inventore tenetur autem. Iusto et neque ab dolores eum. Praesentium amet sint ut voluptate impedit sit.
|
||||
A accusantium ullam voluptatibus. Adipisci architecto minus dolore tenetur eos. Id illum quo neque laborum numquam laborum animi libero.
|
||||
Debitis voluptatem non aut ex. Et et quis qui aut aut fugit accusantium. Est dolor quia accusantium culpa.
|
||||
Debitis voluptatem non aut ex. Et et quis qui aut fugit accusantium. Est dolor quia accusantium culpa.
|
||||
Facere iste dolor a qui. Earum aut facilis maxime repudiandae magnam. Laborum illum distinctio quo libero corrupti maxime. Eum nam officiis culpa nobis.
|
||||
Et repellat qui ut quaerat error explicabo. Distinctio repudiandae sit dolores nam at. Suscipit aliquam alias ullam id.`
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ func newSession(e *Envelope) (*Session, error) { //nolint:maintidx
|
|||
// final checks
|
||||
// ============
|
||||
|
||||
// check requirements requirements
|
||||
// check requirements
|
||||
if s.toolRequirements.Empty() {
|
||||
return nil, errors.New("envelope excludes all security requirements, no meaningful operation possible")
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ func (s *Session) checkSecurityLevel(levelToCheck int, subject func() string) er
|
|||
switch {
|
||||
case minimumSecurityLevel > 0:
|
||||
// check against minimumSecurityLevel
|
||||
// minimumSecurityLevel overrides other checks
|
||||
// (overrides other checks)
|
||||
if levelToCheck < minimumSecurityLevel {
|
||||
return fmt.Errorf(
|
||||
`%s with a security level of %d is weaker than the desired security level of %d`,
|
||||
|
|
14
suites.go
14
suites.go
|
@ -67,19 +67,19 @@ var (
|
|||
|
||||
// Currently Recommended Suites.
|
||||
|
||||
// SuiteKey is a a cipher suite for encryption with a key.
|
||||
// SuiteKey is a cipher suite for encryption with a key.
|
||||
SuiteKey = SuiteKeyV1
|
||||
// SuitePassword is a a cipher suite for encryption with a password.
|
||||
// SuitePassword is a cipher suite for encryption with a password.
|
||||
SuitePassword = SuitePasswordV1
|
||||
// SuiteRcptOnly is a a cipher suite for encrypting for someone, but without verifying the sender/source.
|
||||
// SuiteRcptOnly is a cipher suite for encrypting for someone, but without verifying the sender/source.
|
||||
SuiteRcptOnly = SuiteRcptOnlyV1
|
||||
// SuiteSign is a a cipher suite for signing (no encryption).
|
||||
// SuiteSign is a cipher suite for signing (no encryption).
|
||||
SuiteSign = SuiteSignV1
|
||||
// SuiteSignFile is a a cipher suite for signing files (no encryption).
|
||||
// SuiteSignFile is a cipher suite for signing files (no encryption).
|
||||
SuiteSignFile = SuiteSignFileV1
|
||||
// SuiteComplete is a a cipher suite for both encrypting for someone and signing.
|
||||
// SuiteComplete is a cipher suite for both encrypting for someone and signing.
|
||||
SuiteComplete = SuiteCompleteV1
|
||||
// SuiteWire is a a cipher suite for network communication, including authentication of the server, but not the client.
|
||||
// SuiteWire is a cipher suite for network communication, including authentication of the server, but not the client.
|
||||
SuiteWire = SuiteWireV1
|
||||
)
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ func suiteBullshitCheck(suite *Suite) error { //nolint:maintidx
|
|||
// final checks
|
||||
// ============
|
||||
|
||||
// check requirements requirements
|
||||
// check requirements
|
||||
if s.toolRequirements.Empty() {
|
||||
return errors.New("suite does not provide any security attributes")
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ type ToolLogic interface {
|
|||
|
||||
// Signet Handling
|
||||
|
||||
// LoadKey loads a key from the Signet's key storage (`Key`) into the Signet's cache (`Loaded*`). If the Signet is marked as public, the storage is expected to only have the public key present, only only it will be loaded.
|
||||
// LoadKey loads a key from the Signet's key storage (`Key`) into the Signet's cache (`Loaded*`). If the Signet is marked as public, the storage is expected to only have the public key present, only it will be loaded.
|
||||
// Must work with a static (no Setup()) ToolLogic.
|
||||
// Must be overridden by tools that declare FeatureKeyExchange, FeatureKeyEncapsulation or FeatureSigning.
|
||||
LoadKey(SignetInt) error
|
||||
|
|
|
@ -58,7 +58,7 @@ func (krts *KeyringTrustStore) GetSignet(id string, recipient bool) (*jess.Signe
|
|||
// Get data from keyring.
|
||||
data, err := keyring.Get(krts.serviceName, id)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: %s", jess.ErrSignetNotFound, err)
|
||||
return nil, fmt.Errorf("%w: %w", jess.ErrSignetNotFound, err)
|
||||
}
|
||||
|
||||
// Parse and return.
|
||||
|
@ -111,7 +111,7 @@ func (krts *KeyringTrustStore) GetEnvelope(name string) (*jess.Envelope, error)
|
|||
// Get data from keyring.
|
||||
data, err := keyring.Get(krts.serviceName, name)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%w: %s", jess.ErrEnvelopeNotFound, err)
|
||||
return nil, fmt.Errorf("%w: %w", jess.ErrEnvelopeNotFound, err)
|
||||
}
|
||||
|
||||
// Parse and return.
|
||||
|
|
Loading…
Add table
Reference in a new issue