inklabs/rangedb

View on GitHub
pkg/crypto/aes/gcm.go

Summary

Maintainability
A
2 hrs
Test Coverage
A
93%

Showing 3 of 3 total issues

Method gcm.decrypt has 6 return statements (exceeds 4 allowed).
Open

func (e *gcm) decrypt(key, sealedCipherText []byte) ([]byte, error) {
if len(sealedCipherText) == 0 {
return nil, crypto.ErrInvalidCipherText
}
 
 
Severity: Major
Found in pkg/crypto/aes/gcm.go - About 40 mins to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    func (e *gcm) Decrypt(base64Key, base64CipherText string) (string, error) {
    key, err := base64.StdEncoding.DecodeString(base64Key)
    if err != nil {
    return "", err
    }
    Severity: Major
    Found in pkg/crypto/aes/gcm.go and 2 other locations - About 55 mins to fix
    pkg/crypto/aes/cbc_pkcs5_padding.go on lines 37..50
    pkg/crypto/xchacha20poly1305/xchacha20poly1305.go on lines 37..50

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    func (e *gcm) Encrypt(base64Key, plainText string) (string, error) {
    key, err := base64.StdEncoding.DecodeString(base64Key)
    if err != nil {
    return "", err
    }
    Severity: Minor
    Found in pkg/crypto/aes/gcm.go and 1 other location - About 45 mins to fix
    pkg/crypto/aes/cbc_pkcs5_padding.go on lines 25..34

    There are no issues that match your filters.

    Category
    Status