You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fish/fish-webconfig-CVE-2014-291...

29 lines
935 B

11 years ago
commit a7f1e81e6ac23fe4b6fd86023681e2975703078d
Author: Andy Lutomirski <luto@amacapital.net>
Date: Mon Aug 11 18:18:21 2014 -0700
webconfig: Convert authkey to hex correctly
diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py
index 5c7d2b9..43d2ced 100755
--- a/share/tools/web_config/webconfig.py
+++ b/share/tools/web_config/webconfig.py
@@ -17,7 +17,7 @@ else:
from urllib.parse import parse_qs
import webbrowser
import subprocess
-import re, socket, os, sys, cgi, select, time, glob, random, string
+import re, socket, os, sys, cgi, select, time, glob, random, string, binascii
try:
import json
except ImportError:
@@ -654,7 +654,7 @@ where = os.path.dirname(sys.argv[0])
os.chdir(where)
# Generate a 16-byte random key as a hexadecimal string
-authkey = hex(os.urandom(16))[2:]
+authkey = binascii.b2a_hex(os.urandom(16))
# Try to find a suitable port
PORT = 8000