[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3754750.1678810223@warthog.procyon.org.uk>
Date: Tue, 14 Mar 2023 16:10:23 +0000
From: David Howells <dhowells@...hat.com>
To: Shreenidhi Shedi <yesshedi@...il.com>
Cc: dhowells@...hat.com, dwmw2@...radead.org,
gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
sshedi@...are.com
Subject: Re: [ PATCH v4 2/6] sign-file: move file signing logic to its own function
Shreenidhi Shedi <yesshedi@...il.com> wrote:
> Keep the main function bare minimal and do less in main function.
I would recommend repeating the subject here and expanding on it. You also
need to say what the goal is.
> + char *hash_algo = opts->hash_algo;
> + char *dest_name = opts->dest_name;
> + char *private_key_name = opts->private_key_name;
> + char *raw_sig_name = opts->raw_sig_name;
> + char *x509_name = opts->x509_name;
> + char *module_name = opts->module_name;
I suggest just using opts-> everywhere rather than copying everything out into
stack variables.
> + OpenSSL_add_all_algorithms();
> + ERR_load_crypto_strings();
> + ERR_clear_error();
That would seem like it belongs in main().
> + struct cmd_opts opts = {0};
It would be better to do "struct cmd_opts opts = {};"
David
Powered by blists - more mailing lists