mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1894783 - check cert format in gen_cert_header.py. r=nkulatova
Differential Revision: https://phabricator.services.mozilla.com/D209285
This commit is contained in:
parent
49e35282ae
commit
23814bc74f
@ -7,6 +7,9 @@ def _file_byte_generator(filename):
|
||||
with open(filename, "rb") as f:
|
||||
contents = f.read()
|
||||
|
||||
if b"-----BEGIN CERTIFICATE-----" in contents:
|
||||
raise Exception(f"{filename} contains a PEM certificate. Expected DER.")
|
||||
|
||||
# Treat empty files the same as a file containing a lone 0;
|
||||
# a single-element array will fail cert verifcation just as an
|
||||
# empty array would.
|
||||
|
Loading…
Reference in New Issue
Block a user