From: "Mickaël Salaün" <mic@digikod.net>
To: David Howells <dhowells@redhat.com>,
David Woodhouse <dwmw2@infradead.org>
Cc: keyrings@vger.kernel.org,
Eric Snowberg <eric.snowberg@oracle.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
Daniel Urbonas <t-durbonas@microsoft.com>,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/certs: Make print-cert-tbs-hash.sh compatible with recent OpenSSL
Date: Wed, 9 Jul 2025 15:19:47 +0200 [thread overview]
Message-ID: <20250709.ZooYu6oasaiN@digikod.net> (raw)
In-Reply-To: <20241007.aek5Ohpahlai@digikod.net>
I can take it but I'd like an Acked-by please.
On Mon, Oct 07, 2024 at 08:42:16PM +0200, Mickaël Salaün wrote:
> Could someone please take this patch?
>
> On Mon, Jul 29, 2024 at 08:02:32PM +0200, Mickaël Salaün wrote:
> > Recent OpenSSL versions (2 or 3) broke the "x509" argument parsing by
> > not handling "-in -" (unlike OpenSSL 1.1):
> > Could not open file or uri for loading certificate from -: No such
> > file or directory
> >
> > Avoid this issue and still make this script work with older versions of
> > OpenSSL by using implicit arguments instead.
> >
> > To hopefully make it more future-proof, apply the same simplifications
> > for other OpenSSL commands.
> >
> > Cc: David Howells <dhowells@redhat.com>
> > Cc: David Woodhouse <dwmw2@infradead.org>
> > Cc: Eric Snowberg <eric.snowberg@oracle.com>
> > Cc: Jarkko Sakkinen <jarkko@kernel.org>
> > Reported-by: Daniel Urbonas <t-durbonas@microsoft.com>
> > Fixes: 58d416351e6d ("tools/certs: Add print-cert-tbs-hash.sh")
> > Signed-off-by: Mickaël Salaün <mic@digikod.net>
> > ---
> > tools/certs/print-cert-tbs-hash.sh | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/certs/print-cert-tbs-hash.sh b/tools/certs/print-cert-tbs-hash.sh
> > index c93df5387ec9..22bdeec4d286 100755
> > --- a/tools/certs/print-cert-tbs-hash.sh
> > +++ b/tools/certs/print-cert-tbs-hash.sh
> > @@ -54,7 +54,7 @@ RANGE_AND_DIGEST_RE='
> > '
> >
> > RANGE_AND_DIGEST=($(echo "${PEM}" | \
> > - openssl asn1parse -in - | \
> > + openssl asn1parse | \
> > sed -n -e "${RANGE_AND_DIGEST_RE}"))
> >
> > if [ "${#RANGE_AND_DIGEST[@]}" != 3 ]; then
> > @@ -85,7 +85,7 @@ if [ -z "${DIGEST_MATCH}" ]; then
> > fi
> >
> > echo "${PEM}" | \
> > - openssl x509 -in - -outform DER | \
> > + openssl x509 -outform DER | \
> > dd "bs=1" "skip=${OFFSET}" "count=${END}" "status=none" | \
> > - openssl dgst "-${DIGEST_MATCH}" - | \
> > + openssl dgst "-${DIGEST_MATCH}" | \
> > awk '{printf "tbs:" $2}'
> > --
> > 2.45.2
> >
next parent reply other threads:[~2025-07-09 13:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240729180233.1114694-1-mic@digikod.net>
[not found] ` <20241007.aek5Ohpahlai@digikod.net>
2025-07-09 13:19 ` Mickaël Salaün [this message]
2025-07-09 15:29 ` [PATCH] tools/certs: Make print-cert-tbs-hash.sh compatible with recent OpenSSL Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250709.ZooYu6oasaiN@digikod.net \
--to=mic@digikod.net \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=eric.snowberg@oracle.com \
--cc=jarkko@kernel.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=t-durbonas@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox