Skip to content

gh-120762: make_ssl_certs: Don't set extensions for the temporary CSR#125045

Merged
encukou merged 1 commit intopython:mainfrom
encukou:make_ssl_certs-update
Oct 7, 2024
Merged

gh-120762: make_ssl_certs: Don't set extensions for the temporary CSR#125045
encukou merged 1 commit intopython:mainfrom
encukou:make_ssl_certs-update

Conversation

@encukou
Copy link
Member

@encukou encukou commented Oct 7, 2024

openssl req fails with openssl 3.2.2 because the config line

authorityKeyIdentifier = keyid:always,issuer:always

is not supported for certificate signing requests (since the issuing certificate authority is not known).

David von Oheimb, the OpenSSL dev that made the change, commented in: openssl/openssl#22966 (comment) :

This problem did not show up in older OpenSSL versions because of a bug:
the req app ignored the -extensions option unless -x505 is given,
which I fixed in openssl/openssl#16865.

(I assume -x505 is a typo for -x509.)

In our make_cert_key function:

If sign is true:

  • We don't pass -x509 to req, so in this case it should be safe to omit the -extensions argument. (Old OpenSSL ignores it, new OpenSSL fails on it.)
  • The extensions are passed to the ca call later in the function. There they take effect, and authorityKeyIdentifier is valid.

If sign is false, this commit has no effect except rearranging the CLI arguments.

`openssl req` fails with openssl 3.2.2 because the config line

    authorityKeyIdentifier = keyid:always,issuer:always

is not supported for certificate signing requests (since the issuing
certificate authority is not known).

David von Oheimb, the OpenSSL dev that made the change, commented in:
openssl/openssl#22966 (comment) :

> This problem did not show up in older OpenSSL versions because of a bug:
> the `req` app ignored the `-extensions` option unless `-x505` is given,
> which I fixed in openssl/openssl#16865.

(I assume `-x505` is a typo for `-x509`.)

In our `make_cert_key` function:

If `sign` is true:
- We don't pass `-x509` to `req`, so in this case it should be safe to
  omit the `-extensions` argument. (Old OpenSSL ignores it, new OpenSSL
  fails on it.)
- The extensions are passed to the `ca` call later in the function.
  There they take effect, and `authorityKeyIdentifier` is valid.

If `sign` is false, this commit has no effect except rearranging the
CLI arguments.
Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@encukou
Copy link
Member Author

encukou commented Oct 7, 2024

Thank you!

@encukou encukou merged commit 744caa8 into python:main Oct 7, 2024
@encukou encukou deleted the make_ssl_certs-update branch October 7, 2024 15:37
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Feb 19, 2026
Most issues were resolved via upstream version updates that bring in
needed fixes:

glib-2.0 update to 2.78.0 that includes:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3547
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3550

curl update to 8.3.0 that includes
curl/curl#11610

util-linux update to 2.39 that includes
util-linux/util-linux#2430
util-linux/util-linux@3ab9e69
util-linux/util-linux#2435

glib-networking update to 2.78.0 that includes
https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/241

python3-cryptography update to 42.0.0 which resolves
pyca/cryptography#9370 via
pyca/cryptography#9964

perl update to 5.40.0 which includes
Perl/perl5#21379

python3 update to 3.13.0 which includes
python/cpython#118425
python3 update to 3.13.1 which includes
python/cpython#124972
python3 update to 3.14.0 which includes
python/cpython#119401
python/cpython#125045
python/cpython#107594
python/cpython#125104

tcl update to 9.0.0 which includes
tcltk/tcl@4ca6172
(tcl8 recipe has a simple backport of this)

dbus update to 1.16.0 which includes
https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/444
https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/289

openssh update to 10.0p1 which includes
openssh/openssh-portable#425
https://bugzilla.mindrot.org/show_bug.cgi?id=3684
https://marc.info/?l=openbsd-bugs&m=172561736524815&w=2
https://lists.mindrot.org/pipermail/openssh-unix-dev/2024-October/041621.html
(all reporting the same issue)

gcc update to 15.1 which includes
llvm/llvm-project#99699
via gcc-mirror/gcc@fa32100
and allows dropping special flags and exceptions for gcc-sanitizers.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments