[PATCH 2/6] binman: x509_cert: allow and parse distinguished-name subnode
Rasmus Villemoes
ravi at prevas.dk
Fri Jul 10 14:36:14 CEST 2026
Currently, the ti-secure and ti-secure-rom types hardcode the contents
of the Distinguished Name section. Those values are not necessarily
appropriate for all boards that just happen to include a SOC produced
by TI.
Allow placing a distinguished-name subnode inside the binman node
representing the Entry_x509_cert (or derived classes), and if present,
use that information.
Signed-off-by: Rasmus Villemoes <ravi at prevas.dk>
---
tools/binman/etype/ti_secure.py | 3 ++-
tools/binman/etype/ti_secure_rom.py | 3 ++-
tools/binman/etype/x509_cert.py | 5 +++++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/binman/etype/ti_secure.py b/tools/binman/etype/ti_secure.py
index f6caa0286d9..0d8ade9b634 100644
--- a/tools/binman/etype/ti_secure.py
+++ b/tools/binman/etype/ti_secure.py
@@ -117,7 +117,8 @@ class Entry_ti_secure(Entry_x509_cert):
self.firewall_cert_data['auth_in_place'] = auth_in_place
self.ReadFirewallNode()
self.sha = fdt_util.GetInt(self._node, 'sha', 512)
- self.req_dist_name = {'C': 'US',
+ if self.req_dist_name is None:
+ self.req_dist_name = {'C': 'US',
'ST': 'TX',
'L': 'Dallas',
'O': 'Texas Instruments Incorporated',
diff --git a/tools/binman/etype/ti_secure_rom.py b/tools/binman/etype/ti_secure_rom.py
index 7e90c655940..ec49fa51739 100644
--- a/tools/binman/etype/ti_secure_rom.py
+++ b/tools/binman/etype/ti_secure_rom.py
@@ -80,7 +80,8 @@ class Entry_ti_secure_rom(Entry_x509_cert):
self.dm_data = fdt_util.GetBool(self._node, 'dm-data', False)
if self.dm_data:
self.load_addr_dm_data = fdt_util.GetInt(self._node, 'load-dm-data', 0x00000000)
- self.req_dist_name = {'C': 'US',
+ if self.req_dist_name is None:
+ self.req_dist_name = {'C': 'US',
'ST': 'TX',
'L': 'Dallas',
'O': 'Texas Instruments Incorporated',
diff --git a/tools/binman/etype/x509_cert.py b/tools/binman/etype/x509_cert.py
index b6e8b0b4fb0..ee4c74db6f9 100644
--- a/tools/binman/etype/x509_cert.py
+++ b/tools/binman/etype/x509_cert.py
@@ -61,6 +61,11 @@ class Entry_x509_cert(Entry_collection):
self.key_fname = self.GetEntryArgsOrProps([
EntryArg('keyfile', str)], required=True)[0]
self.sw_rev = fdt_util.GetInt(self._node, 'sw-rev', 1)
+ dist_name_node = self._node.FindNode('distinguished-name')
+ if dist_name_node:
+ self.req_dist_name = dict()
+ for pname, prop in dist_name_node.props.items():
+ self.req_dist_name[pname] = prop.value
def GetCertificate(self, required, type='generic'):
"""Get the contents of this entry
--
2.55.0
More information about the U-Boot
mailing list