4elta / recon

automate the boring stuff!
GNU General Public License v3.0
8 stars 3 forks source link

BSI recommendation Template wrong toml format #77

Closed Yuuichi89 closed 11 months ago

Yuuichi89 commented 11 months ago

The new BSI Recommendation file for analysing TLS files has a mistake in the [key_exchange]:

[key_exchange]
methods = { 
  RSA = 3000, 
  DSA = 3000, 
  ECDSA = 250, 
  ECDH = 250, 
  DH = 3000 
}

is giving the following exception:

Traceback (most recent call last):
  File "/home/test/tools/recon/analyze.py", line 281, in <module>
    main()
  File "/home/test/tools/recon/analyze.py", line 278, in main
    process(parser.parse_args())
  File "/home/test/tools/recon/analyze.py", line 209, in process
    analyze_service(
  File "/home/test/tools/recon/analyze.py", line 56, in analyze_service
    recommendations = toml.load(f)
                      ^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 66, in load
    return loads(s, parse_float=parse_float)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 102, in loads
    pos = key_value_rule(src, pos, out, header, parse_float)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 326, in key_value_rule
    pos, key, value = parse_key_value_pair(src, pos, parse_float)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 369, in parse_key_value_pair
    pos, value = parse_value(src, pos, parse_float)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 620, in parse_value
    return parse_inline_table(src, pos, parse_float)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 445, in parse_inline_table
    pos, key, value = parse_key_value_pair(src, pos, parse_float)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 360, in parse_key_value_pair
    pos, key = parse_key(src, pos)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 374, in parse_key
    pos, key_part = parse_key_part(src, pos)
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tomllib/_parser.py", line 404, in parse_key_part
    raise suffixed_err(src, pos, "Invalid initial character for a key part")
tomllib.TOMLDecodeError: Invalid initial character for a key part (at line 67, column 13)
4elta commented 11 months ago

should be fixed with #78