tlsfuzzer/tlslite-ng

View on GitHub

Showing 1,708 of 1,708 total issues

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

        if (
            next((i for i in settings.versions if i >= (3, 4)), None)
            and settings.certificate_compression_receive
        ):
            algos_numbers = [getattr(CertificateCompressionAlgorithm, algo)
Severity: Major
Found in tlslite/tlsconnection.py and 2 other locations - About 45 mins to fix
tlslite/tlsconnection.py on lines 2559..2564
tlslite/tlsconnection.py on lines 4397..4402

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            for result in self._getMsg(ContentType.handshake, expected_msg,
                                       CertificateType.x509):
                if result in (0, 1):
                    yield result
Severity: Major
Found in tlslite/tlsconnection.py and 2 other locations - About 45 mins to fix
tlslite/tlsconnection.py on lines 1375..1378
tlslite/tlsconnection.py on lines 3061..3064

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if settings:
                algos_numbers = [
                    getattr(CertificateCompressionAlgorithm, algo) for algo
                    in settings.certificate_compression_receive
                ]
Severity: Major
Found in tlslite/tlsconnection.py and 2 other locations - About 45 mins to fix
tlslite/tlsconnection.py on lines 827..834
tlslite/tlsconnection.py on lines 4397..4402

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if not ver_func(certificate_verify.signature,
                            signature_context,
                            pad_type,
                            hash_name,
                            salt_len):
Severity: Major
Found in tlslite/tlsconnection.py and 2 other locations - About 45 mins to fix
tlslite/tlsconnection.py on lines 4552..4560
tlslite/tlsrecordlayer.py on lines 890..896

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if label in [b"extended master secret", b"server finished",
                    b"client finished"]:
                seed = handshake_hashes.digest('sha384')
            else:
                assert label in [b"key expansion", b"master secret"]
Severity: Minor
Found in tlslite/mathtls.py and 1 other location - About 45 mins to fix
tlslite/mathtls.py on lines 894..898

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                if sig_alg_for_curve not in settings.ecdsaSigHashes:
                    for result in self._sendError(
                            AlertDescription.illegal_parameter,
                            "Peer selected certificate with ECDSA curve we "
                            "did not advertise support for: {0}"
Severity: Minor
Found in tlslite/tlsconnection.py and 1 other location - About 45 mins to fix
tlslite/tlsconnection.py on lines 2006..2011

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if label in [b"extended master secret", b"server finished",
                    b"client finished"]:
                seed = handshake_hashes.digest('sha256')
            else:
                assert label in [b"key expansion", b"master secret"]
Severity: Minor
Found in tlslite/mathtls.py and 1 other location - About 45 mins to fix
tlslite/mathtls.py on lines 886..890

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        elif self.anon:
            tlsConnection.handshakeClientAnonymous(session=self.tlsSession,
                                                   settings=self.settings,
                                                   checker=self.checker,
                                                   serverName=self.serverName)
Severity: Minor
Found in tlslite/integration/clienthelper.py and 1 other location - About 45 mins to fix
tlslite/integration/clienthelper.py on lines 144..150

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        if self.username and self.password:
            tlsConnection.handshakeClientSRP(username=self.username,
                                             password=self.password,
                                             checker=self.checker,
                                             settings=self.settings,
Severity: Minor
Found in tlslite/integration/clienthelper.py and 1 other location - About 45 mins to fix
tlslite/integration/clienthelper.py on lines 151..162

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            self.session.cl_app_secret, self.session.sr_app_secret = self._recordLayer.\
                calcTLS1_3KeyUpdate_sender(
                    self.session.cipherSuite,
                    self.session.cl_app_secret,
                    self.session.sr_app_secret)
Severity: Minor
Found in tlslite/tlsrecordlayer.py and 1 other location - About 45 mins to fix
tlslite/tlsrecordlayer.py on lines 1535..1539

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if cert_type not in settings.more_sig_schemes:
                for result in self._sendError(
                        AlertDescription.handshake_failure,
                        "Peer sent certificate we did not advertise support "
                        "for: {0}".format(cert_type)):
Severity: Minor
Found in tlslite/tlsconnection.py and 1 other location - About 45 mins to fix
tlslite/tlsconnection.py on lines 1992..1998

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        self.session.cl_app_secret, self.session.sr_app_secret = \
            self._recordLayer.calcTLS1_3KeyUpdate_reciever(
                    self.session.cipherSuite,
                    self.session.cl_app_secret,
                    self.session.sr_app_secret)
Severity: Minor
Found in tlslite/tlsrecordlayer.py and 1 other location - About 45 mins to fix
tlslite/tlsrecordlayer.py on lines 1502..1506

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

            if (
                symbols[0] == symbols[1] or symbols[0] == symbols[2] or
                symbols[0] == symbols[3] or symbols[1] == symbols[2] or
                symbols[1] == symbols[3] or symbols[2] == symbols[3]
            ):
Severity: Major
Found in tlslite/utils/brotlidecpy/decode.py - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                    if self.public_key == other.public_key and\
                       self.min_generation == other.min_generation and\
                       self.generation == other.generation and\
                       self.expiration == other.expiration and\
                       self.target_hash == other.target_hash and\
    Severity: Major
    Found in tlslite/extensions.py - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                  if hasattr(other, 'public_key') and\
                          hasattr(other, 'min_generation') and\
                          hasattr(other, 'generation') and\
                          hasattr(other, 'expiration') and\
                          hasattr(other, 'target_hash') and\
      Severity: Major
      Found in tlslite/extensions.py - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                        if not session and \
                                (not ticket_ext or ticket_ext and not ticket_ext.ticket)\
                                and sessionCache and clientHello.session_id:
                            # Session ID resumption is allowed only if the client
                            # didn't send a ticket
        Severity: Major
        Found in tlslite/tlsconnection.py - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if cipherSuite in CipherSuite.srpAllSuites:
                      for result in self._serverSRPKeyExchange(clientHello, serverHello,
                                                               verifierDB, cipherSuite,
                                                               privateKey, cert_chain,
                                                               settings):
          Severity: Major
          Found in tlslite/tlsconnection.py - About 40 mins to fix

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

                    for result in self._getMsg(ContentType.handshake,
                                               HandshakeType.encrypted_extensions):
                        if result in (0, 1):
                            yield result
            Severity: Major
            Found in tlslite/tlsconnection.py and 9 other locations - About 40 mins to fix
            tlslite/tlsconnection.py on lines 937..939
            tlslite/tlsconnection.py on lines 1049..1052
            tlslite/tlsconnection.py on lines 1392..1395
            tlslite/tlsconnection.py on lines 1790..1793
            tlslite/tlsconnection.py on lines 3079..3082
            tlslite/tlsconnection.py on lines 3249..3251
            tlslite/tlsconnection.py on lines 3978..3981
            tlslite/tlsconnection.py on lines 4476..4479
            tlslite/tlsrecordlayer.py on lines 840..843

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 37.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                        for result in self._getMsg(ContentType.handshake,
                                                   HandshakeType.server_hello):
                            if result in (0, 1):
                                yield result
            Severity: Major
            Found in tlslite/tlsconnection.py and 9 other locations - About 40 mins to fix
            tlslite/tlsconnection.py on lines 937..939
            tlslite/tlsconnection.py on lines 1301..1304
            tlslite/tlsconnection.py on lines 1392..1395
            tlslite/tlsconnection.py on lines 1790..1793
            tlslite/tlsconnection.py on lines 3079..3082
            tlslite/tlsconnection.py on lines 3249..3251
            tlslite/tlsconnection.py on lines 3978..3981
            tlslite/tlsconnection.py on lines 4476..4479
            tlslite/tlsrecordlayer.py on lines 840..843

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 37.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                def makeClientKeyExchange(self):
                    """Make client key exchange for ECDHE"""
                    cke = super(AECDHKeyExchange, self).makeClientKeyExchange()
                    cke.createECDH(self.ecdhYc)
                    return cke
            Severity: Major
            Found in tlslite/keyexchange.py and 3 other locations - About 40 mins to fix
            tlslite/keyexchange.py on lines 560..564
            tlslite/keyexchange.py on lines 640..644
            tlslite/keyexchange.py on lines 881..885

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 37.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language