Commit 5004375e authored by Szilárd Pfeiffer's avatar Szilárd Pfeiffer
Browse files

Merge branch '174-add-cli-argument-for-strict-rfc2409-compliance'

Closes: #174
parents 4ae9ab34 80f03d54
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -140,6 +140,15 @@ def get_argument_parser():
        analyzers = protocol_handler.get_analyzers()
        parser_analyzer = parsers_analyzer.add_parser(protocol)

        if protocol == 'ikev1':
            parser_analyzer.add_argument(
                '--strict-rfc-2409',
                action='store_true',
                help='Send one Proposal Payload per IKEv1 phase-1 message '
                '(RFC 2409 §5 compliant). Required when probing strict '
                'implementations such as libreswan; significantly slower.',
            )

        parsers_plugin = parser_analyzer.add_subparsers(title='analyzer', dest='analyzer')
        parsers_plugin.required = True
        for analyzer_class in analyzers:
@@ -184,6 +193,10 @@ def main():
    arguments = parser.parse_args()
    protocol_handler, analyzer, targets = get_protocol_handler_analyzer_and_uris(parser, arguments)

    if getattr(arguments, 'strict_rfc_2409', False):
        from cryptolyzer.common.analyzer import AnalyzerIKEBase
        AnalyzerIKEBase._MAX_PROPOSALS_PER_INIT_MESSAGE = 1

    if arguments.output_format == 'highlighted':
        colorama.init(strip=False)
        Serializable.post_text_encoder = SerializableTextEncoderHighlighted()