File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
src/model_signing/_signing Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,11 @@ def __init__(
7272 "the public key paired with the private key"
7373 )
7474
75- self ._trust_chain = x509 .load_pem_x509_certificates (
76- b"" .join ([path .read_bytes () for path in certificate_chain_paths ])
75+ chain_bytes = b"" .join (
76+ [path .read_bytes () for path in certificate_chain_paths ]
77+ )
78+ self ._trust_chain = (
79+ x509 .load_pem_x509_certificates (chain_bytes ) if chain_bytes else []
7780 )
7881
7982 @override
Original file line number Diff line number Diff line change @@ -244,16 +244,21 @@ def __init__(
244244 "the public key paired with the private key"
245245 )
246246
247- self ._trust_chain = x509 .load_pem_x509_certificates (
248- b"" .join ([path .read_bytes () for path in certificate_chain_paths ])
247+ chain_bytes = b"" .join (
248+ [path .read_bytes () for path in certificate_chain_paths ]
249+ )
250+ self ._trust_chain = (
251+ x509 .load_pem_x509_certificates (chain_bytes ) if chain_bytes else []
249252 )
250253
251254 @override
252255 def _get_verification_material (self ) -> bundle_pb .VerificationMaterial :
253256 def _to_protobuf_certificate (certificate ):
254257 return common_pb .X509Certificate (
255- raw_bytes = certificate .public_bytes (
256- encoding = serialization .Encoding .DER
258+ raw_bytes = base64 .b64encode (
259+ certificate .public_bytes (
260+ encoding = serialization .Encoding .DER
261+ )
257262 )
258263 )
259264
@@ -268,5 +273,6 @@ def _to_protobuf_certificate(certificate):
268273 return bundle_pb .VerificationMaterial (
269274 x509_certificate_chain = common_pb .X509CertificateChain (
270275 certificates = chain
271- )
276+ ),
277+ tlog_entries = [],
272278 )
You can’t perform that action at this time.
0 commit comments