fix buffer overflow error and update dependencies

This commit is contained in:
ading2210 2025-01-24 14:39:37 -05:00
parent fe72717db8
commit 94aaca8f22
4 changed files with 14 additions and 16 deletions

View file

@ -1,7 +1,6 @@
import sys
import base64
import re
import hashlib
with open(sys.argv[1]) as f:
pem_file = f.read()
@ -13,15 +12,14 @@ certs_b64 = [s.replace("\n", "") for s in certs_b64]
certs_str = "\n".join(cert_template.format(b64=s) for s in certs_b64)
total_len = len(certs_str)
print(hashlib.sha256(certs_str.encode()).hexdigest(), file=sys.stderr)
header_part_template = """
static uint8_t _cert_{num}[] = {array};
"""
header_end_template = """
uint8_t* _certs[] = {certs_array};
uint16_t cert_lengths[] = {lengths_array};
uint16_t cert_count = {cert_count};
uint16_t _cert_lengths[] = {lengths_array};
uint16_t _cert_count = {cert_count};
"""
header_file = "#include <stdint.h>"