2 # -*- coding: utf-8 -*-
4 # This script read cipher suite list csv file [1] and prints out ECDHE
5 # or DHE with AEAD ciphers only. The output is used by
8 # [1] http://www.iana.org/assignments/tls-parameters/tls-parameters-4.csv
9 # [2] http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml
11 from __future__ import unicode_literals
16 pat = re.compile(r'\ATLS_(?:ECDHE|DHE)_.*_GCM')
19 for hl, name, _, _ in csv.reader(sys.stdin):
20 if not pat.match(name):
23 high, low = hl.split(',')
25 id = high + low[2:] + 'u'
26 ciphers.append((id, name))
31 for id, name in ciphers:
32 print '{} = {},'.format(name, id)
38 for id, name in ciphers:
40 case {}:'''.format(name)