Lines Matching +full:- +full:replace
6 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
12 python3 -m unittest translate_cipher.py
32 "+ECDHE-ECDSA:+NULL:+SHA1",
33 "ECDHE-ECDSA-NULL-SHA",
34 "TLS-ECDHE-ECDSA-WITH-NULL-SHA"),
36 "+ECDHE-ECDSA:+AES-128-GCM:+AEAD",
37 "ECDHE-ECDSA-AES128-GCM-SHA256",
38 "TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256"),
40 "+DHE-RSA:+3DES-CBC:+SHA1",
41 "EDH-RSA-DES-CBC3-SHA",
42 "TLS-DHE-RSA-WITH-3DES-EDE-CBC-SHA"),
44 "+RSA:+AES-256-CBC:+SHA1",
45 "AES256-SHA",
46 "TLS-RSA-WITH-AES-256-CBC-SHA"),
48 "+PSK:+3DES-CBC:+SHA1",
49 "PSK-3DES-EDE-CBC-SHA",
50 "TLS-PSK-WITH-3DES-EDE-CBC-SHA"),
53 "ECDHE-ECDSA-CHACHA20-POLY1305",
54 "TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256"),
56 "+ECDHE-ECDSA:+AES-128-CCM:+AEAD",
58 "TLS-ECDHE-ECDSA-WITH-AES-128-CCM"),
61 "ECDHE-ARIA256-GCM-SHA384",
62 "TLS-ECDHE-RSA-WITH-ARIA-256-GCM-SHA384"),
85 # Replace "_" with "-" to handle ciphersuite names based on Mbed TLS
87 s_cipher = s_cipher.replace("_", "-")
89 s_cipher = re.sub(r'\ATLS-', '+', s_cipher)
90 s_cipher = s_cipher.replace("-WITH-", ":+")
91 s_cipher = s_cipher.replace("-EDE", "")
95 if s_cipher[-3:] == "SHA":
98 # CCM or CCM-8 should be followed by ":+AEAD"
99 # Replace "GCM:+SHAxyz" with "GCM:+AEAD"
101 s_cipher = re.sub(r"GCM-SHA\d\d\d", "GCM", s_cipher)
104 # Replace the last "-" with ":+"
106 index = s_cipher.rindex("-")
117 # Replace "_" with "-" to handle ciphersuite names based on Mbed TLS
119 s_cipher = s_cipher.replace("_", "-")
121 s_cipher = re.sub(r'^TLS-', '', s_cipher)
122 s_cipher = s_cipher.replace("-WITH", "")
124 # Remove the "-" from "ABC-xyz"
125 s_cipher = s_cipher.replace("AES-", "AES")
126 s_cipher = s_cipher.replace("CAMELLIA-", "CAMELLIA")
127 s_cipher = s_cipher.replace("ARIA-", "ARIA")
130 s_cipher = re.sub(r'^RSA-', r'', s_cipher)
134 s_cipher = s_cipher.replace("-EDE", "")
135 s_cipher = s_cipher.replace("3DES-CBC", "DES-CBC3")
138 s_cipher = re.sub(r'(?<!DES-)CBC-', r'', s_cipher)
140 # ECDHE-RSA-ARIA does not exist in OpenSSL
141 s_cipher = s_cipher.replace("ECDHE-RSA-ARIA", "ECDHE-ARIA")
148 # If DES is being used, Replace DHE with EDH
150 s_cipher = s_cipher.replace("DHE", "EDH")
160 # Replace "_" with "-"
161 s_cipher = s_cipher.replace("_", "-")