aboutsummaryrefslogtreecommitdiff
path: root/src/common/get_mozilla_ciphers.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-05-07 23:04:22 -0400
committerNick Mathewson <nickm@torproject.org>2014-05-07 23:04:22 -0400
commit894c8b22662131817e5d7383740b2b285f9b7491 (patch)
treeeaebfdc49fe99042333445bc329512695110f237 /src/common/get_mozilla_ciphers.py
parent14bc6e8993c694702f5ab637c36b962f396660a5 (diff)
parent4231729176c63d28f7adb61074f79464e2ee73a7 (diff)
downloadtor-894c8b22662131817e5d7383740b2b285f9b7491.tar
tor-894c8b22662131817e5d7383740b2b285f9b7491.tar.gz
Merge remote-tracking branch 'public/update_ciphers_ff28' into maint-0.2.4
Diffstat (limited to 'src/common/get_mozilla_ciphers.py')
-rw-r--r--src/common/get_mozilla_ciphers.py30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/common/get_mozilla_ciphers.py b/src/common/get_mozilla_ciphers.py
index c7e9a84a0..0636eb365 100644
--- a/src/common/get_mozilla_ciphers.py
+++ b/src/common/get_mozilla_ciphers.py
@@ -41,12 +41,12 @@ fileA = open(ff('security/manager/ssl/src/nsNSSComponent.cpp'),'r')
inCipherSection = False
cipherLines = []
for line in fileA:
- if line.startswith('static CipherPref CipherPrefs'):
+ if line.startswith('static const CipherPref sCipherPrefs[]'):
# Get the starting boundary of the Cipher Preferences
inCipherSection = True
elif inCipherSection:
line = line.strip()
- if line.startswith('{NULL, 0}'):
+ if line.startswith('{ nullptr, 0}'):
# At the ending boundary of the Cipher Prefs
break
else:
@@ -56,12 +56,30 @@ fileA.close()
# Parse the lines and put them into a dict
ciphers = {}
cipher_pref = {}
+key_pending = None
for line in cipherLines:
- m = re.search(r'^{\s*\"([^\"]+)\",\s*(\S*)\s*}', line)
+ m = re.search(r'^{\s*\"([^\"]+)\",\s*(\S+)\s*(?:,\s*(true|false))?\s*}', line)
if m:
- key,value = m.groups()
- ciphers[key] = value
- cipher_pref[value] = key
+ assert not key_pending
+ key,value,enabled = m.groups()
+ if enabled == 'true':
+ ciphers[key] = value
+ cipher_pref[value] = key
+ continue
+ m = re.search(r'^{\s*\"([^\"]+)\",', line)
+ if m:
+ assert not key_pending
+ key_pending = m.group(1)
+ continue
+ m = re.search(r'^\s*(\S+)(?:,\s*(true|false))?\s*}', line)
+ if m:
+ assert key_pending
+ key = key_pending
+ value,enabled = m.groups()
+ key_pending = None
+ if enabled == 'true':
+ ciphers[key] = value
+ cipher_pref[value] = key
####
# Now find the correct order for the ciphers