Hi Rasmus, On 2026-07-10T12:36:12, Rasmus Villemoes <[email protected]> wrote: > binman: openssl: refactor creation of Distinguished Name section from dict > > Instead of manually expanding the req_dist_name_dict, create a helper > function for creating a config section from any dict. That will also > automatically allow other fields to be emitted. > > Eventually, we could allow the values to not necesssarily be a single > string, but a list of strings, e.g. 'OU' -> ["First OU", "Secound OU"], > and encode that in the config file using > > 1.OU = First OU > 2.OU = Second OU > > as documented in 'man 5 config'. > > Signed-off-by: Rasmus Villemoes <[email protected]> > > tools/binman/btool/openssl.py | 44 ++++++++++++++----------------------------- > 1 file changed, 14 insertions(+), 30 deletions(-)
> Eventually, we could allow the values to not necesssarily be a single > string, but a list of strings, e.g. 'OU' -> ["First OU", "Secound OU"], Two typos: 'necesssarily' and 'Secound' > diff --git a/tools/binman/btool/openssl.py b/tools/binman/btool/openssl.py > @@ -36,6 +36,14 @@ class Bintoolopenssl(bintool.Bintool): > + def dict_to_config_section(self, section_name, d): Please can you add a docstring with Args and Returns, as with the other methods in this file? Since the method does not use 'self' it could be a @staticmethod, and a more descriptive name than 'd' would help, e.g. data > diff --git a/tools/binman/btool/openssl.py b/tools/binman/btool/openssl.py > @@ -36,6 +36,14 @@ class Bintoolopenssl(bintool.Bintool): > + if not d: > + return '' At this point in the series no caller can pass an empty dict, since ti_secure and ti_secure_rom always set up the full dict, so this branch is dead code here - for me it shows up as uncovered in 'binman test -T', which requires 100% coverage. Regards, Simon

