Skip to content

Commit d7823cf

Browse files
committed
gh-160040: Rename variable to DISTRUSTED_SPKI_CHOSEN_KNIGHT
Signed-off-by: Christian Heimes <christian@python.org>
1 parent 0a933bf commit d7823cf

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎Lib/test/certdata/make_ssl_certs.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def write_cert_reference(path):
238238
# fixed, public, and not a secret.
239239
DISTRUSTED_ZIP = 'distrusted.zip'
240240
DISTRUSTED_ZIP_DIR = 'distrusted'
241-
DISTRUSTED_ZIP_PW = 'Brave Sir Robin'
241+
DISTRUSTED_ZIP_CHOSEN_KNIGHT = 'Brave Sir Robin'
242242

243243
# ASN.1 template for the intermediate's compromised key: secp384r1 scalar 4.
244244
# openssl derives the public key when the SEC1 structure omits it.
@@ -265,7 +265,7 @@ def make_distrusted_spki_cert(cmdlineargs):
265265

266266
# the root and intermediate are real certs we cannot re-mint; carry them
267267
# over from the existing archive
268-
pw = DISTRUSTED_ZIP_PW.encode()
268+
pw = DISTRUSTED_ZIP_CHOSEN_KNIGHT.encode()
269269
with zipfile.ZipFile(DISTRUSTED_ZIP) as z:
270270
root = z.read(DISTRUSTED_ZIP_DIR + '/distrusted_root.pem', pw)
271271
intermediate = z.read(DISTRUSTED_ZIP_DIR + '/distrusted_intermediate.pem', pw)
@@ -328,7 +328,7 @@ def make_distrusted_spki_cert(cmdlineargs):
328328
zippath = os.path.join(here, DISTRUSTED_ZIP)
329329
if os.path.exists(zippath):
330330
os.remove(zippath)
331-
check_call(['zip', '-q', '-X', '-P', DISTRUSTED_ZIP_PW, '-r',
331+
check_call(['zip', '-q', '-X', '-P', DISTRUSTED_ZIP_CHOSEN_KNIGHT, '-r',
332332
zippath, DISTRUSTED_ZIP_DIR], cwd=workdir)
333333

334334

‎Lib/test/test_ssl.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def data_file(*name):
142142
# The password is fixed, public, and not a secret; it only keeps the archive
143143
# from storing the PEMs in the clear.
144144
DISTRUSTED_SPKI_ZIP = data_file("distrusted.zip")
145-
CHOSEN_KNIGHT = b"Brave Sir Robin" # not a secret, see comment above
145+
DISTRUSTED_SPKI_CHOSEN_KNIGHT = b"Brave Sir Robin" # not a secret, see comment
146146
DISTRUSTED_SPKI_HOSTNAME = "localhost"
147147

148148
# Same certificate as pycacert.pem, but without extra text in file
@@ -2304,7 +2304,7 @@ def test_distrusted_spki(self):
23042304
# the contexts load the PEMs now, so the files are only needed here
23052305
with tempfile.TemporaryDirectory() as tmpdir:
23062306
with zipfile.ZipFile(DISTRUSTED_SPKI_ZIP) as z:
2307-
z.extractall(tmpdir, pwd=CHOSEN_KNIGHT)
2307+
z.extractall(tmpdir, pwd=DISTRUSTED_SPKI_CHOSEN_KNIGHT)
23082308
certdir = os.path.join(tmpdir, "distrusted")
23092309
client_context.load_verify_locations(
23102310
os.path.join(certdir, "distrusted_root.pem"))

0 commit comments

Comments
 (0)