docker/swarmkit

View on GitHub
ca/pkcs8/pkcs8.go

Summary

Maintainability
A
1 hr
Test Coverage

Function DecryptPEMBlock has 7 return statements (exceeds 4 allowed).
Open

func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error) {
    der := block.Bytes

    var privKey encryptedPrivateKeyInfo
    if _, err := asn1.Unmarshal(der, &privKey); err != nil {
Severity: Major
Found in ca/pkcs8/pkcs8.go - About 45 mins to fix

    Function ConvertToECPrivateKeyPEM has 5 return statements (exceeds 4 allowed).
    Open

    func ConvertToECPrivateKeyPEM(inPEM []byte) ([]byte, error) {
        block, _ := pem.Decode(inPEM)
        if block == nil {
            return nil, errors.New("invalid pem bytes")
        }
    Severity: Major
    Found in ca/pkcs8/pkcs8.go - About 35 mins to fix

      Function ConvertECPrivateKeyPEM has 5 return statements (exceeds 4 allowed).
      Open

      func ConvertECPrivateKeyPEM(inPEM []byte) ([]byte, error) {
          block, _ := pem.Decode(inPEM)
          if block == nil {
              return nil, errors.New("invalid pem bytes")
          }
      Severity: Major
      Found in ca/pkcs8/pkcs8.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status