mirror of
https://git.yoctoproject.org/poky
synced 2026-02-21 00:49:41 +01:00
Compare commits
56 Commits
yocto-4.0.
...
kirkstone-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51dc9c464d | ||
|
|
49e837cefa | ||
|
|
03a1a4c956 | ||
|
|
0813376d84 | ||
|
|
5fc83da6b2 | ||
|
|
686d908085 | ||
|
|
9e8df15269 | ||
|
|
6d64cdb02b | ||
|
|
15535d452d | ||
|
|
d3568e56a7 | ||
|
|
ad403d6f6f | ||
|
|
7c76036780 | ||
|
|
4f27d5ff82 | ||
|
|
e9b1bb75ff | ||
|
|
4415ab1560 | ||
|
|
69d52fa539 | ||
|
|
6ae24cb3c6 | ||
|
|
3899075ad9 | ||
|
|
9f689b3049 | ||
|
|
57bd1bec8d | ||
|
|
e271e3cf36 | ||
|
|
7e420c5834 | ||
|
|
999a2e1aa4 | ||
|
|
41c69cd099 | ||
|
|
d655701622 | ||
|
|
34ee6fc494 | ||
|
|
ecef511127 | ||
|
|
b5d3231d38 | ||
|
|
f8c794053b | ||
|
|
37f7f262e8 | ||
|
|
96973ede70 | ||
|
|
d0fd4d9160 | ||
|
|
17e3bd9df8 | ||
|
|
d6f3ce1651 | ||
|
|
6b05a97369 | ||
|
|
bedb86690f | ||
|
|
6a6d768268 | ||
|
|
1070bb4499 | ||
|
|
372bb5d81e | ||
|
|
169ae15f95 | ||
|
|
68fd70f349 | ||
|
|
1e0216c6ba | ||
|
|
e1b698abcc | ||
|
|
39df9602b1 | ||
|
|
f81ed8523a | ||
|
|
5d6f6b2619 | ||
|
|
79435187b1 | ||
|
|
f11ea352ef | ||
|
|
db89896907 | ||
|
|
1afc7cf4cf | ||
|
|
423e0ff3fb | ||
|
|
8f356f507e | ||
|
|
aa37836708 | ||
|
|
e371e6b3a7 | ||
|
|
dc468377e8 | ||
|
|
c2581b7811 |
@@ -52,19 +52,24 @@ for them for significant issues.
|
||||
Security-related discussions at the Yocto Project
|
||||
-------------------------------------------------
|
||||
|
||||
We have set up two security-related mailing lists:
|
||||
We have set up two security-related emails/mailing lists:
|
||||
|
||||
- Public List: yocto [dash] security [at] yoctoproject[dot] org
|
||||
- Public Mailing List: yocto [dash] security [at] yoctoproject[dot] org
|
||||
|
||||
This is a public mailing list for anyone to subscribe to. This list is an
|
||||
open list to discuss public security issues/patches and security-related
|
||||
initiatives. For more information, including subscription information,
|
||||
please see the :yocto_lists:`yocto-security mailing list info page </g/yocto-security>`.
|
||||
This is a public mailing list for anyone to subscribe to. This list is an
|
||||
open list to discuss public security issues/patches and security-related
|
||||
initiatives. For more information, including subscription information,
|
||||
please see the :yocto_lists:`yocto-security mailing list info page
|
||||
</g/yocto-security>`.
|
||||
|
||||
- Private List: security [at] yoctoproject [dot] org
|
||||
This list requires moderator approval for new topics to be posted, to avoid
|
||||
private security reports to be posted by mistake.
|
||||
|
||||
This is a private mailing list for reporting non-published potential
|
||||
vulnerabilities. The list is monitored by the Yocto Project Security team.
|
||||
- Yocto Project Security Team: security [at] yoctoproject [dot] org
|
||||
|
||||
This is an email for reporting non-published potential vulnerabilities.
|
||||
Emails sent to this address are forwarded to the Yocto Project Security
|
||||
Team members.
|
||||
|
||||
|
||||
What you should do if you find a security vulnerability
|
||||
|
||||
@@ -35,3 +35,4 @@ Release 4.0 (kirkstone)
|
||||
release-notes-4.0.26
|
||||
release-notes-4.0.27
|
||||
release-notes-4.0.28
|
||||
release-notes-4.0.29
|
||||
|
||||
178
documentation/migration-guides/release-notes-4.0.29.rst
Normal file
178
documentation/migration-guides/release-notes-4.0.29.rst
Normal file
@@ -0,0 +1,178 @@
|
||||
Release notes for Yocto-4.0.29 (Kirkstone)
|
||||
------------------------------------------
|
||||
|
||||
Security Fixes in Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- avahi: Fix :cve_nist:`2024-52615`
|
||||
- binutils: Fix :cve_nist:`2025-7545` and :cve_nist:`2025-7546`
|
||||
- coreutils: Fix :cve_nist:`2025-5278`
|
||||
- curl: Fix :cve_nist:`2024-11053` and :cve_nist:`2025-0167`
|
||||
- dropbear: Fix :cve_nist:`2025-47203`
|
||||
- ffmpeg: Ignore :cve_nist:`2022-3109` and :cve_nist:`2022-3341`
|
||||
- gdk-pixbuf: Fix :cve_nist:`2025-7345`
|
||||
- ghostscript: Ignore :cve_nist:`2025-46646`
|
||||
- gnupg: Fix :cve_nist:`2025-30258`
|
||||
- gnutls: Fix :cve_nist:`2025-6395`, :cve_nist:`2025-32988`, :cve_nist:`2025-32989` and
|
||||
:cve_nist:`2025-32990`
|
||||
- iputils: Fix :cve_nist:`2025-48964`
|
||||
- libarchive: Fix :cve_nist:`2025-5914`, :cve_nist:`2025-5915`, :cve_nist:`2025-5916` and
|
||||
:cve_nist:`2025-5917`
|
||||
- libpam: Fix :cve_nist:`2025-6020`
|
||||
- libsoup-2.4: Fix :cve_nist:`2025-4945`
|
||||
- libsoup-2.4: Fix :cve_nist:`2025-4969` (update patch)
|
||||
- libsoup: Fix :cve_nist:`2025-4945`, :cve_nist:`2025-6021`, :cve_nist:`2025-6170`,
|
||||
:cve_nist:`2025-49794` and :cve_nist:`2025-49796`
|
||||
- ncurses: Fix :cve_nist:`2025-6141`
|
||||
- ofono: Fix :cve_nist:`2023-4232` and :cve_nist:`2023-4235`
|
||||
- openssl: Fix :cve_nist:`2024-41996`
|
||||
- python3-urllib3: Fix :cve_nist:`2025-50181`
|
||||
- ruby: Fix :cve_nist:`2024-43398` (update patches)
|
||||
- sqlite3: Fix :cve_nist:`2025-6965` and :cve_nist:`2025-7458`
|
||||
- sqlite3: Ignore :cve_nist:`2025-3277`
|
||||
- systemd: Fix :cve_nist:`2025-4598`
|
||||
- xwayland: Fix :cve_nist:`2025-49175`, :cve_nist:`2025-49176`, :cve_nist:`2025-49177`,
|
||||
:cve_nist:`2025-49178`, :cve_nist:`2025-49179` and :cve_nist:`2025-49180`
|
||||
|
||||
|
||||
Fixes in Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- bintuils: stable 2.38 branch update
|
||||
- bitbake: test/fetch: Switch u-boot based test to use our own mirror
|
||||
- build-appliance-image: Update to kirkstone head revision
|
||||
- conf.py: improve SearchEnglish to handle terms with dots
|
||||
- db: ignore implicit-int and implicit-function-declaration issues fatal with gcc-14
|
||||
- dev-manual/start.rst: added missing command in Optimize your VHDX file using DiskPart
|
||||
- glibc: stable 2.35 branch updates
|
||||
- gnutls: patch read buffer overrun in the "pre_shared_key" extension
|
||||
- gnutls: patch reject zero-length version in certificate request
|
||||
- linux-yocto/5.15: update to v5.15.186
|
||||
- migration-guides: add release notes for 4.0.28
|
||||
- oeqa/core/decorator: add decorators to skip based on :term:`HOST_ARCH`
|
||||
- openssl: upgrade to 3.0.17
|
||||
- orc: set :term:`CVE_PRODUCT`
|
||||
- overview-manual/concepts.rst: fix sayhello hardcoded bindir
|
||||
- poky.conf: bump version for 4.0.29
|
||||
- python3: update CVE product
|
||||
- ref-manual: document :term:`KERNEL_SPLIT_MODULES` variable
|
||||
- scripts/install-buildtools: Update to 4.0.28
|
||||
- sudo: upgrade to 1.9.17p1
|
||||
- tcf-agent: correct the :term:`SRC_URI`
|
||||
|
||||
|
||||
Known Issues in Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- N/A
|
||||
|
||||
|
||||
Contributors to Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Aleksandar Nikolic
|
||||
- Antonin Godard
|
||||
- Archana Polampalli
|
||||
- Bruce Ashfield
|
||||
- Changqing Li
|
||||
- Chen Qi
|
||||
- Colin Pinnell McAllister
|
||||
- Daniel Díaz
|
||||
- Deepesh Varatharajan
|
||||
- Divya Chellam
|
||||
- Dixit Parmar
|
||||
- Enrico Jörns
|
||||
- Guocai He
|
||||
- Hitendra Prajapati
|
||||
- Lee Chee Yang
|
||||
- Marco Cavallini
|
||||
- Martin Jansa
|
||||
- Peter Marko
|
||||
- Praveen Kumar
|
||||
- Richard Purdie
|
||||
- Rob Woolley
|
||||
- Ross Burton
|
||||
- Steve Sakoman
|
||||
- Vijay Anusuri
|
||||
- Yash Shinde
|
||||
- Yogita Urade
|
||||
- Zhang Peng
|
||||
|
||||
|
||||
Repositories / Downloads for Yocto-4.0.29
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
poky
|
||||
|
||||
- Repository Location: :yocto_git:`/poky`
|
||||
- Branch: :yocto_git:`kirkstone </poky/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </poky/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`81ab000fa437ca04f584a3327b076f7a512dc6d0 </poky/commit/?id=81ab000fa437ca04f584a3327b076f7a512dc6d0>`
|
||||
- Release Artefact: poky-81ab000fa437ca04f584a3327b076f7a512dc6d0
|
||||
- sha: 2fecf3cac5c2361c201b5ae826960af92289862ec9be13837a8431138e534fd2
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/poky-81ab000fa437ca04f584a3327b076f7a512dc6d0.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/poky-81ab000fa437ca04f584a3327b076f7a512dc6d0.tar.bz2
|
||||
|
||||
openembedded-core
|
||||
|
||||
- Repository Location: :oe_git:`/openembedded-core`
|
||||
- Branch: :oe_git:`kirkstone </openembedded-core/log/?h=kirkstone>`
|
||||
- Tag: :oe_git:`yocto-4.0.29 </openembedded-core/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :oe_git:`bd620eb14660075fd0f7476bbbb65d5da6293874 </openembedded-core/commit/?id=bd620eb14660075fd0f7476bbbb65d5da6293874>`
|
||||
- Release Artefact: oecore-bd620eb14660075fd0f7476bbbb65d5da6293874
|
||||
- sha: f32ab195c7090268e6e87ccf8db2813cf705c517030654326d14b25d926de88e
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/oecore-bd620eb14660075fd0f7476bbbb65d5da6293874.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/oecore-bd620eb14660075fd0f7476bbbb65d5da6293874.tar.bz2
|
||||
|
||||
meta-mingw
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-mingw`
|
||||
- Branch: :yocto_git:`kirkstone </meta-mingw/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </meta-mingw/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`87c22abb1f11be430caf4372e6b833dc7d77564e </meta-mingw/commit/?id=87c22abb1f11be430caf4372e6b833dc7d77564e>`
|
||||
- Release Artefact: meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e
|
||||
- sha: f0bc4873e2e0319fb9d6d6ab9b98eb3f89664d4339a167d2db6a787dd12bc1a8
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/meta-mingw-87c22abb1f11be430caf4372e6b833dc7d77564e.tar.bz2
|
||||
|
||||
meta-gplv2
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-gplv2`
|
||||
- Branch: :yocto_git:`kirkstone </meta-gplv2/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </meta-gplv2/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a </meta-gplv2/commit/?id=d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a>`
|
||||
- Release Artefact: meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a
|
||||
- sha: c386f59f8a672747dc3d0be1d4234b6039273d0e57933eb87caa20f56b9cca6d
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/meta-gplv2-d2f8b5cdb285b72a4ed93450f6703ca27aa42e8a.tar.bz2
|
||||
|
||||
bitbake
|
||||
|
||||
- Repository Location: :oe_git:`/bitbake`
|
||||
- Branch: :oe_git:`2.0 </bitbake/log/?h=2.0>`
|
||||
- Tag: :oe_git:`yocto-4.0.29 </bitbake/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :oe_git:`8e2d1f8de055549b2101614d85454fcd1d0f94b2 </bitbake/commit/?id=8e2d1f8de055549b2101614d85454fcd1d0f94b2>`
|
||||
- Release Artefact: bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2
|
||||
- sha: fad4e7699bae62082118e89785324b031b0af0743064caee87c91ba28549afb0
|
||||
- Download Locations:
|
||||
https://downloads.yoctoproject.org/releases/yocto/yocto-4.0.29/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
https://mirrors.kernel.org/yocto/yocto/yocto-4.0.29/bitbake-8e2d1f8de055549b2101614d85454fcd1d0f94b2.tar.bz2
|
||||
|
||||
meta-yocto
|
||||
|
||||
- Repository Location: :yocto_git:`/meta-yocto`
|
||||
- Branch: :yocto_git:`kirkstone </meta-yocto/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </meta-yocto/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`e916d3bad58f955b73e2c67aba975e63cd191394 </meta-yocto/commit/?id=e916d3bad58f955b73e2c67aba975e63cd191394>`
|
||||
|
||||
yocto-docs
|
||||
|
||||
- Repository Location: :yocto_git:`/yocto-docs`
|
||||
- Branch: :yocto_git:`kirkstone </yocto-docs/log/?h=kirkstone>`
|
||||
- Tag: :yocto_git:`yocto-4.0.29 </yocto-docs/log/?h=yocto-4.0.29>`
|
||||
- Git Revision: :yocto_git:`bf855ecaf4bec4cef9bbfea2e50caa65a8339828 </yocto-docs/commit/?id=bf855ecaf4bec4cef9bbfea2e50caa65a8339828>`
|
||||
|
||||
@@ -28,7 +28,7 @@ platforms as well as software stacks that can be maintained and scaled.
|
||||
|
||||
For further introductory information on the Yocto Project, you might be
|
||||
interested in this
|
||||
`article <https://www.embedded.com/electronics-blogs/say-what-/4458600/Why-the-Yocto-Project-for-my-IoT-Project->`__
|
||||
`article <https://www.embedded.com/why-the-yocto-project-for-my-iot-project/>`__
|
||||
by Drew Moseley and in this short introductory
|
||||
`video <https://www.youtube.com/watch?v=utZpKM7i5Z4>`__.
|
||||
|
||||
|
||||
@@ -3038,6 +3038,22 @@ class assuming :term:`PATCHRESOLVE` is set to "user", the
|
||||
:ref:`ref-classes-cml1` class, and the :ref:`ref-classes-devshell` class all
|
||||
use the :ref:`ref-classes-terminal` class.
|
||||
|
||||
.. _ref-classes-testexport:
|
||||
|
||||
``testexport``
|
||||
==============
|
||||
|
||||
Based on the :ref:`ref-classes-testimage` class, the
|
||||
:ref:`ref-classes-testexport` class can be used to export the test environment
|
||||
outside of the :term:`OpenEmbedded Build System`. This will generate the
|
||||
directory structure to execute the runtime tests using the
|
||||
:oe_git:`runexported.py </openembedded-core/tree/meta/lib/oeqa/runexported.py>`
|
||||
Python script.
|
||||
|
||||
For more details on how to use :ref:`ref-classes-testexport`, see
|
||||
the :ref:`test-manual/runtime-testing:Exporting Tests` section in the Yocto
|
||||
Project Test Environment Manual.
|
||||
|
||||
.. _ref-classes-testimage:
|
||||
|
||||
``testimage``
|
||||
@@ -3163,6 +3179,9 @@ It is intended to be inherited from U-Boot recipes.
|
||||
|
||||
The variables used by this class are:
|
||||
|
||||
- :term:`SPL_DTB_BINARY`: Name of the SPL device tree binary. Can be set to an
|
||||
empty string to indicate that no SPL should be created and added to the FIT
|
||||
image.
|
||||
- :term:`SPL_MKIMAGE_DTCOPTS`: DTC options for U-Boot ``mkimage`` when
|
||||
building the FIT image.
|
||||
- :term:`SPL_SIGN_ENABLE`: enable signing the FIT image.
|
||||
|
||||
@@ -58,20 +58,35 @@ Supported Linux Distributions
|
||||
Currently, the &DISTRO; release ("&DISTRO_NAME;") of the Yocto Project is
|
||||
supported on the following distributions:
|
||||
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
- Ubuntu 22.04 (LTS)
|
||||
|
||||
- Fedora 38
|
||||
|
||||
- Debian GNU/Linux 11.x (Bullseye)
|
||||
..
|
||||
Can be generated with yocto-autobuilder-helper's scripts/yocto-supported-distros:
|
||||
yocto-supported-distros --release kirkstone --config yocto-autobuilder2/config.py --output-format docs --poky-distros
|
||||
|
||||
- AlmaLinux 8
|
||||
- AlmaLinux 9
|
||||
- Debian 11
|
||||
- Debian 12
|
||||
- Fedora 39
|
||||
- Fedora 40
|
||||
- Fedora 41
|
||||
- Rocky Linux 8
|
||||
- Rocky Linux 9
|
||||
- Ubuntu 20.04 (LTS)
|
||||
- Ubuntu 22.04 (LTS)
|
||||
- Ubuntu 24.04 (LTS)
|
||||
- Ubuntu 24.10
|
||||
|
||||
The following distribution versions are still tested, even though the
|
||||
organizations publishing them no longer make updates publicly available:
|
||||
|
||||
- Ubuntu 18.04 (LTS)
|
||||
..
|
||||
This list contains EOL distros that are still tested on the Autobuilder
|
||||
(meaning there are running workers for them).
|
||||
See https://endoflife.date for information of EOL releases.
|
||||
|
||||
- Fedora 39
|
||||
- Fedora 40
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
Note that the Yocto Project doesn't have access to private updates
|
||||
that some of these versions may have. Therefore, our testing has
|
||||
@@ -80,19 +95,33 @@ limited value if you have access to such updates.
|
||||
Finally, here are the distribution versions which were previously
|
||||
tested on former revisions of "&DISTRO_NAME;", but no longer are:
|
||||
|
||||
- Ubuntu 18.04 (LTS)
|
||||
|
||||
- Ubuntu 20.04 (LTS)
|
||||
|
||||
- Ubuntu 22.04 (LTS)
|
||||
..
|
||||
Can be generated with yocto-autobuilder-helper's scripts/yocto-supported-distros:
|
||||
yocto-supported-distros --release kirkstone --config yocto-autobuilder2/config.py --output-format docs --old-distros
|
||||
|
||||
- CentOS 7
|
||||
- CentOS 8
|
||||
- Debian 10
|
||||
- Debian 8
|
||||
- Debian 9
|
||||
- Fedora 29
|
||||
- Fedora 30
|
||||
- Fedora 31
|
||||
- Fedora 32
|
||||
- Fedora 33
|
||||
- Fedora 34
|
||||
- Fedora 35
|
||||
- Fedora 36
|
||||
- Fedora 37
|
||||
|
||||
- Debian GNU/Linux 11.x (Bookworm)
|
||||
|
||||
- Fedora 38
|
||||
- OpenSUSE Leap 15.0
|
||||
- OpenSUSE Leap 15.1
|
||||
- OpenSUSE Leap 15.2
|
||||
- OpenSUSE Leap 15.3
|
||||
|
||||
- AlmaLinux 8
|
||||
- Ubuntu 16.04
|
||||
- Ubuntu 18.04
|
||||
- Ubuntu 19.04
|
||||
- Ubuntu 21.10
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@@ -2801,6 +2801,10 @@ system and gives an overview of their function and contents.
|
||||
For guidance on how to create your own file permissions settings
|
||||
table file, examine the existing ``fs-perms.txt``.
|
||||
|
||||
:term:`FIT_CONF_PREFIX`
|
||||
When using the :ref:`ref-classes-kernel-fitimage`, this is the prefix
|
||||
used for creating FIT configuration nodes. Its default value is "conf-".
|
||||
|
||||
:term:`FIT_DESC`
|
||||
Specifies the description string encoded into a fitImage. The default
|
||||
value is set by the :ref:`kernel-fitimage <ref-classes-kernel-fitimage>`
|
||||
@@ -3531,6 +3535,12 @@ system and gives an overview of their function and contents.
|
||||
added to the image by using the :term:`IMAGE_ROOTFS_EXTRA_SPACE`
|
||||
variable.
|
||||
|
||||
When using Wic tool, beware that a second overhead factor is also applied.
|
||||
This overhead value is defined by the ``--overhead-factor`` option, which
|
||||
defaults to "1.3" when omitted. See the
|
||||
:ref:`ref-manual/kickstart:command: part or partition` chapter in
|
||||
:doc:`/ref-manual/kickstart` for details.
|
||||
|
||||
:term:`IMAGE_PKGTYPE`
|
||||
Defines the package type (i.e. DEB, RPM, IPK, or TAR) used by the
|
||||
OpenEmbedded build system. The variable is defined appropriately by
|
||||
@@ -7791,6 +7801,11 @@ system and gives an overview of their function and contents.
|
||||
section in the Yocto Project Board Support Package Developer's Guide
|
||||
for additional information.
|
||||
|
||||
:term:`SPL_DTB_BINARY`
|
||||
When inheriting the :ref:`ref-classes-uboot-sign` class, the
|
||||
:term:`SPL_DTB_BINARY` variable contains the name of the SPL binary to be
|
||||
compiled.
|
||||
|
||||
:term:`SPL_MKIMAGE_DTCOPTS`
|
||||
Options for the device tree compiler passed to ``mkimage -D`` feature
|
||||
while creating a FIT image with the :ref:`ref-classes-uboot-sign`
|
||||
|
||||
@@ -56,9 +56,10 @@ project:
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
int main()
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
- ``configure.ac``::
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
#DISTRO_VERSION = "3.4+snapshot-${METADATA_REVISION}"
|
||||
DISTRO_VERSION = "4.0.29"
|
||||
DISTRO_VERSION = "4.0.30"
|
||||
DISTRO_CODENAME = "kirkstone"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION = "${@d.getVar('DISTRO_VERSION').replace('snapshot-${METADATA_REVISION}', 'snapshot')}"
|
||||
|
||||
@@ -25,3 +25,4 @@ weston:x:525:
|
||||
wayland:x:526:
|
||||
render:x:527:
|
||||
sgx:x:528:
|
||||
audio:x:529:
|
||||
|
||||
@@ -1182,24 +1182,27 @@ python do_qa_patch() {
|
||||
msg += " devtool modify %s\n" % d.getVar('PN')
|
||||
msg += " devtool finish --force-patch-refresh %s <layer_path>\n\n" % d.getVar('PN')
|
||||
msg += "Don't forget to review changes done by devtool!\n"
|
||||
if bb.utils.filter('ERROR_QA', 'patch-fuzz', d):
|
||||
bb.error(msg)
|
||||
elif bb.utils.filter('WARN_QA', 'patch-fuzz', d):
|
||||
bb.warn(msg)
|
||||
msg = "Patch log indicates that patches do not apply cleanly."
|
||||
msg += "\nPatch log indicates that patches do not apply cleanly."
|
||||
oe.qa.handle_error("patch-fuzz", msg, d)
|
||||
|
||||
# Check if the patch contains a correctly formatted and spelled Upstream-Status
|
||||
import re
|
||||
from oe import patch
|
||||
|
||||
allpatches = False
|
||||
if bb.utils.filter('ERROR_QA', 'patch-status-noncore', d) or bb.utils.filter('WARN_QA', 'patch-status-noncore', d):
|
||||
allpatches = True
|
||||
|
||||
coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
|
||||
for url in patch.src_patches(d):
|
||||
(_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
|
||||
|
||||
# skip patches not in oe-core
|
||||
patchtype = "patch-status-core"
|
||||
if not os.path.abspath(fullpath).startswith(coremeta_path):
|
||||
continue
|
||||
patchtype = "patch-status-noncore"
|
||||
if not allpatches:
|
||||
continue
|
||||
|
||||
kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | re.MULTILINE)
|
||||
strict_status_re = re.compile(r"^Upstream-Status: (Pending|Submitted|Denied|Accepted|Inappropriate|Backport|Inactive-Upstream)( .+)?$", re.MULTILINE)
|
||||
@@ -1212,9 +1215,13 @@ python do_qa_patch() {
|
||||
|
||||
if not match_strict:
|
||||
if match_kinda:
|
||||
bb.error("Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0)))
|
||||
msg = "Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0))
|
||||
oe.qa.handle_error(patchtype, msg, d)
|
||||
else:
|
||||
bb.error("Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines))
|
||||
msg = "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines)
|
||||
oe.qa.handle_error(patchtype, msg, d)
|
||||
|
||||
oe.qa.exit_if_errors(d)
|
||||
}
|
||||
|
||||
python do_qa_configure() {
|
||||
@@ -1331,6 +1338,7 @@ python do_qa_unpack() {
|
||||
bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir))
|
||||
|
||||
unpack_check_src_uri(d.getVar('PN'), d)
|
||||
oe.qa.exit_if_errors(d)
|
||||
}
|
||||
|
||||
# The Staging Func, to check all staging
|
||||
|
||||
@@ -52,4 +52,4 @@ KERNEL_IMAGETYPES ??= "${KERNEL_IMAGETYPE}"
|
||||
# fetch from the network (and warn you if not). To disable the test set
|
||||
# the variable to be empty.
|
||||
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master;branch=master
|
||||
CONNECTIVITY_CHECK_URIS ?= "https://yoctoproject.org/connectivity.html"
|
||||
CONNECTIVITY_CHECK_URIS ?= "https://www.yoctoproject.org/connectivity.html"
|
||||
|
||||
@@ -13,8 +13,8 @@ class HTTPTests(OESDKTestCase):
|
||||
"""
|
||||
|
||||
def test_wget(self):
|
||||
self._run('env -i wget --debug --output-document /dev/null https://yoctoproject.org/connectivity.html')
|
||||
self._run('env -i wget --debug --output-document /dev/null https://www.yoctoproject.org/connectivity.html')
|
||||
|
||||
def test_python(self):
|
||||
# urlopen() returns a file-like object on success and throws an exception otherwise
|
||||
self._run('python3 -c \'import urllib.request; urllib.request.urlopen("https://yoctoproject.org/connectivity.html")\'')
|
||||
self._run('python3 -c \'import urllib.request; urllib.request.urlopen("https://www.yoctoproject.org/connectivity.html")\'')
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 10c9a571f1c0472799f72b1924b039aab231e95f Mon Sep 17 00:00:00 2001
|
||||
From: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
|
||||
Date: Thu, 16 Dec 2021 16:19:50 +0100
|
||||
Subject: [PATCH] Include cstddef in the header for C++
|
||||
|
||||
So C++ compiler always has access to the definition of size_t.
|
||||
|
||||
Signed-off-by: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
|
||||
Signed-off-by: Youngseok Jeong <youngseok1.jeong@lge.com>
|
||||
Upstream-Status: Backport [v0.3.3 https://github.com/sbabic/libubootenv/pull/19/commits/764226a7de2ea79b182d92829922489537c766fa]
|
||||
---
|
||||
src/libuboot.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/libuboot.h b/src/libuboot.h
|
||||
index 88f0558..1f305f4 100644
|
||||
--- a/src/libuboot.h
|
||||
+++ b/src/libuboot.h
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
+#include <cstddef>
|
||||
+
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -10,7 +10,11 @@ LICENSE = "LGPL-2.1-only"
|
||||
LIC_FILES_CHKSUM = "file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c"
|
||||
SECTION = "libs"
|
||||
|
||||
SRC_URI = "git://github.com/sbabic/libubootenv;protocol=https;branch=master"
|
||||
SRC_URI = " \
|
||||
git://github.com/sbabic/libubootenv;protocol=https;branch=master \
|
||||
file://0001-Include-cstddef-in-the-header-for-C.patch \
|
||||
"
|
||||
|
||||
SRCREV = "ba7564f5006d09bec51058cf4f5ac90d4dc18b3c"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
618
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-1.patch
Normal file
618
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-1.patch
Normal file
@@ -0,0 +1,618 @@
|
||||
From 24734088e1034392de981151dfe57e3a379ada18 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 15 Mar 2022 13:58:08 +0100
|
||||
Subject: [PATCH 1/3] rsa: add implicit rejection in PKCS#1 v1.5
|
||||
|
||||
The RSA decryption as implemented before required very careful handling
|
||||
of both the exit code returned by OpenSSL and the potentially returned
|
||||
ciphertext. Looking at the recent security vulnerabilities
|
||||
(CVE-2020-25659 and CVE-2020-25657) it is unlikely that most users of
|
||||
OpenSSL do it correctly.
|
||||
|
||||
Given that correct code requires side channel secure programming in
|
||||
application code, we can classify the existing RSA decryption methods
|
||||
as CWE-676, which in turn likely causes CWE-208 and CWE-385 in
|
||||
application code.
|
||||
|
||||
To prevent that, we can use a technique called "implicit rejection".
|
||||
For that we generate a random message to be returned in case the
|
||||
padding check fails. We generate the message based on static secret
|
||||
data (the private exponent) and the provided ciphertext (so that the
|
||||
attacker cannot determine that the returned value is randomly generated
|
||||
instead of result of decryption and de-padding). We return it in case
|
||||
any part of padding check fails.
|
||||
|
||||
The upshot of this approach is that then not only is the length of the
|
||||
returned message useless as the Bleichenbacher oracle, so are the
|
||||
actual bytes of the returned message. So application code doesn't have
|
||||
to perform any operations on the returned message in side-channel free
|
||||
way to remain secure against Bleichenbacher attacks.
|
||||
|
||||
Note: this patch implements a specific algorithm, shared with Mozilla
|
||||
NSS, so that the attacker cannot use one library as an oracle against the
|
||||
other in heterogeneous environments.
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/openssl/openssl/commit/7fc67e0a33102aa47bbaa56533eeecb98c0450f7]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
crypto/rsa/rsa_ossl.c | 95 +++++++-
|
||||
crypto/rsa/rsa_pk1.c | 252 ++++++++++++++++++++++
|
||||
doc/man1/openssl-pkeyutl.pod.in | 5 +
|
||||
doc/man1/openssl-rsautl.pod.in | 5 +
|
||||
doc/man3/EVP_PKEY_CTX_ctrl.pod | 7 +
|
||||
doc/man3/EVP_PKEY_decrypt.pod | 12 ++
|
||||
doc/man3/RSA_padding_add_PKCS1_type_1.pod | 7 +-
|
||||
doc/man3/RSA_public_encrypt.pod | 11 +-
|
||||
include/crypto/rsa.h | 4 +
|
||||
9 files changed, 393 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c
|
||||
index 0fc642e777..330302ae55 100644
|
||||
--- a/crypto/rsa/rsa_ossl.c
|
||||
+++ b/crypto/rsa/rsa_ossl.c
|
||||
@@ -17,6 +17,9 @@
|
||||
#include "crypto/bn.h"
|
||||
#include "rsa_local.h"
|
||||
#include "internal/constant_time.h"
|
||||
+#include <openssl/evp.h>
|
||||
+#include <openssl/sha.h>
|
||||
+#include <openssl/hmac.h>
|
||||
|
||||
static int rsa_ossl_public_encrypt(int flen, const unsigned char *from,
|
||||
unsigned char *to, RSA *rsa, int padding);
|
||||
@@ -377,8 +380,13 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
BIGNUM *f, *ret;
|
||||
int j, num = 0, r = -1;
|
||||
unsigned char *buf = NULL;
|
||||
+ unsigned char d_hash[SHA256_DIGEST_LENGTH] = {0};
|
||||
+ HMAC_CTX *hmac = NULL;
|
||||
+ unsigned int md_len = SHA256_DIGEST_LENGTH;
|
||||
+ unsigned char kdk[SHA256_DIGEST_LENGTH] = {0};
|
||||
BN_CTX *ctx = NULL;
|
||||
int local_blinding = 0;
|
||||
+ EVP_MD *md = NULL;
|
||||
/*
|
||||
* Used only if the blinding structure is shared. A non-NULL unblind
|
||||
* instructs rsa_blinding_convert() and rsa_blinding_invert() to store
|
||||
@@ -408,6 +416,11 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
goto err;
|
||||
}
|
||||
|
||||
+ if (flen < 1) {
|
||||
+ ERR_raise(ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
/* make data into a big number */
|
||||
if (BN_bin2bn(from, (int)flen, f) == NULL)
|
||||
goto err;
|
||||
@@ -472,13 +485,91 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
if (!rsa_blinding_invert(blinding, ret, unblind, ctx))
|
||||
goto err;
|
||||
|
||||
+ /*
|
||||
+ * derive the Key Derivation Key from private exponent and public
|
||||
+ * ciphertext
|
||||
+ */
|
||||
+ if (!(rsa->flags & RSA_FLAG_EXT_PKEY)) {
|
||||
+ /*
|
||||
+ * because we use d as a handle to rsa->d we need to keep it local and
|
||||
+ * free before any further use of rsa->d
|
||||
+ */
|
||||
+ BIGNUM *d = BN_new();
|
||||
+ if (d == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ if (rsa->d == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY);
|
||||
+ BN_free(d);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ BN_with_flags(d, rsa->d, BN_FLG_CONSTTIME);
|
||||
+ if (BN_bn2binpad(d, buf, num) < 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ BN_free(d);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ BN_free(d);
|
||||
+
|
||||
+ /*
|
||||
+ * we use hardcoded hash so that migrating between versions that use
|
||||
+ * different hash doesn't provide a Bleichenbacher oracle:
|
||||
+ * if the attacker can see that different versions return different
|
||||
+ * messages for the same ciphertext, they'll know that the message is
|
||||
+ * syntethically generated, which means that the padding check failed
|
||||
+ */
|
||||
+ md = EVP_MD_fetch(rsa->libctx, "sha256", NULL);
|
||||
+ if (md == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (EVP_Digest(buf, num, d_hash, NULL, md, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ hmac = HMAC_CTX_new();
|
||||
+ if (hmac == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (HMAC_Init_ex(hmac, d_hash, sizeof(d_hash), md, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (flen < num) {
|
||||
+ memset(buf, 0, num - flen);
|
||||
+ if (HMAC_Update(hmac, buf, num - flen) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ }
|
||||
+ if (HMAC_Update(hmac, from, flen) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ md_len = SHA256_DIGEST_LENGTH;
|
||||
+ if (HMAC_Final(hmac, kdk, &md_len) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
j = BN_bn2binpad(ret, buf, num);
|
||||
if (j < 0)
|
||||
goto err;
|
||||
|
||||
switch (padding) {
|
||||
case RSA_PKCS1_PADDING:
|
||||
- r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
+ if (rsa->flags & RSA_FLAG_EXT_PKEY)
|
||||
+ r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
+ else
|
||||
+ r = ossl_rsa_padding_check_PKCS1_type_2(rsa->libctx, to, num, buf, j, num, kdk);
|
||||
break;
|
||||
case RSA_PKCS1_OAEP_PADDING:
|
||||
r = RSA_padding_check_PKCS1_OAEP(to, num, buf, j, num, NULL, 0);
|
||||
@@ -501,6 +592,8 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
#endif
|
||||
|
||||
err:
|
||||
+ HMAC_CTX_free(hmac);
|
||||
+ EVP_MD_free(md);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(ctx);
|
||||
OPENSSL_clear_free(buf, num);
|
||||
diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c
|
||||
index 51507fc030..5cd2b26879 100644
|
||||
--- a/crypto/rsa/rsa_pk1.c
|
||||
+++ b/crypto/rsa/rsa_pk1.c
|
||||
@@ -21,10 +21,14 @@
|
||||
#include <openssl/rand.h>
|
||||
/* Just for the SSL_MAX_MASTER_KEY_LENGTH value */
|
||||
#include <openssl/prov_ssl.h>
|
||||
+#include <openssl/evp.h>
|
||||
+#include <openssl/sha.h>
|
||||
+#include <openssl/hmac.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include "crypto/rsa.h"
|
||||
#include "rsa_local.h"
|
||||
|
||||
+
|
||||
int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
|
||||
const unsigned char *from, int flen)
|
||||
{
|
||||
@@ -273,6 +277,254 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
||||
return constant_time_select_int(good, mlen, -1);
|
||||
}
|
||||
|
||||
+
|
||||
+static int ossl_rsa_prf(OSSL_LIB_CTX *ctx,
|
||||
+ unsigned char *to, int tlen,
|
||||
+ const char *label, int llen,
|
||||
+ const unsigned char *kdk,
|
||||
+ uint16_t bitlen)
|
||||
+{
|
||||
+ int pos;
|
||||
+ int ret = -1;
|
||||
+ uint16_t iter = 0;
|
||||
+ unsigned char be_iter[sizeof(iter)];
|
||||
+ unsigned char be_bitlen[sizeof(bitlen)];
|
||||
+ HMAC_CTX *hmac = NULL;
|
||||
+ EVP_MD *md = NULL;
|
||||
+ unsigned char hmac_out[SHA256_DIGEST_LENGTH];
|
||||
+ unsigned int md_len;
|
||||
+
|
||||
+ if (tlen * 8 != bitlen) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ be_bitlen[0] = (bitlen >> 8) & 0xff;
|
||||
+ be_bitlen[1] = bitlen & 0xff;
|
||||
+
|
||||
+ hmac = HMAC_CTX_new();
|
||||
+ if (hmac == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * we use hardcoded hash so that migrating between versions that use
|
||||
+ * different hash doesn't provide a Bleichenbacher oracle:
|
||||
+ * if the attacker can see that different versions return different
|
||||
+ * messages for the same ciphertext, they'll know that the message is
|
||||
+ * syntethically generated, which means that the padding check failed
|
||||
+ */
|
||||
+ md = EVP_MD_fetch(ctx, "sha256", NULL);
|
||||
+ if (md == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (HMAC_Init_ex(hmac, kdk, SHA256_DIGEST_LENGTH, md, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ for (pos = 0; pos < tlen; pos += SHA256_DIGEST_LENGTH, iter++) {
|
||||
+ if (HMAC_Init_ex(hmac, NULL, 0, NULL, NULL) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ be_iter[0] = (iter >> 8) & 0xff;
|
||||
+ be_iter[1] = iter & 0xff;
|
||||
+
|
||||
+ if (HMAC_Update(hmac, be_iter, sizeof(be_iter)) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ if (HMAC_Update(hmac, (unsigned char *)label, llen) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ if (HMAC_Update(hmac, be_bitlen, sizeof(be_bitlen)) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * HMAC_Final requires the output buffer to fit the whole MAC
|
||||
+ * value, so we need to use the intermediate buffer for the last
|
||||
+ * unaligned block
|
||||
+ */
|
||||
+ md_len = SHA256_DIGEST_LENGTH;
|
||||
+ if (pos + SHA256_DIGEST_LENGTH > tlen) {
|
||||
+ if (HMAC_Final(hmac, hmac_out, &md_len) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ memcpy(to + pos, hmac_out, tlen - pos);
|
||||
+ } else {
|
||||
+ if (HMAC_Final(hmac, to + pos, &md_len) <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ goto err;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+
|
||||
+err:
|
||||
+ HMAC_CTX_free(hmac);
|
||||
+ EVP_MD_free(md);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * ossl_rsa_padding_check_PKCS1_type_2() checks and removes the PKCS#1 type 2
|
||||
+ * padding from a decrypted RSA message. Unlike the
|
||||
+ * RSA_padding_check_PKCS1_type_2() it will not return an error in case it
|
||||
+ * detects a padding error, rather it will return a deterministically generated
|
||||
+ * random message. In other words it will perform an implicit rejection
|
||||
+ * of an invalid padding. This means that the returned value does not indicate
|
||||
+ * if the padding of the encrypted message was correct or not, making
|
||||
+ * side channel attacks like the ones described by Bleichenbacher impossible
|
||||
+ * without access to the full decrypted value and a brute-force search of
|
||||
+ * remaining padding bytes
|
||||
+ */
|
||||
+int ossl_rsa_padding_check_PKCS1_type_2(OSSL_LIB_CTX *ctx,
|
||||
+ unsigned char *to, int tlen,
|
||||
+ const unsigned char *from, int flen,
|
||||
+ int num, unsigned char *kdk)
|
||||
+{
|
||||
+/*
|
||||
+ * We need to generate a random length for the synthethic message, to avoid
|
||||
+ * bias towards zero and avoid non-constant timeness of DIV, we prepare
|
||||
+ * 128 values to check if they are not too large for the used key size,
|
||||
+ * and use 0 in case none of them are small enough, as 2^-128 is a good enough
|
||||
+ * safety margin
|
||||
+ */
|
||||
+#define MAX_LEN_GEN_TRIES 128
|
||||
+ unsigned char *synthetic = NULL;
|
||||
+ int synthethic_length;
|
||||
+ uint16_t len_candidate;
|
||||
+ unsigned char candidate_lengths[MAX_LEN_GEN_TRIES * sizeof(len_candidate)];
|
||||
+ uint16_t len_mask;
|
||||
+ uint16_t max_sep_offset;
|
||||
+ int synth_msg_index = 0;
|
||||
+ int ret = -1;
|
||||
+ int i, j;
|
||||
+ unsigned int good, found_zero_byte;
|
||||
+ int zero_index = 0, msg_index;
|
||||
+
|
||||
+ /*
|
||||
+ * If these checks fail then either the message in publicly invalid, or
|
||||
+ * we've been called incorrectly. We can fail immediately.
|
||||
+ * Since this code is called only internally by openssl, those are just
|
||||
+ * sanity checks
|
||||
+ */
|
||||
+ if (num != flen || tlen <= 0 || flen <= 0) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* Generate a random message to return in case the padding checks fail */
|
||||
+ synthetic = OPENSSL_malloc(flen);
|
||||
+ if (synthetic == NULL) {
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (ossl_rsa_prf(ctx, synthetic, flen, "message", 7, kdk, flen * 8) < 0)
|
||||
+ goto err;
|
||||
+
|
||||
+ /* decide how long the random message should be */
|
||||
+ if (ossl_rsa_prf(ctx, candidate_lengths, sizeof(candidate_lengths),
|
||||
+ "length", 6, kdk,
|
||||
+ MAX_LEN_GEN_TRIES * sizeof(len_candidate) * 8) < 0)
|
||||
+ goto err;
|
||||
+
|
||||
+ /*
|
||||
+ * max message size is the size of the modulus size less 2 bytes for
|
||||
+ * version and padding type and a minimum of 8 bytes padding
|
||||
+ */
|
||||
+ len_mask = max_sep_offset = flen - 2 - 8;
|
||||
+ /*
|
||||
+ * we want a mask so lets propagate the high bit to all positions less
|
||||
+ * significant than it
|
||||
+ */
|
||||
+ len_mask |= len_mask >> 1;
|
||||
+ len_mask |= len_mask >> 2;
|
||||
+ len_mask |= len_mask >> 4;
|
||||
+ len_mask |= len_mask >> 8;
|
||||
+
|
||||
+ synthethic_length = 0;
|
||||
+ for (i = 0; i < MAX_LEN_GEN_TRIES * (int)sizeof(len_candidate);
|
||||
+ i += sizeof(len_candidate)) {
|
||||
+ len_candidate = (candidate_lengths[i] << 8) | candidate_lengths[i + 1];
|
||||
+ len_candidate &= len_mask;
|
||||
+
|
||||
+ synthethic_length = constant_time_select_int(
|
||||
+ constant_time_lt(len_candidate, max_sep_offset),
|
||||
+ len_candidate, synthethic_length);
|
||||
+ }
|
||||
+
|
||||
+ synth_msg_index = flen - synthethic_length;
|
||||
+
|
||||
+ /* we have alternative message ready, check the real one */
|
||||
+ good = constant_time_is_zero(from[0]);
|
||||
+ good &= constant_time_eq(from[1], 2);
|
||||
+
|
||||
+ /* then look for the padding|message separator (the first zero byte) */
|
||||
+ found_zero_byte = 0;
|
||||
+ for (i = 2; i < flen; i++) {
|
||||
+ unsigned int equals0 = constant_time_is_zero(from[i]);
|
||||
+ zero_index = constant_time_select_int(~found_zero_byte & equals0,
|
||||
+ i, zero_index);
|
||||
+ found_zero_byte |= equals0;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * padding must be at least 8 bytes long, and it starts two bytes into
|
||||
+ * |from|. If we never found a 0-byte, then |zero_index| is 0 and the check
|
||||
+ * also fails.
|
||||
+ */
|
||||
+ good &= constant_time_ge(zero_index, 2 + 8);
|
||||
+
|
||||
+ /*
|
||||
+ * Skip the zero byte. This is incorrect if we never found a zero-byte
|
||||
+ * but in this case we also do not copy the message out.
|
||||
+ */
|
||||
+ msg_index = zero_index + 1;
|
||||
+
|
||||
+ /*
|
||||
+ * old code returned an error in case the decrypted message wouldn't fit
|
||||
+ * into the |to|, since that would leak information, return the synthethic
|
||||
+ * message instead
|
||||
+ */
|
||||
+ good &= constant_time_ge(tlen, num - msg_index);
|
||||
+
|
||||
+ msg_index = constant_time_select_int(good, msg_index, synth_msg_index);
|
||||
+
|
||||
+ /*
|
||||
+ * since at this point the |msg_index| does not provide the signal
|
||||
+ * indicating if the padding check failed or not, we don't have to worry
|
||||
+ * about leaking the length of returned message, we still need to ensure
|
||||
+ * that we read contents of both buffers so that cache accesses don't leak
|
||||
+ * the value of |good|
|
||||
+ */
|
||||
+ for (i = msg_index, j = 0; i < flen && j < tlen; i++, j++)
|
||||
+ to[j] = constant_time_select_8(good, from[i], synthetic[i]);
|
||||
+ ret = j;
|
||||
+
|
||||
+err:
|
||||
+ /*
|
||||
+ * the only time ret < 0 is when the ciphertext is publicly invalid
|
||||
+ * or we were called with invalid parameters, so we don't have to perform
|
||||
+ * a side-channel secure raising of the error
|
||||
+ */
|
||||
+ if (ret < 0)
|
||||
+ ERR_raise(ERR_LIB_RSA, ERR_R_INTERNAL_ERROR);
|
||||
+ OPENSSL_free(synthetic);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* ossl_rsa_padding_check_PKCS1_type_2_TLS() checks and removes the PKCS1 type 2
|
||||
* padding from a decrypted RSA message in a TLS signature. The result is stored
|
||||
diff --git a/doc/man1/openssl-pkeyutl.pod.in b/doc/man1/openssl-pkeyutl.pod.in
|
||||
index 2f6ef0021d..015265a74d 100644
|
||||
--- a/doc/man1/openssl-pkeyutl.pod.in
|
||||
+++ b/doc/man1/openssl-pkeyutl.pod.in
|
||||
@@ -273,6 +273,11 @@ signed or verified directly instead of using a B<DigestInfo> structure. If a
|
||||
digest is set, then the B<DigestInfo> structure is used and its length
|
||||
must correspond to the digest type.
|
||||
|
||||
+Note, for B<pkcs1> padding, as a protection against Bleichenbacher attack,
|
||||
+the decryption will not fail in case of padding check failures. Use B<none>
|
||||
+and manual inspection of the decrypted message to verify if the decrypted
|
||||
+value has correct PKCS#1 v1.5 padding.
|
||||
+
|
||||
For B<oaep> mode only encryption and decryption is supported.
|
||||
|
||||
For B<x931> if the digest type is set it is used to format the block data
|
||||
diff --git a/doc/man1/openssl-rsautl.pod.in b/doc/man1/openssl-rsautl.pod.in
|
||||
index 0a32fd965b..4c462abc8c 100644
|
||||
--- a/doc/man1/openssl-rsautl.pod.in
|
||||
+++ b/doc/man1/openssl-rsautl.pod.in
|
||||
@@ -105,6 +105,11 @@ The padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP,
|
||||
ANSI X9.31, or no padding, respectively.
|
||||
For signatures, only B<-pkcs> and B<-raw> can be used.
|
||||
|
||||
+Note: because of protection against Bleichenbacher attacks, decryption
|
||||
+using PKCS#1 v1.5 mode will not return errors in case padding check failed.
|
||||
+Use B<-raw> and inspect the returned value manually to check if the
|
||||
+padding is correct.
|
||||
+
|
||||
=item B<-hexdump>
|
||||
|
||||
Hex dump the output data.
|
||||
diff --git a/doc/man3/EVP_PKEY_CTX_ctrl.pod b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
index 3075eaafd6..e788f38809 100644
|
||||
--- a/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
+++ b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
@@ -386,6 +386,13 @@ this behaviour should be tolerated then
|
||||
OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION should be set to the actual
|
||||
negotiated protocol version. Otherwise it should be left unset.
|
||||
|
||||
+Similarly to the B<RSA_PKCS1_WITH_TLS_PADDING> above, since OpenSSL version
|
||||
+3.1.0, the use of B<RSA_PKCS1_PADDING> will return a randomly generated message
|
||||
+instead of padding errors in case padding checks fail. Applications that
|
||||
+want to remain secure while using earlier versions of OpenSSL, still need to
|
||||
+handle both the error code from the RSA decryption operation and the
|
||||
+returned message in a side channel secure manner.
|
||||
+
|
||||
=head2 DSA parameters
|
||||
|
||||
EVP_PKEY_CTX_set_dsa_paramgen_bits() sets the number of bits used for DSA
|
||||
diff --git a/doc/man3/EVP_PKEY_decrypt.pod b/doc/man3/EVP_PKEY_decrypt.pod
|
||||
index b6f9bad5f1..898535a7a2 100644
|
||||
--- a/doc/man3/EVP_PKEY_decrypt.pod
|
||||
+++ b/doc/man3/EVP_PKEY_decrypt.pod
|
||||
@@ -51,6 +51,18 @@ return 1 for success and 0 or a negative value for failure. In particular a
|
||||
return value of -2 indicates the operation is not supported by the public key
|
||||
algorithm.
|
||||
|
||||
+=head1 WARNINGS
|
||||
+
|
||||
+In OpenSSL versions before 3.1.0, when used in PKCS#1 v1.5 padding,
|
||||
+both the return value from the EVP_PKEY_decrypt() and the B<outlen> provided
|
||||
+information useful in mounting a Bleichenbacher attack against the
|
||||
+used private key. They had to processed in a side-channel free way.
|
||||
+
|
||||
+Since version 3.1.0, the EVP_PKEY_decrypt() method when used with PKCS#1
|
||||
+v1.5 padding doesn't return an error in case it detects an error in padding,
|
||||
+instead it returns a pseudo-randomly generated message, removing the need
|
||||
+of side-channel secure code from applications using OpenSSL.
|
||||
+
|
||||
=head1 EXAMPLES
|
||||
|
||||
Decrypt data using OAEP (for RSA keys):
|
||||
diff --git a/doc/man3/RSA_padding_add_PKCS1_type_1.pod b/doc/man3/RSA_padding_add_PKCS1_type_1.pod
|
||||
index 9f7025c497..36ae18563f 100644
|
||||
--- a/doc/man3/RSA_padding_add_PKCS1_type_1.pod
|
||||
+++ b/doc/man3/RSA_padding_add_PKCS1_type_1.pod
|
||||
@@ -121,8 +121,8 @@ L<ERR_get_error(3)>.
|
||||
|
||||
=head1 WARNINGS
|
||||
|
||||
-The result of RSA_padding_check_PKCS1_type_2() is a very sensitive
|
||||
-information which can potentially be used to mount a Bleichenbacher
|
||||
+The result of RSA_padding_check_PKCS1_type_2() is exactly the
|
||||
+information which is used to mount a classical Bleichenbacher
|
||||
padding oracle attack. This is an inherent weakness in the PKCS #1
|
||||
v1.5 padding design. Prefer PKCS1_OAEP padding. If that is not
|
||||
possible, the result of RSA_padding_check_PKCS1_type_2() should be
|
||||
@@ -137,6 +137,9 @@ as this would create a small timing side channel which could be
|
||||
used to mount a Bleichenbacher attack against any padding mode
|
||||
including PKCS1_OAEP.
|
||||
|
||||
+You should prefer the use of EVP PKEY APIs for PKCS#1 v1.5 decryption
|
||||
+as they implement the necessary workarounds internally.
|
||||
+
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<RSA_public_encrypt(3)>,
|
||||
diff --git a/doc/man3/RSA_public_encrypt.pod b/doc/man3/RSA_public_encrypt.pod
|
||||
index 1d38073aea..bd3f835ac6 100644
|
||||
--- a/doc/man3/RSA_public_encrypt.pod
|
||||
+++ b/doc/man3/RSA_public_encrypt.pod
|
||||
@@ -52,8 +52,8 @@ Encrypting user data directly with RSA is insecure.
|
||||
|
||||
=back
|
||||
|
||||
-B<flen> must not be more than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5
|
||||
-based padding modes, not more than RSA_size(B<rsa>) - 42 for
|
||||
+When encrypting B<flen> must not be more than RSA_size(B<rsa>) - 11 for the
|
||||
+PKCS #1 v1.5 based padding modes, not more than RSA_size(B<rsa>) - 42 for
|
||||
RSA_PKCS1_OAEP_PADDING and exactly RSA_size(B<rsa>) for RSA_NO_PADDING.
|
||||
When a padding mode other than RSA_NO_PADDING is in use, then
|
||||
RSA_public_encrypt() will include some random bytes into the ciphertext
|
||||
@@ -92,6 +92,13 @@ which can potentially be used to mount a Bleichenbacher padding oracle
|
||||
attack. This is an inherent weakness in the PKCS #1 v1.5 padding
|
||||
design. Prefer RSA_PKCS1_OAEP_PADDING.
|
||||
|
||||
+In OpenSSL before version 3.1.0, both the return value and the length of
|
||||
+returned value could be used to mount the Bleichenbacher attack.
|
||||
+Since version 3.1.0, OpenSSL does not return an error in case of padding
|
||||
+checks failed. Instead it generates a random message based on used private
|
||||
+key and provided ciphertext so that application code doesn't have to implement
|
||||
+a side-channel secure error handling.
|
||||
+
|
||||
=head1 CONFORMING TO
|
||||
|
||||
SSL, PKCS #1 v2.0
|
||||
diff --git a/include/crypto/rsa.h b/include/crypto/rsa.h
|
||||
index 949873d0ee..f267e5d9d1 100644
|
||||
--- a/include/crypto/rsa.h
|
||||
+++ b/include/crypto/rsa.h
|
||||
@@ -83,6 +83,10 @@ int ossl_rsa_param_decode(RSA *rsa, const X509_ALGOR *alg);
|
||||
RSA *ossl_rsa_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
+int ossl_rsa_padding_check_PKCS1_type_2(OSSL_LIB_CTX *ctx,
|
||||
+ unsigned char *to, int tlen,
|
||||
+ const unsigned char *from, int flen,
|
||||
+ int num, unsigned char *kdk);
|
||||
int ossl_rsa_padding_check_PKCS1_type_2_TLS(OSSL_LIB_CTX *ctx, unsigned char *to,
|
||||
size_t tlen,
|
||||
const unsigned char *from,
|
||||
--
|
||||
2.34.1
|
||||
|
||||
358
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-2.patch
Normal file
358
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-2.patch
Normal file
@@ -0,0 +1,358 @@
|
||||
From e92f0cd3b03e5aca948b03df7e3d02e536700f68 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Thu, 27 Oct 2022 19:16:58 +0200
|
||||
Subject: [PATCH 2/3] rsa: Add option to disable implicit rejection
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/openssl/openssl/commit/5ab3ec1bb1eaa795d775f5896818cfaa84d33a1a]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
crypto/cms/cms_env.c | 7 +++++
|
||||
crypto/evp/ctrl_params_translate.c | 6 +++++
|
||||
crypto/rsa/rsa_ossl.c | 16 ++++++++----
|
||||
crypto/rsa/rsa_pmeth.c | 20 +++++++++++++-
|
||||
doc/man1/openssl-pkeyutl.pod.in | 10 +++++++
|
||||
doc/man3/EVP_PKEY_CTX_ctrl.pod | 2 ++
|
||||
doc/man7/provider-asym_cipher.pod | 9 +++++++
|
||||
include/openssl/core_names.h | 2 ++
|
||||
include/openssl/rsa.h | 5 ++++
|
||||
.../implementations/asymciphers/rsa_enc.c | 26 +++++++++++++++++--
|
||||
10 files changed, 95 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c
|
||||
index 445a16fb77..49b0289114 100644
|
||||
--- a/crypto/cms/cms_env.c
|
||||
+++ b/crypto/cms/cms_env.c
|
||||
@@ -581,6 +581,13 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms,
|
||||
if (!ossl_cms_env_asn1_ctrl(ri, 1))
|
||||
goto err;
|
||||
|
||||
+ if (EVP_PKEY_is_a(pkey, "RSA"))
|
||||
+ /* upper layer CMS code incorrectly assumes that a successful RSA
|
||||
+ * decryption means that the key matches ciphertext (which never
|
||||
+ * was the case, implicit rejection or not), so to make it work
|
||||
+ * disable implicit rejection for RSA keys */
|
||||
+ EVP_PKEY_CTX_ctrl_str(ktri->pctx, "rsa_pkcs1_implicit_rejection", "0");
|
||||
+
|
||||
if (EVP_PKEY_decrypt(ktri->pctx, NULL, &eklen,
|
||||
ktri->encryptedKey->data,
|
||||
ktri->encryptedKey->length) <= 0)
|
||||
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c
|
||||
index 44d0895bcf..db7325439a 100644
|
||||
--- a/crypto/evp/ctrl_params_translate.c
|
||||
+++ b/crypto/evp/ctrl_params_translate.c
|
||||
@@ -2269,6 +2269,12 @@ static const struct translation_st evp_pkey_ctx_translations[] = {
|
||||
EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, NULL, NULL,
|
||||
OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, OSSL_PARAM_OCTET_PTR, NULL },
|
||||
|
||||
+ { SET, EVP_PKEY_RSA, 0, EVP_PKEY_OP_TYPE_CRYPT,
|
||||
+ EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION, NULL,
|
||||
+ "rsa_pkcs1_implicit_rejection",
|
||||
+ OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, OSSL_PARAM_UNSIGNED_INTEGER,
|
||||
+ NULL },
|
||||
+
|
||||
{ SET, EVP_PKEY_RSA_PSS, 0, EVP_PKEY_OP_TYPE_GEN,
|
||||
EVP_PKEY_CTRL_MD, "rsa_pss_keygen_md", NULL,
|
||||
OSSL_ALG_PARAM_DIGEST, OSSL_PARAM_UTF8_STRING, fix_md },
|
||||
diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c
|
||||
index 330302ae55..4bdacd5ed9 100644
|
||||
--- a/crypto/rsa/rsa_ossl.c
|
||||
+++ b/crypto/rsa/rsa_ossl.c
|
||||
@@ -395,6 +395,12 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
BIGNUM *unblind = NULL;
|
||||
BN_BLINDING *blinding = NULL;
|
||||
|
||||
+ /*
|
||||
+ * we need the value of the private exponent to perform implicit rejection
|
||||
+ */
|
||||
+ if ((rsa->flags & RSA_FLAG_EXT_PKEY) && (padding == RSA_PKCS1_PADDING))
|
||||
+ padding = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
|
||||
+
|
||||
if ((ctx = BN_CTX_new_ex(rsa->libctx)) == NULL)
|
||||
goto err;
|
||||
BN_CTX_start(ctx);
|
||||
@@ -489,7 +495,7 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
* derive the Key Derivation Key from private exponent and public
|
||||
* ciphertext
|
||||
*/
|
||||
- if (!(rsa->flags & RSA_FLAG_EXT_PKEY)) {
|
||||
+ if (padding == RSA_PKCS1_PADDING) {
|
||||
/*
|
||||
* because we use d as a handle to rsa->d we need to keep it local and
|
||||
* free before any further use of rsa->d
|
||||
@@ -565,11 +571,11 @@ static int rsa_ossl_private_decrypt(int flen, const unsigned char *from,
|
||||
goto err;
|
||||
|
||||
switch (padding) {
|
||||
+ case RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING:
|
||||
+ r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
+ break;
|
||||
case RSA_PKCS1_PADDING:
|
||||
- if (rsa->flags & RSA_FLAG_EXT_PKEY)
|
||||
- r = RSA_padding_check_PKCS1_type_2(to, num, buf, j, num);
|
||||
- else
|
||||
- r = ossl_rsa_padding_check_PKCS1_type_2(rsa->libctx, to, num, buf, j, num, kdk);
|
||||
+ r = ossl_rsa_padding_check_PKCS1_type_2(rsa->libctx, to, num, buf, j, num, kdk);
|
||||
break;
|
||||
case RSA_PKCS1_OAEP_PADDING:
|
||||
r = RSA_padding_check_PKCS1_OAEP(to, num, buf, j, num, NULL, 0);
|
||||
diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c
|
||||
index 0bf5ac098a..81b031f81b 100644
|
||||
--- a/crypto/rsa/rsa_pmeth.c
|
||||
+++ b/crypto/rsa/rsa_pmeth.c
|
||||
@@ -52,6 +52,8 @@ typedef struct {
|
||||
/* OAEP label */
|
||||
unsigned char *oaep_label;
|
||||
size_t oaep_labellen;
|
||||
+ /* if to use implicit rejection in PKCS#1 v1.5 decryption */
|
||||
+ int implicit_rejection;
|
||||
} RSA_PKEY_CTX;
|
||||
|
||||
/* True if PSS parameters are restricted */
|
||||
@@ -72,6 +74,7 @@ static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
|
||||
/* Maximum for sign, auto for verify */
|
||||
rctx->saltlen = RSA_PSS_SALTLEN_AUTO;
|
||||
rctx->min_saltlen = -1;
|
||||
+ rctx->implicit_rejection = 1;
|
||||
ctx->data = rctx;
|
||||
ctx->keygen_info = rctx->gentmp;
|
||||
ctx->keygen_info_count = 2;
|
||||
@@ -97,6 +100,7 @@ static int pkey_rsa_copy(EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src)
|
||||
dctx->md = sctx->md;
|
||||
dctx->mgf1md = sctx->mgf1md;
|
||||
dctx->saltlen = sctx->saltlen;
|
||||
+ dctx->implicit_rejection = sctx->implicit_rejection;
|
||||
if (sctx->oaep_label) {
|
||||
OPENSSL_free(dctx->oaep_label);
|
||||
dctx->oaep_label = OPENSSL_memdup(sctx->oaep_label, sctx->oaep_labellen);
|
||||
@@ -347,6 +351,7 @@ static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx,
|
||||
const unsigned char *in, size_t inlen)
|
||||
{
|
||||
int ret;
|
||||
+ int pad_mode;
|
||||
RSA_PKEY_CTX *rctx = ctx->data;
|
||||
/*
|
||||
* Discard const. Its marked as const because this may be a cached copy of
|
||||
@@ -367,7 +372,12 @@ static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx,
|
||||
rctx->oaep_labellen,
|
||||
rctx->md, rctx->mgf1md);
|
||||
} else {
|
||||
- ret = RSA_private_decrypt(inlen, in, out, rsa, rctx->pad_mode);
|
||||
+ if (rctx->pad_mode == RSA_PKCS1_PADDING &&
|
||||
+ rctx->implicit_rejection == 0)
|
||||
+ pad_mode = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
|
||||
+ else
|
||||
+ pad_mode = rctx->pad_mode;
|
||||
+ ret = RSA_private_decrypt(inlen, in, out, rsa, pad_mode);
|
||||
}
|
||||
*outlen = constant_time_select_s(constant_time_msb_s(ret), *outlen, ret);
|
||||
ret = constant_time_select_int(constant_time_msb(ret), ret, 1);
|
||||
@@ -591,6 +601,14 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
|
||||
*(unsigned char **)p2 = rctx->oaep_label;
|
||||
return rctx->oaep_labellen;
|
||||
|
||||
+ case EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION:
|
||||
+ if (rctx->pad_mode != RSA_PKCS1_PADDING) {
|
||||
+ ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE);
|
||||
+ return -2;
|
||||
+ }
|
||||
+ rctx->implicit_rejection = p1;
|
||||
+ return 1;
|
||||
+
|
||||
case EVP_PKEY_CTRL_DIGESTINIT:
|
||||
case EVP_PKEY_CTRL_PKCS7_SIGN:
|
||||
#ifndef OPENSSL_NO_CMS
|
||||
diff --git a/doc/man1/openssl-pkeyutl.pod.in b/doc/man1/openssl-pkeyutl.pod.in
|
||||
index 015265a74d..5e62551d34 100644
|
||||
--- a/doc/man1/openssl-pkeyutl.pod.in
|
||||
+++ b/doc/man1/openssl-pkeyutl.pod.in
|
||||
@@ -305,6 +305,16 @@ explicitly set in PSS mode then the signing digest is used.
|
||||
Sets the digest used for the OAEP hash function. If not explicitly set then
|
||||
SHA1 is used.
|
||||
|
||||
+=item B<rsa_pkcs1_implicit_rejection:>I<flag>
|
||||
+
|
||||
+Disables (when set to 0) or enables (when set to 1) the use of implicit
|
||||
+rejection with PKCS#1 v1.5 decryption. When enabled (the default), as a
|
||||
+protection against Bleichenbacher attack, the library will generate a
|
||||
+deterministic random plaintext that it will return to the caller in case
|
||||
+of padding check failure.
|
||||
+When disabled, it's the callers' responsibility to handle the returned
|
||||
+errors in a side-channel free manner.
|
||||
+
|
||||
=back
|
||||
|
||||
=head1 RSA-PSS ALGORITHM
|
||||
diff --git a/doc/man3/EVP_PKEY_CTX_ctrl.pod b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
index e788f38809..3844aa2199 100644
|
||||
--- a/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
+++ b/doc/man3/EVP_PKEY_CTX_ctrl.pod
|
||||
@@ -392,6 +392,8 @@ instead of padding errors in case padding checks fail. Applications that
|
||||
want to remain secure while using earlier versions of OpenSSL, still need to
|
||||
handle both the error code from the RSA decryption operation and the
|
||||
returned message in a side channel secure manner.
|
||||
+This protection against Bleichenbacher attacks can be disabled by setting
|
||||
+the OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION (an unsigned integer) to 0.
|
||||
|
||||
=head2 DSA parameters
|
||||
|
||||
diff --git a/doc/man7/provider-asym_cipher.pod b/doc/man7/provider-asym_cipher.pod
|
||||
index 0976a263a8..2a8426a6ed 100644
|
||||
--- a/doc/man7/provider-asym_cipher.pod
|
||||
+++ b/doc/man7/provider-asym_cipher.pod
|
||||
@@ -234,6 +234,15 @@ The TLS protocol version first requested by the client.
|
||||
|
||||
The negotiated TLS protocol version.
|
||||
|
||||
+=item "implicit-rejection" (B<OSSL_PKEY_PARAM_IMPLICIT_REJECTION>) <unsigned integer>
|
||||
+
|
||||
+Gets of sets the use of the implicit rejection mechanism for RSA PKCS#1 v1.5
|
||||
+decryption. When set (non zero value), the decryption API will return
|
||||
+a deterministically random value if the PKCS#1 v1.5 padding check fails.
|
||||
+This makes explotation of the Bleichenbacher significantly harder, even
|
||||
+if the code using the RSA decryption API is not implemented in side-channel
|
||||
+free manner. Set by default.
|
||||
+
|
||||
=back
|
||||
|
||||
OSSL_FUNC_asym_cipher_gettable_ctx_params() and OSSL_FUNC_asym_cipher_settable_ctx_params()
|
||||
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h
|
||||
index 6bed5a8a67..5a350b537f 100644
|
||||
--- a/include/openssl/core_names.h
|
||||
+++ b/include/openssl/core_names.h
|
||||
@@ -292,6 +292,7 @@ extern "C" {
|
||||
#define OSSL_PKEY_PARAM_DIST_ID "distid"
|
||||
#define OSSL_PKEY_PARAM_PUB_KEY "pub"
|
||||
#define OSSL_PKEY_PARAM_PRIV_KEY "priv"
|
||||
+#define OSSL_PKEY_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
||||
|
||||
/* Diffie-Hellman/DSA Parameters */
|
||||
#define OSSL_PKEY_PARAM_FFC_P "p"
|
||||
@@ -467,6 +468,7 @@ extern "C" {
|
||||
#define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL "oaep-label"
|
||||
#define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION "tls-client-version"
|
||||
#define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION "tls-negotiated-version"
|
||||
+#define OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
||||
|
||||
/*
|
||||
* Encoder / decoder parameters
|
||||
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
|
||||
index a55c9727c6..247f9014e3 100644
|
||||
--- a/include/openssl/rsa.h
|
||||
+++ b/include/openssl/rsa.h
|
||||
@@ -183,6 +183,8 @@ int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
||||
|
||||
# define EVP_PKEY_CTRL_RSA_KEYGEN_PRIMES (EVP_PKEY_ALG_CTRL + 13)
|
||||
|
||||
+# define EVP_PKEY_CTRL_RSA_IMPLICIT_REJECTION (EVP_PKEY_ALG_CTRL + 14)
|
||||
+
|
||||
# define RSA_PKCS1_PADDING 1
|
||||
# define RSA_NO_PADDING 3
|
||||
# define RSA_PKCS1_OAEP_PADDING 4
|
||||
@@ -192,6 +194,9 @@ int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, unsigned char **label);
|
||||
# define RSA_PKCS1_PSS_PADDING 6
|
||||
# define RSA_PKCS1_WITH_TLS_PADDING 7
|
||||
|
||||
+/* internal RSA_ only */
|
||||
+# define RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING 8
|
||||
+
|
||||
# define RSA_PKCS1_PADDING_SIZE 11
|
||||
|
||||
# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
|
||||
diff --git a/providers/implementations/asymciphers/rsa_enc.c b/providers/implementations/asymciphers/rsa_enc.c
|
||||
index c8921acd6e..11a91e62b1 100644
|
||||
--- a/providers/implementations/asymciphers/rsa_enc.c
|
||||
+++ b/providers/implementations/asymciphers/rsa_enc.c
|
||||
@@ -75,6 +75,8 @@ typedef struct {
|
||||
/* TLS padding */
|
||||
unsigned int client_version;
|
||||
unsigned int alt_version;
|
||||
+ /* PKCS#1 v1.5 decryption mode */
|
||||
+ unsigned int implicit_rejection;
|
||||
} PROV_RSA_CTX;
|
||||
|
||||
static void *rsa_newctx(void *provctx)
|
||||
@@ -107,6 +109,7 @@ static int rsa_init(void *vprsactx, void *vrsa, const OSSL_PARAM params[],
|
||||
RSA_free(prsactx->rsa);
|
||||
prsactx->rsa = vrsa;
|
||||
prsactx->operation = operation;
|
||||
+ prsactx->implicit_rejection = 1;
|
||||
|
||||
switch (RSA_test_flags(prsactx->rsa, RSA_FLAG_TYPE_MASK)) {
|
||||
case RSA_FLAG_TYPE_RSA:
|
||||
@@ -199,6 +202,7 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,
|
||||
{
|
||||
PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx;
|
||||
int ret;
|
||||
+ int pad_mode;
|
||||
size_t len = RSA_size(prsactx->rsa);
|
||||
|
||||
if (!ossl_prov_is_running())
|
||||
@@ -276,8 +280,12 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,
|
||||
}
|
||||
OPENSSL_free(tbuf);
|
||||
} else {
|
||||
- ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa,
|
||||
- prsactx->pad_mode);
|
||||
+ if ((prsactx->implicit_rejection == 0) &&
|
||||
+ (prsactx->pad_mode == RSA_PKCS1_PADDING))
|
||||
+ pad_mode = RSA_PKCS1_NO_IMPLICIT_REJECT_PADDING;
|
||||
+ else
|
||||
+ pad_mode = prsactx->pad_mode;
|
||||
+ ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa, pad_mode);
|
||||
}
|
||||
*outlen = constant_time_select_s(constant_time_msb_s(ret), *outlen, ret);
|
||||
ret = constant_time_select_int(constant_time_msb(ret), 0, 1);
|
||||
@@ -401,6 +409,10 @@ static int rsa_get_ctx_params(void *vprsactx, OSSL_PARAM *params)
|
||||
if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->alt_version))
|
||||
return 0;
|
||||
|
||||
+ p = OSSL_PARAM_locate(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);
|
||||
+ if (p != NULL && !OSSL_PARAM_set_uint(p, prsactx->implicit_rejection))
|
||||
+ return 0;
|
||||
+
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -412,6 +424,7 @@ static const OSSL_PARAM known_gettable_ctx_params[] = {
|
||||
NULL, 0),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
|
||||
+ OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
|
||||
OSSL_PARAM_END
|
||||
};
|
||||
|
||||
@@ -549,6 +562,14 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[])
|
||||
return 0;
|
||||
prsactx->alt_version = alt_version;
|
||||
}
|
||||
+ p = OSSL_PARAM_locate_const(params, OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION);
|
||||
+ if (p != NULL) {
|
||||
+ unsigned int implicit_rejection;
|
||||
+
|
||||
+ if (!OSSL_PARAM_get_uint(p, &implicit_rejection))
|
||||
+ return 0;
|
||||
+ prsactx->implicit_rejection = implicit_rejection;
|
||||
+ }
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -562,6 +583,7 @@ static const OSSL_PARAM known_settable_ctx_params[] = {
|
||||
OSSL_PARAM_octet_string(OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, NULL, 0),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION, NULL),
|
||||
OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION, NULL),
|
||||
+ OSSL_PARAM_uint(OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION, NULL),
|
||||
OSSL_PARAM_END
|
||||
};
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From ba78f7b0599ba5bfb5032dd2664465c5b13388e3 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 22 Nov 2022 18:25:49 +0100
|
||||
Subject: [PATCH 3/3] smime/pkcs7: disable the Bleichenbacher workaround
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/openssl/openssl/commit/056dade341d2589975a3aae71f81c8d7061583c7]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
crypto/pkcs7/pk7_doit.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c
|
||||
index e9de097da1..6d3124da87 100644
|
||||
--- a/crypto/pkcs7/pk7_doit.c
|
||||
+++ b/crypto/pkcs7/pk7_doit.c
|
||||
@@ -170,6 +170,13 @@ static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen,
|
||||
if (EVP_PKEY_decrypt_init(pctx) <= 0)
|
||||
goto err;
|
||||
|
||||
+ if (EVP_PKEY_is_a(pkey, "RSA"))
|
||||
+ /* upper layer pkcs7 code incorrectly assumes that a successful RSA
|
||||
+ * decryption means that the key matches ciphertext (which never
|
||||
+ * was the case, implicit rejection or not), so to make it work
|
||||
+ * disable implicit rejection for RSA keys */
|
||||
+ EVP_PKEY_CTX_ctrl_str(pctx, "rsa_pkcs1_implicit_rejection", "0");
|
||||
+
|
||||
if (EVP_PKEY_decrypt(pctx, NULL, &eklen,
|
||||
ri->enc_key->data, ri->enc_key->length) <= 0)
|
||||
goto err;
|
||||
--
|
||||
2.34.1
|
||||
|
||||
441
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-4.patch
Normal file
441
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-4.patch
Normal file
@@ -0,0 +1,441 @@
|
||||
From 8ae4f0e68ebb7435be494b58676827ae91695371 Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 12 Jan 2021 14:58:04 +0100
|
||||
Subject: [PATCH] rsa: add test vectors for the implicit rejection in RSA
|
||||
PKCS#1 v1.5
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/8ae4f0e68ebb7435be494b58676827ae91695371]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
.../30-test_evp_data/evppkey_rsa_common.txt | 408 ++++++++++++++++++
|
||||
1 file changed, 408 insertions(+)
|
||||
|
||||
diff --git a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
index 080c4d02af..1405465098 100644
|
||||
--- a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
+++ b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
@@ -277,6 +277,414 @@ Derive = RSA-2048
|
||||
Result = KEYOP_INIT_ERROR
|
||||
Reason = operation not supported for this keytype
|
||||
|
||||
+# Test vectors for the Bleichenbacher workaround
|
||||
+
|
||||
+PrivateKey = RSA-2048-2
|
||||
+-----BEGIN RSA PRIVATE KEY-----
|
||||
+MIIEowIBAAKCAQEAyMyDlxQJjaVsqiNkD5PciZfBY3KWj8Gwxt9RE8HJTosh5IrS
|
||||
+KX5lQZARtObY9ec7G3iyV0ADIdHva2AtTsjOjRQclJBetK0wZjmkkgZTS25/JgdC
|
||||
+Ppff/RM8iNchOZ3vvH6WzNy9fzquH+iScSv7SSmBfVEWZkQKH6y3ogj16hZZEK3Y
|
||||
+o/LUlyAjYMy2MgJPDQcWnBkY8xb3lLFDrvVOyHUipMApePlomYC/+/ZJwwfoGBm/
|
||||
++IQJY41IvZS+FStZ/2SfoL1inQ/6GBPDq/S1a9PC6lRl3/oUWJKSqdiiStJr5+4F
|
||||
+EHQbY4LUPIPVv6QKRmE9BivkRVF9vK8MtOGnaQIDAQABAoIBABRVAQ4PLVh2Y6Zm
|
||||
+pv8czbvw7dgQBkbQKgI5IpCJksStOeVWWSlybvZQjDpxFY7wtv91HTnQdYC7LS8G
|
||||
+MhBELQYD/1DbvXs1/iybsZpHoa+FpMJJAeAsqLWLeRmyDt8yqs+/Ua20vEthubfp
|
||||
+aMqk1XD3DvGNgGMiiJPkfUOe/KeTJZvPLNEIo9hojN8HjnrHmZafIznSwfUiuWlo
|
||||
+RimpM7quwmgWJeq4T05W9ER+nYj7mhmc9xAj4OJXsURBszyE07xnyoAx0mEmGBA6
|
||||
+egpAhEJi912IkM1hblH5A1SI/W4Jnej/bWWk/xGCVIB8n1jS+7qLoVHcjGi+NJyX
|
||||
+eiBOBMECgYEA+PWta6gokxvqRZuKP23AQdI0gkCcJXHpY/MfdIYColY3GziD7UWe
|
||||
+z5cFJkWe3RbgVSL1pF2UdRsuwtrycsf4gWpSwA0YCAFxY02omdeXMiL1G5N2MFSG
|
||||
+lqn32MJKWUl8HvzUVc+5fuhtK200lyszL9owPwSZm062tcwLsz53Yd0CgYEAznou
|
||||
+O0mpC5YzChLcaCvfvfuujdbcA7YUeu+9V1dD8PbaTYYjUGG3Gv2crS00Al5WrIaw
|
||||
+93Q+s14ay8ojeJVCRGW3Bu0iF15XGMjHC2cD6o9rUQ+UW+SOWja7PDyRcytYnfwF
|
||||
+1y2AkDGURSvaITSGR+xylD8RqEbmL66+jrU2sP0CgYB2/hXxiuI5zfHfa0RcpLxr
|
||||
+uWjXiMIZM6T13NKAAz1nEgYswIpt8gTB+9C+RjB0Q+bdSmRWN1Qp1OA4yiVvrxyb
|
||||
+3pHGsXt2+BmV+RxIy768e/DjSUwINZ5OjNalh9e5bWIh/X4PtcVXXwgu5XdpeYBx
|
||||
+sru0oyI4FRtHMUu2VHkDEQKBgQCZiEiwVUmaEAnLx9KUs2sf/fICDm5zZAU+lN4a
|
||||
+AA3JNAWH9+JydvaM32CNdTtjN3sDtvQITSwCfEs4lgpiM7qe2XOLdvEOp1vkVgeL
|
||||
+9wH2fMaz8/3BhuZDNsdrNy6AkQ7ICwrcwj0C+5rhBIaigkgHW06n5W3fzziC5FFW
|
||||
+FHGikQKBgGQ790ZCn32DZnoGUwITR++/wF5jUfghqd67YODszeUAWtnp7DHlWPfp
|
||||
+LCkyjnRWnXzvfHTKvCs1XtQBoaCRS048uwZITlgZYFEWntFMqi76bqBE4FTSYUTM
|
||||
+FinFUBBVigThM/RLfCRNrCW/kTxXuJDuSfVIJZzWNAT+9oWdz5da
|
||||
+-----END RSA PRIVATE KEY-----
|
||||
+
|
||||
+# corresponding public key
|
||||
+PublicKey = RSA-2048-2-PUBLIC
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyMyDlxQJjaVsqiNkD5Pc
|
||||
+iZfBY3KWj8Gwxt9RE8HJTosh5IrSKX5lQZARtObY9ec7G3iyV0ADIdHva2AtTsjO
|
||||
+jRQclJBetK0wZjmkkgZTS25/JgdCPpff/RM8iNchOZ3vvH6WzNy9fzquH+iScSv7
|
||||
+SSmBfVEWZkQKH6y3ogj16hZZEK3Yo/LUlyAjYMy2MgJPDQcWnBkY8xb3lLFDrvVO
|
||||
+yHUipMApePlomYC/+/ZJwwfoGBm/+IQJY41IvZS+FStZ/2SfoL1inQ/6GBPDq/S1
|
||||
+a9PC6lRl3/oUWJKSqdiiStJr5+4FEHQbY4LUPIPVv6QKRmE9BivkRVF9vK8MtOGn
|
||||
+aQIDAQAB
|
||||
+-----END PUBLIC KEY-----
|
||||
+
|
||||
+PrivPubKeyPair = RSA-2048-2:RSA-2048-2-PUBLIC
|
||||
+
|
||||
+# RSA decrypt
|
||||
+
|
||||
+# a random positive test case
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 8bfe264e85d3bdeaa6b8851b8e3b956ee3d226fd3f69063a86880173a273d9f283b2eebdd1ed35f7e02d91c571981b6737d5320bd8396b0f3ad5b019daec1b0aab3cbbc026395f4fd14f13673f2dfc81f9b660ec26ac381e6db3299b4e460b43fab9955df2b3cfaa20e900e19c856238fd371899c2bf2ce8c868b76754e5db3b036533fd603746be13c10d4e3e6022ebc905d20c2a7f32b215a4cd53b3f44ca1c327d2c2b651145821c08396c89071f665349c25e44d2733cd9305985ceef6430c3cf57af5fa224089221218fa34737c79c446d28a94c41c96e4e92ac53fbcf384dea8419ea089f8784445a492c812eb0d409467f75afd7d4d1078886205a066
|
||||
+Output = "lorem ipsum dolor sit amet"
|
||||
+
|
||||
+# a random negative test case decrypting to empty
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 20aaa8adbbc593a924ba1c5c7990b5c2242ae4b99d0fe636a19a4cf754edbcee774e472fe028160ed42634f8864900cb514006da642cae6ae8c7d087caebcfa6dad1551301e130344989a1d462d4164505f6393933450c67bc6d39d8f5160907cabc251b737925a1cf21e5c6aa5781b7769f6a2a583d97cce008c0f8b6add5f0b2bd80bee60237aa39bb20719fe75749f4bc4e42466ef5a861ae3a92395c7d858d430bfe38040f445ea93fa2958b503539800ffa5ce5f8cf51fa8171a91f36cb4f4575e8de6b4d3f096ee140b938fd2f50ee13f0d050222e2a72b0a3069ff3a6738e82c87090caa5aed4fcbe882c49646aa250b98f12f83c8d528113614a29e7
|
||||
+Output =
|
||||
+
|
||||
+# invalid decrypting to max length message
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 48cceab10f39a4db32f60074feea473cbcdb7accf92e150417f76b44756b190e843e79ec12aa85083a21f5437e7bad0a60482e601198f9d86923239c8786ee728285afd0937f7dde12717f28389843d7375912b07b991f4fdb0190fced8ba665314367e8c5f9d2981d0f5128feeb46cb50fc237e64438a86df198dd0209364ae3a842d77532b66b7ef263b83b1541ed671b120dfd660462e2107a4ee7b964e734a7bd68d90dda61770658a3c242948532da32648687e0318286473f675b412d6468f013f14d760a358dfcad3cda2afeec5e268a37d250c37f722f468a70dfd92d7294c3c1ee1e7f8843b7d16f9f37ef35748c3ae93aa155cdcdfeb4e78567303
|
||||
+Output = 22d850137b9eebe092b24f602dc5bb7918c16bd89ddbf20467b119d205f9c2e4bd7d2592cf1e532106e0f33557565923c73a02d4f09c0c22bea89148183e60317f7028b3aa1f261f91c979393101d7e15f4067e63979b32751658ef769610fe97cf9cef3278b3117d384051c3b1d82c251c2305418c8f6840530e631aad63e70e20e025bcd8efb54c92ec6d3b106a2f8e64eeff7d38495b0fc50c97138af4b1c0a67a1c4e27b077b8439332edfa8608dfeae653cd6a628ac550395f7e74390e42c11682234870925eeaa1fa71b76cf1f2ee3bda69f6717033ff8b7c95c9799e7a3bea5e7e4a1c359772fb6b1c6e6c516661dfe30c3
|
||||
+
|
||||
+# invalid decrypting to message with length specified by second to last value from PRF
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1439e08c3f84c1a7fec74ce07614b20e01f6fa4e8c2a6cffdc3520d8889e5d9a950c6425798f85d4be38d300ea5695f13ecd4cb389d1ff5b82484b494d6280ab7fa78e645933981cb934cce8bfcd114cc0e6811eefa47aae20af638a1cd163d2d3366186d0a07df0c81f6c9f3171cf3561472e98a6006bf75ddb457bed036dcce199369de7d94ef2c68e8467ee0604eea2b3009479162a7891ba5c40cab17f49e1c438cb6eaea4f76ce23cce0e483ff0e96fa790ea15be67671814342d0a23f4a20262b6182e72f3a67cd289711503c85516a9ed225422f98b116f1ab080a80abd6f0216df88d8cfd67c139243be8dd78502a7aaf6bc99d7da71bcdf627e7354
|
||||
+Output = 0f9b
|
||||
+
|
||||
+# invalid decrypting to message with length specified by third to last value from PRF
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1690ebcceece2ce024f382e467cf8510e74514120937978576caf684d4a02ad569e8d76cbe365a060e00779de2f0865ccf0d923de3b4783a4e2c74f422e2f326086c390b658ba47f31ab013aa80f468c71256e5fa5679b24e83cd82c3d1e05e398208155de2212993cd2b8bab6987cf4cc1293f19909219439d74127545e9ed8a706961b8ee2119f6bfacafbef91b75a789ba65b8b833bc6149cf49b5c4d2c6359f62808659ba6541e1cd24bf7f7410486b5103f6c0ea29334ea6f4975b17387474fe920710ea61568d7b7c0a7916acf21665ad5a31c4eabcde44f8fb6120d8457afa1f3c85d517cda364af620113ae5a3c52a048821731922737307f77a1081
|
||||
+Output = 4f02
|
||||
+
|
||||
+# positive test with 11 byte long value
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 6213634593332c485cef783ea2846e3d6e8b0e005cd8293eaebbaa5079712fd681579bdfbbda138ae4d9d952917a03c92398ec0cb2bb0c6b5a8d55061fed0d0d8d72473563152648cfe640b335dc95331c21cb133a91790fa93ae44497c128708970d2beeb77e8721b061b1c44034143734a77be8220877415a6dba073c3871605380542a9f25252a4babe8331cdd53cf828423f3cc70b560624d0581fb126b2ed4f4ed358f0eb8065cf176399ac1a846a31055f9ae8c9c24a1ba050bc20842125bc1753158f8065f3adb9cc16bfdf83816bdf38b624f12022c5a6fbfe29bc91542be8c0208a770bcd677dc597f5557dc2ce28a11bf3e3857f158717a33f6592
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and zero padded ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 00a2e8f114ea8d05d12dc843e3cc3b2edc8229ff2a028bda29ba9d55e3cd02911902fef1f42a075bf05e8016e8567213d6f260fa49e360779dd81aeea3e04c2cb567e0d72b98bf754014561b7511e083d20e0bfb9cd23f8a0d3c88900c49d2fcd5843ff0765607b2026f28202a87aa94678aed22a0c20724541394cd8f44e373eba1d2bae98f516c1e2ba3d86852d064f856b1daf24795e767a2b90396e50743e3150664afab131fe40ea405dcf572dd1079af1d3f0392ccadcca0a12740dbb213b925ca2a06b1bc1383e83a658c82ba2e7427342379084d5f66b544579f07664cb26edd4f10fd913fdbc0de05ef887d4d1ec1ac95652397ea7fd4e4759fda8b
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and zero truncated ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = a2e8f114ea8d05d12dc843e3cc3b2edc8229ff2a028bda29ba9d55e3cd02911902fef1f42a075bf05e8016e8567213d6f260fa49e360779dd81aeea3e04c2cb567e0d72b98bf754014561b7511e083d20e0bfb9cd23f8a0d3c88900c49d2fcd5843ff0765607b2026f28202a87aa94678aed22a0c20724541394cd8f44e373eba1d2bae98f516c1e2ba3d86852d064f856b1daf24795e767a2b90396e50743e3150664afab131fe40ea405dcf572dd1079af1d3f0392ccadcca0a12740dbb213b925ca2a06b1bc1383e83a658c82ba2e7427342379084d5f66b544579f07664cb26edd4f10fd913fdbc0de05ef887d4d1ec1ac95652397ea7fd4e4759fda8b
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and double zero padded ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 00001f71879b426127f7dead621f7380a7098cf7d22173aa27991b143c46d53383c209bd0c9c00d84078037e715f6b98c65005a77120070522ede51d472c87ef94b94ead4c5428ee108a345561658301911ec5a8f7dd43ed4a3957fd29fb02a3529bf63f8040d3953490939bd8f78b2a3404b6fb5ff70a4bfdaac5c541d6bcce49c9778cc390be24cbef1d1eca7e870457241d3ff72ca44f9f56bdf31a890fa5eb3a9107b603ccc9d06a5dd911a664c82b6abd4fe036f8db8d5a070c2d86386ae18d97adc1847640c211d91ff5c3387574a26f8ef27ca7f48d2dd1f0c7f14b81cc9d33ee6853031d3ecf10a914ffd90947909c8011fd30249219348ebff76bfc
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test with 11 byte long value and double zero truncated ciphertext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1f71879b426127f7dead621f7380a7098cf7d22173aa27991b143c46d53383c209bd0c9c00d84078037e715f6b98c65005a77120070522ede51d472c87ef94b94ead4c5428ee108a345561658301911ec5a8f7dd43ed4a3957fd29fb02a3529bf63f8040d3953490939bd8f78b2a3404b6fb5ff70a4bfdaac5c541d6bcce49c9778cc390be24cbef1d1eca7e870457241d3ff72ca44f9f56bdf31a890fa5eb3a9107b603ccc9d06a5dd911a664c82b6abd4fe036f8db8d5a070c2d86386ae18d97adc1847640c211d91ff5c3387574a26f8ef27ca7f48d2dd1f0c7f14b81cc9d33ee6853031d3ecf10a914ffd90947909c8011fd30249219348ebff76bfc
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive that generates a 0 byte long synthethic message internally
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = b5e49308f6e9590014ffaffc5b8560755739dd501f1d4e9227a7d291408cf4b753f292322ff8bead613bf2caa181b221bc38caf6392deafb28eb21ad60930841ed02fd6225cc9c463409adbe7d8f32440212fbe3881c51375bb09565efb22e62b071472fb38676e5b4e23a0617db5d14d93519ac0007a30a9c822eb31c38b57fcb1be29608fcf1ca2abdcaf5d5752bbc2b5ac7dba5afcff4a5641da360dd01f7112539b1ed46cdb550a3b1006559b9fe1891030ec80f0727c42401ddd6cbb5e3c80f312df6ec89394c5a7118f573105e7ab00fe57833c126141b50a935224842addfb479f75160659ba28877b512bb9a93084ad8bec540f92640f63a11a010e0
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive that generates a 245 byte long synthethic message internally
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1ea0b50ca65203d0a09280d39704b24fe6e47800189db5033f202761a78bafb270c5e25abd1f7ecc6e7abc4f26d1b0cd9b8c648d529416ee64ccbdd7aa72a771d0353262b543f0e436076f40a1095f5c7dfd10dcf0059ccb30e92dfa5e0156618215f1c3ff3aa997a9d999e506924f5289e3ac72e5e2086cc7b499d71583ed561028671155db4005bee01800a7cdbdae781dd32199b8914b5d4011dd6ff11cd26d46aad54934d293b0bc403dd211bf13b5a5c6836a5e769930f437ffd8634fb7371776f4bc88fa6c271d8aa6013df89ae6470154497c4ac861be2a1c65ebffec139bf7aaba3a81c7c5cdd84da9af5d3edfb957848074686b5837ecbcb6a41c50
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# a random negative test that generates an 11 byte long message
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 5f02f4b1f46935c742ebe62b6f05aa0a3286aab91a49b34780adde6410ab46f7386e05748331864ac98e1da63686e4babe3a19ed40a7f5ceefb89179596aab07ab1015e03b8f825084dab028b6731288f2e511a4b314b6ea3997d2e8fe2825cef8897cbbdfb6c939d441d6e04948414bb69e682927ef8576c9a7090d4aad0e74c520d6d5ce63a154720f00b76de8cc550b1aa14f016d63a7b6d6eaa1f7dbe9e50200d3159b3d099c900116bf4eba3b94204f18b1317b07529751abf64a26b0a0bf1c8ce757333b3d673211b67cc0653f2fe2620d57c8b6ee574a0323a167eab1106d9bc7fd90d415be5f1e9891a0e6c709f4fc0404e8226f8477b4e939b36eb2
|
||||
+Output = af9ac70191c92413cb9f2d
|
||||
+
|
||||
+# an otherwise correct plaintext, but with wrong first byte
|
||||
+# (0x01 instead of 0x00), generates a random 11 byte long plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 9b2ec9c0c917c98f1ad3d0119aec6be51ae3106e9af1914d48600ab6a2c0c0c8ae02a2dc3039906ff3aac904af32ec798fd65f3ad1afa2e69400e7c1de81f5728f3b3291f38263bc7a90a0563e43ce7a0d4ee9c0d8a716621ca5d3d081188769ce1b131af7d35b13dea99153579c86db31fe07d5a2c14d621b77854e48a8df41b5798563af489a291e417b6a334c63222627376118c02c53b6e86310f728734ffc86ef9d7c8bf56c0c841b24b82b59f51aee4526ba1c4268506d301e4ebc498c6aebb6fd5258c876bf900bac8ca4d309dd522f6a6343599a8bc3760f422c10c72d0ad527ce4af1874124ace3d99bb74db8d69d2528db22c3a37644640f95c05f
|
||||
+Output = a1f8c9255c35cfba403ccc
|
||||
+
|
||||
+# an otherwise correct plaintext, but with wrong second byte
|
||||
+# (0x01 instead of 0x02), generates a random 11 byte long plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 782c2b59a21a511243820acedd567c136f6d3090c115232a82a5efb0b178285f55b5ec2d2bac96bf00d6592ea7cdc3341610c8fb07e527e5e2d20cfaf2c7f23e375431f45e998929a02f25fd95354c33838090bca838502259e92d86d568bc2cdb132fab2a399593ca60a015dc2bb1afcd64fef8a3834e17e5358d822980dc446e845b3ab4702b1ee41fe5db716d92348d5091c15d35a110555a35deb4650a5a1d2c98025d42d4544f8b32aa6a5e02dc02deaed9a7313b73b49b0d4772a3768b0ea0db5846ace6569cae677bf67fb0acf3c255dc01ec8400c963b6e49b1067728b4e563d7e1e1515664347b92ee64db7efb5452357a02fff7fcb7437abc2e579
|
||||
+Output = e6d700309ca0ed62452254
|
||||
+
|
||||
+# an invalid ciphertext, with a zero byte in first byte of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 0096136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
+Output = ba27b1842e7c21c0e7ef6a
|
||||
+
|
||||
+# an invalid ciphertext, with a zero byte removed from first byte of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 96136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
+Output = ba27b1842e7c21c0e7ef6a
|
||||
+
|
||||
+# an invalid ciphertext, with two zero bytes in first bytes of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 0000587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
+Output = d5cf555b1d6151029a429a
|
||||
+
|
||||
+# an invalid ciphertext, with two zero bytes removed from first bytes of
|
||||
+# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
+# plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
+Output = d5cf555b1d6151029a429a
|
||||
+
|
||||
+# and invalid ciphertext, otherwise valid but starting with 000002, decrypts
|
||||
+# to random 11 byte long synthethic plaintext
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 1786550ce8d8433052e01ecba8b76d3019f1355b212ac9d0f5191b023325a7e7714b7802f8e9a17c4cb3cd3a84041891471b10ca1fcfb5d041d34c82e6d0011cf4dc76b90e9c2e0743590579d55bcd7857057152c4a8040361343d1d22ba677d62b011407c652e234b1d663af25e2386251d7409190f19fc8ec3f9374fdf1254633874ce2ec2bff40ad0cb473f9761ec7b68da45a4bd5e33f5d7dac9b9a20821df9406b653f78a95a6c0ea0a4d57f867e4db22c17bf9a12c150f809a7b72b6db86c22a8732241ebf3c6a4f2cf82671d917aba8bc61052b40ccddd743a94ea9b538175106201971cca9d136d25081739aaf6cd18b2aecf9ad320ea3f89502f955
|
||||
+Output = 3d4a054d9358209e9cbbb9
|
||||
+
|
||||
+# negative test with otherwise valid padding but a zero byte in first byte
|
||||
+# of padding
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 179598823812d2c58a7eb50521150a48bcca8b4eb53414018b6bca19f4801456c5e36a940037ac516b0d6412ba44ec6b4f268a55ef1c5ffbf18a2f4e3522bb7b6ed89774b79bffa22f7d3102165565642de0d43a955e96a1f2e80e5430671d7266eb4f905dc8ff5e106dc5588e5b0289e49a4913940e392a97062616d2bda38155471b7d360cfb94681c702f60ed2d4de614ea72bf1c53160e63179f6c5b897b59492bee219108309f0b7b8cb2b136c346a5e98b8b4b8415fb1d713bae067911e3057f1c335b4b7e39101eafd5d28f0189037e4334f4fdb9038427b1d119a6702aa8233319cc97d496cc289ae8c956ddc84042659a2d43d6aa22f12b81ab884e
|
||||
+Output = 1f037dd717b07d3e7f7359
|
||||
+
|
||||
+# negative test with otherwise valid padding but a zero byte at the eigth
|
||||
+# byte of padding
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = a7a340675a82c30e22219a55bc07cdf36d47d01834c1834f917f18b517419ce9de2a96460e745024436470ed85e94297b283537d52189c406a3f533cb405cc6a9dba46b482ce98b6e3dd52d8fce2237425617e38c11fbc46b61897ef200d01e4f25f5f6c4c5b38cd0de38ba11908b86595a8036a08a42a3d05b79600a97ac18ba368a08d6cf6ccb624f6e8002afc75599fba4de3d4f3ba7d208391ebe8d21f8282b18e2c10869eb2702e68f9176b42b0ddc9d763f0c86ba0ff92c957aaeab76d9ab8da52ea297ec11d92d770146faa1b300e0f91ef969b53e7d2907ffc984e9a9c9d11fb7d6cba91972059b46506b035efec6575c46d7114a6b935864858445f
|
||||
+Output = 63cb0bf65fc8255dd29e17
|
||||
+
|
||||
+# negative test with an otherwise valid plaintext but with missing separator
|
||||
+# byte
|
||||
+Decrypt = RSA-2048-2
|
||||
+Input = 3d1b97e7aa34eaf1f4fc171ceb11dcfffd9a46a5b6961205b10b302818c1fcc9f4ec78bf18ea0cee7e9fa5b16fb4c611463b368b3312ac11cf9c06b7cf72b54e284848a508d3f02328c62c2999d0fb60929f81783c7a256891bc2ff4d91df2af96a24fc5701a1823af939ce6dbdc510608e3d41eec172ad2d51b9fc61b4217c923cadcf5bac321355ef8be5e5f090cdc2bd0c697d9058247db3ad613fdce87d2955a6d1c948a5160f93da21f731d74137f5d1f53a1923adb513d2e6e1589d44cc079f4c6ddd471d38ac82d20d8b1d21f8d65f3b6907086809f4123e08d86fb38729585de026a485d8f0e703fd4772f6668febf67df947b82195fa3867e3a3065
|
||||
+Output = 6f09a0b62699337c497b0b
|
||||
+
|
||||
+# Test vectors for the Bleichenbacher workaround (2049 bit key size)
|
||||
+
|
||||
+PrivateKey = RSA-2049
|
||||
+-----BEGIN RSA PRIVATE KEY-----
|
||||
+MIIEpQIBAAKCAQEBVfiJVWoXdfHHp3hqULGLwoyemG7eVmfKs5uEEk6Q66dcHbCD
|
||||
+rD5EO7qU3CNWD3XjqBaToqQ73HQm2MTq/mjIXeD+dX9uSbue1EfmAkMIANuwTOsi
|
||||
+5/pXoY0zj7ZgJs20Z+cMwEDn02fvQDx78ePfYkZQCUYx8h6v0vtbyRX/BDeazRES
|
||||
+9zLAtGYHwXjTiiD1LtpQny+cBAXVEGnoDM+UFVTQRwRnUFw89UHqCJffyfQAzssp
|
||||
+j/x1M3LZ9pM68XTMQO2W1GcDFzO5f4zd0/krw6A+qFdsQX8kAHteT3UBEFtUTen6
|
||||
+3N/635jftLsFuBmfP4Ws/ZH3qaCUuaOD9QSQlwIDAQABAoIBAQEZwrP1CnrWFSZ5
|
||||
+1/9RCVisLYym8AKFkvMy1VoWc2F4qOZ/F+cFzjAOPodUclEAYBP5dNCj20nvNEyl
|
||||
+omo0wEUHBNDkIuDOI6aUJcFf77bybhBu7/ZMyLnXRC5NpOjIUAjq6zZYWaIpT6OT
|
||||
+e8Jr5WMy59geLBYO9jXMUoqnvlXmM6cj28Hha6KeUrKa7y+eVlT9wGZrsPwlSsvo
|
||||
+DmOHTw9fAgeC48nc/CUg0MnEp7Y05FA/u0k+Gq/us/iL16EzmHJdrm/jmed1zV1M
|
||||
+8J/IODR8TJjasaSIPM5iBRNhWvqhCmM2jm17ed9BZqsWJznvUVpEAu4eBgHFpVvH
|
||||
+HfDjDt+BAoGBAYj2k2DwHhjZot4pUlPSUsMeRHbOpf97+EE99/3jVlI83JdoBfhP
|
||||
+wN3sdw3wbO0GXIETSHVLNGrxaXVod/07PVaGgsh4fQsxTvasZ9ZegTM5i2Kgg8D4
|
||||
+dlxa1A1agfm73OJSftfpUAjLECnLTKvR+em+38KGyWVSJV2n6rGSF473AoGBAN7H
|
||||
+zxHa3oOkxD0vgBl/If1dRv1XtDH0T+gaHeN/agkf/ARk7ZcdyFCINa3mzF9Wbzll
|
||||
+YTqLNnmMkubiP1LvkH6VZ+NBvrxTNxiWJfu+qx87ez+S/7JoHm71p4SowtePfC2J
|
||||
+qqok0s7b0GaBz+ZcNse/o8W6E1FiIi71wukUyYNhAoGAEgk/OnPK7dkPYKME5FQC
|
||||
++HGrMsjJVbCa9GOjvkNw8tVYSpq7q2n9sDHqRPmEBl0EYehAqyGIhmAONxVUbIsL
|
||||
+ha0m04y0MI9S0H+ZRH2R8IfzndNAONsuk46XrQU6cfvtZ3Xh3IcY5U5sr35lRn2c
|
||||
+ut3H52XIWJ4smN/cJcpOyoECgYEAjM5hNHnPlgj392wkXPkbtJXWHp3mSISQVLTd
|
||||
+G0MW8/mBQg3AlXi/eRb+RpHPrppk5jQLhgMjRSPyXXe2amb8PuWTqfGN6l32PtX3
|
||||
+3+udILpppb71Wf+w7JTbcl9v9uq7o9SVR8DKdPA+AeweSQ0TmqCnlHuNZizOSjwP
|
||||
+G16GF0ECgYEA+ZWbNMS8qM5IiHgbMbHptdit9dDT4+1UXoNn0/hUW6ZEMriHMDXv
|
||||
+iBwrzeANGAn5LEDYeDe1xPms9Is2uNxTpZVhpFZSNALR6Po68wDlTJG2PmzuBv5t
|
||||
+5mbzkpWCoD4fRU53ifsHgaTW+7Um74gWIf0erNIUZuTN2YrtEPTnb3k=
|
||||
+-----END RSA PRIVATE KEY-----
|
||||
+
|
||||
+# corresponding public key
|
||||
+PublicKey = RSA-2049-PUBLIC
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEBVfiJVWoXdfHHp3hqULGL
|
||||
+woyemG7eVmfKs5uEEk6Q66dcHbCDrD5EO7qU3CNWD3XjqBaToqQ73HQm2MTq/mjI
|
||||
+XeD+dX9uSbue1EfmAkMIANuwTOsi5/pXoY0zj7ZgJs20Z+cMwEDn02fvQDx78ePf
|
||||
+YkZQCUYx8h6v0vtbyRX/BDeazRES9zLAtGYHwXjTiiD1LtpQny+cBAXVEGnoDM+U
|
||||
+FVTQRwRnUFw89UHqCJffyfQAzsspj/x1M3LZ9pM68XTMQO2W1GcDFzO5f4zd0/kr
|
||||
+w6A+qFdsQX8kAHteT3UBEFtUTen63N/635jftLsFuBmfP4Ws/ZH3qaCUuaOD9QSQ
|
||||
+lwIDAQAB
|
||||
+-----END PUBLIC KEY-----
|
||||
+
|
||||
+PrivPubKeyPair = RSA-2049:RSA-2049-PUBLIC
|
||||
+
|
||||
+# RSA decrypt
|
||||
+
|
||||
+# malformed that generates length specified by 3rd last value from PRF
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 00b26f6404b82649629f2704494282443776929122e279a9cf30b0c6fe8122a0a9042870d97cc8ef65490fe58f031eb2442352191f5fbc311026b5147d32df914599f38b825ebb824af0d63f2d541a245c5775d1c4b78630e4996cc5fe413d38455a776cf4edcc0aa7fccb31c584d60502ed2b77398f536e137ff7ba6430e9258e21c2db5b82f5380f566876110ac4c759178900fbad7ab70ea07b1daf7a1639cbb4196543a6cbe8271f35dddb8120304f6eef83059e1c5c5678710f904a6d760c4d1d8ad076be17904b9e69910040b47914a0176fb7eea0c06444a6c4b86d674d19a556a1de5490373cb01ce31bbd15a5633362d3d2cd7d4af1b4c5121288b894
|
||||
+Output = 42
|
||||
+
|
||||
+# simple positive test case
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 013300edbf0bb3571e59889f7ed76970bf6d57e1c89bbb6d1c3991d9df8e65ed54b556d928da7d768facb395bbcc81e9f8573b45cf8195dbd85d83a59281cddf4163aec11b53b4140053e3bd109f787a7c3cec31d535af1f50e0598d85d96d91ea01913d07097d25af99c67464ebf2bb396fb28a9233e56f31f7e105d71a23e9ef3b736d1e80e713d1691713df97334779552fc94b40dd733c7251bc522b673d3ec9354af3dd4ad44fa71c0662213a57ada1d75149697d0eb55c053aaed5ffd0b815832f454179519d3736fb4faf808416071db0d0f801aca8548311ee708c131f4be658b15f6b54256872c2903ac708bd43b017b073b5707bc84c2cd9da70e967
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with null padded ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 0002aadf846a329fadc6760980303dbd87bfadfa78c2015ce4d6c5782fd9d3f1078bd3c0a2c5bfbdd1c024552e5054d98b5bcdc94e476dd280e64d650089326542ce7c61d4f1ab40004c2e6a88a883613568556a10f3f9edeab67ae8dddc1e6b0831c2793d2715de943f7ce34c5c05d1b09f14431fde566d17e76c9feee90d86a2c158616ec81dda0c642f58c0ba8fa4495843124a7235d46fb4069715a51bf710fd024259131ba94da73597ace494856c94e7a3ec261545793b0990279b15fa91c7fd13dbfb1df2f221dab9fa9f7c1d21e48aa49f6aaecbabf5ee76dc6c2af2317ffb4e303115386a97f8729afc3d0c89419669235f1a3a69570e0836c79fc162
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with null truncated ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 02aadf846a329fadc6760980303dbd87bfadfa78c2015ce4d6c5782fd9d3f1078bd3c0a2c5bfbdd1c024552e5054d98b5bcdc94e476dd280e64d650089326542ce7c61d4f1ab40004c2e6a88a883613568556a10f3f9edeab67ae8dddc1e6b0831c2793d2715de943f7ce34c5c05d1b09f14431fde566d17e76c9feee90d86a2c158616ec81dda0c642f58c0ba8fa4495843124a7235d46fb4069715a51bf710fd024259131ba94da73597ace494856c94e7a3ec261545793b0990279b15fa91c7fd13dbfb1df2f221dab9fa9f7c1d21e48aa49f6aaecbabf5ee76dc6c2af2317ffb4e303115386a97f8729afc3d0c89419669235f1a3a69570e0836c79fc162
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with double null padded ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 0000f36da3b72d8ff6ded74e7efd08c01908f3f5f0de7b55eab92b5f875190809c39d4162e1e6649618f854fd84aeab03970d16bb814e999852c06de38d82b95c0f32e2a7b5714021fe303389be9c0eac24c90a6b7210f929d390fabf903d44e04110bb7a7fd6c383c275804721efa6d7c93aa64c0bb2b18d97c5220a846c66a4895ae52adddbe2a9996825e013585adcec4b32ba61d782737bd343e5fabd68e8a95b8b1340318559860792dd70dffbe05a1052b54cbfb48cfa7bb3c19cea52076bddac5c25ee276f153a610f6d06ed696d192d8ae4507ffae4e5bdda10a625d6b67f32f7cffcd48dee2431fe66f6105f9d17e611cdcc674868e81692a360f4052
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# positive test case with double null truncated ciphertext
|
||||
+Decrypt = RSA-2049
|
||||
+Input = f36da3b72d8ff6ded74e7efd08c01908f3f5f0de7b55eab92b5f875190809c39d4162e1e6649618f854fd84aeab03970d16bb814e999852c06de38d82b95c0f32e2a7b5714021fe303389be9c0eac24c90a6b7210f929d390fabf903d44e04110bb7a7fd6c383c275804721efa6d7c93aa64c0bb2b18d97c5220a846c66a4895ae52adddbe2a9996825e013585adcec4b32ba61d782737bd343e5fabd68e8a95b8b1340318559860792dd70dffbe05a1052b54cbfb48cfa7bb3c19cea52076bddac5c25ee276f153a610f6d06ed696d192d8ae4507ffae4e5bdda10a625d6b67f32f7cffcd48dee2431fe66f6105f9d17e611cdcc674868e81692a360f4052
|
||||
+Output = "lorem ipsum"
|
||||
+
|
||||
+# a random negative test case that generates an 11 byte long message
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 00f910200830fc8fff478e99e145f1474b312e2512d0f90b8cef77f8001d09861688c156d1cbaf8a8957f7ebf35f724466952d0524cad48aad4fba1e45ce8ea27e8f3ba44131b7831b62d60c0762661f4c1d1a88cd06263a259abf1ba9e6b0b172069afb86a7e88387726f8ab3adb30bfd6b3f6be6d85d5dfd044e7ef052395474a9cbb1c3667a92780b43a22693015af6c513041bdaf87d43b24ddd244e791eeaea1066e1f4917117b3a468e22e0f7358852bb981248de4d720add2d15dccba6280355935b67c96f9dcb6c419cc38ab9f6fba2d649ef2066e0c34c9f788ae49babd9025fa85b21113e56ce4f43aa134c512b030dd7ac7ce82e76f0be9ce09ebca
|
||||
+Output = 1189b6f5498fd6df532b00
|
||||
+
|
||||
+# otherwise correct plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 002c9ddc36ba4cf0038692b2d3a1c61a4bb3786a97ce2e46a3ba74d03158aeef456ce0f4db04dda3fe062268a1711250a18c69778a6280d88e133a16254e1f0e30ce8dac9b57d2e39a2f7d7be3ee4e08aec2fdbe8dadad7fdbf442a29a8fb40857407bf6be35596b8eefb5c2b3f58b894452c2dc54a6123a1a38d642e23751746597e08d71ac92704adc17803b19e131b4d1927881f43b0200e6f95658f559f912c889b4cd51862784364896cd6e8618f485a992f82997ad6a0917e32ae5872eaf850092b2d6c782ad35f487b79682333c1750c685d7d32ab3e1538f31dcaa5e7d5d2825875242c83947308dcf63ba4bfff20334c9c140c837dbdbae7a8dee72ff
|
||||
+Output = f6d0f5b78082fe61c04674
|
||||
+
|
||||
+# otherwise correct plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
+Decrypt = RSA-2049
|
||||
+Input = 00c5d77826c1ab7a34d6390f9d342d5dbe848942e2618287952ba0350d7de6726112e9cebc391a0fae1839e2bf168229e3e0d71d4161801509f1f28f6e1487ca52df05c466b6b0a6fbbe57a3268a970610ec0beac39ec0fa67babce1ef2a86bf77466dc127d7d0d2962c20e66593126f276863cd38dc6351428f884c1384f67cad0a0ffdbc2af16711fb68dc559b96b37b4f04cd133ffc7d79c43c42ca4948fa895b9daeb853150c8a5169849b730cc77d68b0217d6c0e3dbf38d751a1998186633418367e7576530566c23d6d4e0da9b038d0bb5169ce40133ea076472d055001f0135645940fd08ea44269af2604c8b1ba225053d6db9ab43577689401bdc0f3
|
||||
+Output = 1ab287fcef3ff17067914d
|
||||
+
|
||||
+# RSA decrypt with 3072 bit keys
|
||||
+PrivateKey = RSA-3072
|
||||
+-----BEGIN RSA PRIVATE KEY-----
|
||||
+MIIG5AIBAAKCAYEAr9ccqtXp9bjGw2cHCkfxnX5mrt4YpbJ0H7PE0zQ0VgaSotkJ
|
||||
+72iI7GAv9rk68ljudDA8MBr81O2+xDMR3cjdvwDdu+OG0zuNDiKxtEk23EiYcbhS
|
||||
+N7NM50etj9sMTk0dqnqt8HOFxchzLMt9Wkni5QyIPH16wQ7Wp02ayQ35EpkFoX1K
|
||||
+CHIQ/Hi20EseuWlILBGm7recUOWxbz8lT3VxUosvFxargW1uygcnveqYBZMpcw64
|
||||
+wzznHWHdSsOTtiVuB6wdEk8CANHD4FpMG8fx7S/IPlcZnP5ZCLEAh+J/vZfSwkIU
|
||||
+YZxxR8j778o5vCVnYqaCNTH34jTWjq56DZ+vEN0V6VI3gMfVrlgJStUlqQY7TDP5
|
||||
+XhAG2i6xLTdDaJSVwfICPkBzU8XrPkyhxIz/gaEJANFIIOuAGvTxpZbEuc6aUx/P
|
||||
+ilTZ/9ckJYtu7CAQjfb9/XbUrgO6fqWY3LDkooCElYcob01/JWzoXl61Z5sdrMH5
|
||||
+CVZJty5foHKusAN5AgMBAAECggGAJRfqyzr+9L/65gOY35lXpdKhVKgzaNjhWEKy
|
||||
+9Z7gn3kZe9LvHprdr4eG9rQSdEdAXjBCsh8vULeqc3cWgMO7y2wiWl1f9rVsRxwY
|
||||
+gqCjOwrxZaPtbCSdx3g+a8dYrDfmVy0z/jJQeO2VJlDy65YEkC75mlEaERnRPE/J
|
||||
+pDoXXc37+xoUAP4XCTtpzTzbiV9lQy6iGV+QURxzNrWKaF2s/y2vTF6S5WWxZlrm
|
||||
+DlErqplluAjV/xGc63zWksv5IAZ6+s2An2a+cG2iaBCseQ2xVslI5v5YG8mEkVf0
|
||||
+2kk/OmSwxuEZ4DGxB/hDbOKRYLRYuPnxCV/esZJjOE/1OHVXvE8QtANN6EFwO60s
|
||||
+HnacI4U+tjCjbRBh3UbipruvdDqX8LMsNvUMGjci3vOjlNkcLgeL8J15Xs3l5WuC
|
||||
+Avl0Am91/FbpoN1qiPLny3jvEpjMbGUgfKRb03GIgHtPzbHmDdjluFZI+376i2/d
|
||||
+RI85dBqNmAn+Fjrz3kW6wkpahByBAoHBAOSj2DDXPosxxoLidP/J/RKsMT0t0FE9
|
||||
+UFcNt+tHYv6hk+e7VAuUqUpd3XQqz3P13rnK4xvSOsVguyeU/WgmH4ID9XGSgpBP
|
||||
+Rh6s7izn4KAJeqfI26vTPxvyaZEqB4JxT6k7SerENus95zSn1v/f2MLBQ16EP8cJ
|
||||
++QSOVCoZfEhUK+srherQ9eZKpj0OwBUrP4VhLdymv96r8xddWX1AVj4OBi2RywKI
|
||||
+gAgv6fjwkb292jFu6x6FjKRNKwKK6c3jqQKBwQDE4c0Oz0KYYV4feJun3iL9UJSv
|
||||
+StGsKVDuljA4WiBAmigMZTii/u0DFEjibiLWcJOnH53HTr0avA6c6D1nCwJ2qxyF
|
||||
+rHNN2L+cdMx/7L1zLR11+InvRgpIGbpeGwHeIzJVUYG3b6llRJMZimBvAMr9ipM1
|
||||
+bkVvIjt1G9W1ypeuKzm6d/t8F0yC7AIYZWDV4nvxiiY8whLZzGawHR2iZz8pfUwb
|
||||
+7URbTvxdsGE27Kq9gstU0PzEJpnU1goCJ7/gA1ECgcBA8w5B6ZM5xV0H5z6nPwDm
|
||||
+IgYmw/HucgV1hU8exfuoK8wxQvTACW4B0yJKkrK11T1899aGG7VYRn9D4j4OLO48
|
||||
+Z9V8esseJXbc1fEezovvymGOci984xiFXtqAQzk44+lmQJJh33VeZApe2eLocvVH
|
||||
+ddEmc1kOuJWFpszf3LeCcG69cnKrXsrLrZ8Frz//g3aa9B0sFi5hGeWHWJxISVN2
|
||||
+c1Nr9IN/57i/GqVTcztjdCAcdM7Tr8phDg7OvRlnxGkCgcEAuYhMFBuulyiSaTff
|
||||
+/3ZvJKYOJ45rPkEFGoD/2ercn+RlvyCYGcoAEjnIYVEGlWwrSH+b0NlbjVkQsD6O
|
||||
+to8CeE/RpgqX8hFCqC7NE/RFp8cpDyXy3j/zqnRMUyhCP1KNuScBBZs9V8gikxv6
|
||||
+ukBWCk3PYbeTySHKRBbB8vmCrMfhM96jaBIQsQO1CcZnVceDo1/bnsAIwaREVMxr
|
||||
+Q8LmG7QOx/Z0x1MMsUFoqzilwccC09/JgxMZPh+h+Nv6jiCxAoHBAOEqQgFAfSdR
|
||||
+ya60LLH55q803NRFMamuKiPbVJLzwiKfbjOiiopmQOS/LxxqIzeMXlYV4OsSvxTo
|
||||
+G7mcTOFRtU5hKCK+t8qeQQpa/dsMpiHllwArnRyBjIVgL5lFKRpHUGLsavU/T1IH
|
||||
+mtgaxZo32dXvcAh1+ndCHVBwbHTOF4conA+g+Usp4bZSSWn5nU4oIizvSVpG7SGe
|
||||
+0GngdxH9Usdqbvzcip1EKeHRTZrHIEYmB+x0LaRIB3dwZNidK3TkKw==
|
||||
+-----END RSA PRIVATE KEY-----
|
||||
+
|
||||
+PublicKey = RSA-3072-PUBLIC
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAr9ccqtXp9bjGw2cHCkfx
|
||||
+nX5mrt4YpbJ0H7PE0zQ0VgaSotkJ72iI7GAv9rk68ljudDA8MBr81O2+xDMR3cjd
|
||||
+vwDdu+OG0zuNDiKxtEk23EiYcbhSN7NM50etj9sMTk0dqnqt8HOFxchzLMt9Wkni
|
||||
+5QyIPH16wQ7Wp02ayQ35EpkFoX1KCHIQ/Hi20EseuWlILBGm7recUOWxbz8lT3Vx
|
||||
+UosvFxargW1uygcnveqYBZMpcw64wzznHWHdSsOTtiVuB6wdEk8CANHD4FpMG8fx
|
||||
+7S/IPlcZnP5ZCLEAh+J/vZfSwkIUYZxxR8j778o5vCVnYqaCNTH34jTWjq56DZ+v
|
||||
+EN0V6VI3gMfVrlgJStUlqQY7TDP5XhAG2i6xLTdDaJSVwfICPkBzU8XrPkyhxIz/
|
||||
+gaEJANFIIOuAGvTxpZbEuc6aUx/PilTZ/9ckJYtu7CAQjfb9/XbUrgO6fqWY3LDk
|
||||
+ooCElYcob01/JWzoXl61Z5sdrMH5CVZJty5foHKusAN5AgMBAAE=
|
||||
+-----END PUBLIC KEY-----
|
||||
+
|
||||
+PrivPubKeyPair = RSA-3072:RSA-3072-PUBLIC
|
||||
+
|
||||
+# a random invalid ciphertext that generates an empty synthethic one
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 5e956cd9652f4a2ece902931013e09662b6a9257ad1e987fb75f73a0606df2a4b04789770820c2e02322c4e826f767bd895734a01e20609c3be4517a7a2a589ea1cdc137beb73eb38dac781b52e863de9620f79f9b90fd5b953651fcbfef4a9f1cc07421d511a87dd6942caab6a5a0f4df473e62defb529a7de1509ab99c596e1dff1320402298d8be73a896cc86c38ae3f2f576e9ea70cc28ad575cb0f854f0be43186baa9c18e29c47c6ca77135db79c811231b7c1730955887d321fdc06568382b86643cf089b10e35ab23e827d2e5aa7b4e99ff2e914f302351819eb4d1693243b35f8bf1d42d08f8ec4acafa35f747a4a975a28643ec630d8e4fa5be59d81995660a14bb64c1fea5146d6b11f92da6a3956dd5cb5e0d747cf2ea23f81617769185336263d46ef4c144b754de62a6337342d6c85a95f19f015724546ee3fc4823eca603dbc1dc01c2d5ed50bd72d8e96df2dc048edde0081284068283fc5e73a6139851abf2f29977d0b3d160c883a42a37efba1be05c1a0b1741d7ddf59
|
||||
+Output =
|
||||
+
|
||||
+# a random invalid that has PRF output with a length one byte too long
|
||||
+# in the last value
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 7db0390d75fcf9d4c59cf27b264190d856da9abd11e92334d0e5f71005cfed865a711dfa28b791188374b61916dbc11339bf14b06f5f3f68c206c5607380e13da3129bfb744157e1527dd6fdf6651248b028a496ae1b97702d44706043cdaa7a59c0f41367303f21f268968bf3bd2904db3ae5239b55f8b438d93d7db9d1666c071c0857e2ec37757463769c54e51f052b2a71b04c2869e9e7049a1037b8429206c99726f07289bac18363e7eb2a5b417f47c37a55090cda676517b3549c873f2fe95da9681752ec9864b069089a2ed2f340c8b04ee00079055a817a3355b46ac7dc00d17f4504ccfbcfcadb0c04cb6b22069e179385ae1eafabad5521bac2b8a8ee1dfff59a22eb3fdacfc87175d10d7894cfd869d056057dd9944b869c1784fcc27f731bc46171d39570fbffbadf082d33f6352ecf44aca8d9478e53f5a5b7c852b401e8f5f74da49da91e65bdc97765a9523b7a0885a6f8afe5759d58009fbfa837472a968e6ae92026a5e0202a395483095302d6c3985b5f5831c521a271
|
||||
+Output = 56a3bea054e01338be9b7d7957539c
|
||||
+
|
||||
+# a random invalid that generates a synthethic of maximum size
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 1715065322522dff85049800f6a29ab5f98c465020467414b2a44127fe9446da47fa18047900f99afe67c2df6f50160bb8e90bff296610fde632b3859d4d0d2e644f23835028c46cca01b84b88231d7e03154edec6627bcba23de76740d839851fa12d74c8f92e540c73fe837b91b7d699b311997d5f0f7864c486d499c3a79c111faaacbe4799597a25066c6200215c3d158f3817c1aa57f18bdaad0be1658da9da93f5cc6c3c4dd72788af57adbb6a0c26f42d32d95b8a4f95e8c6feb2f8a5d53b19a50a0b7cbc25e055ad03e5ace8f3f7db13e57759f67b65d143f08cca15992c6b2aae643390483de111c2988d4e76b42596266005103c8de6044fb7398eb3c28a864fa672de5fd8774510ff45e05969a11a4c7d3f343e331190d2dcf24fb9154ba904dc94af98afc5774a9617d0418fe6d13f8245c7d7626c176138dd698a23547c25f27c2b98ea4d8a45c7842b81888e4cc14e5b72e9cf91f56956c93dbf2e5f44a8282a7813157fc481ff1371a0f66b31797e81ebdb09a673d4db96d6
|
||||
+Output = 7b036fcd6243900e4236c894e2462c17738acc87e01a76f4d95cb9a328d9acde81650283b8e8f60a217e3bdee835c7b222ad4c85d0acdb9a309bd2a754609a65dec50f3aa04c6d5891034566b9563d42668ede1f8992b17753a2132e28970584e255efc8b45a41c5dbd7567f014acec5fe6fdb6d484790360a913ebb9defcd74ff377f2a8ba46d2ed85f733c9a3da08eb57ecedfafda806778f03c66b2c5d2874cec1c291b2d49eb194c7b5d0dd2908ae90f4843268a2c45563092ade08acb6ab481a08176102fc803fbb2f8ad11b0e1531bd37df543498daf180b12017f4d4d426ca29b4161075534bfb914968088a9d13785d0adc0e2580d3548494b2a9e91605f2b27e6cc701c796f0de7c6f471f6ab6cb9272a1ed637ca32a60d117505d82af3c1336104afb537d01a8f70b510e1eebf4869cb976c419473795a66c7f5e6e20a8094b1bb603a74330c537c5c0698c31538bd2e138c1275a1bdf24c5fa8ab3b7b526324e7918a382d1363b3d463764222150e04
|
||||
+
|
||||
+# a positive test case that decrypts to 9 byte long value
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 6c60845a854b4571f678941ae35a2ac03f67c21e21146f9db1f2306be9f136453b86ad55647d4f7b5c9e62197aaff0c0e40a3b54c4cde14e774b1c5959b6c2a2302896ffae1f73b00b862a20ff4304fe06cea7ff30ecb3773ca9af27a0b54547350d7c07dfb0a39629c7e71e83fc5af9b2adbaf898e037f1de696a3f328cf45af7ec9aff7173854087fb8fbf34be981efbd8493f9438d1b2ba2a86af082662aa46ae9adfbec51e5f3d9550a4dd1dcb7c8969c9587a6edc82a8cabbc785c40d9fbd12064559fb769450ac3e47e87bc046148130d7eaa843e4b3ccef3675d0630500803cb7ffee3882378c1a404e850c3e20707bb745e42b13c18786c4976076ed9fa8fd0ff15e571bef02cbbe2f90c908ac3734a433b73e778d4d17fcc28f49185ebc6e8536a06d293202d94496453bfdf1c2c7833a3f99fa38ca8a81f42eaa529d603b890308a319c0ab63a35ff8ebac965f6278f5a7e5d622be5d5fe55f0ca3ec993d55430d2bf59c5d3e860e90c16d91a04596f6fdf60d89ed95d88c036dde
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with null padded ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 00f4d565a3286784dbb85327db8807ae557ead229f92aba945cecda5225f606a7d6130edeeb6f26724d1eff1110f9eb18dc3248140ee3837e6688391e78796c526791384f045e21b6b853fb6342a11f309eb77962f37ce23925af600847fbd30e6e07e57de50b606e6b7f288cc777c1a6834f27e6edace508452128916eef7788c8bb227e3548c6a761cc4e9dd1a3584176dc053ba3500adb1d5e1611291654f12dfc5722832f635db3002d73f9defc310ace62c63868d341619c7ee15b20243b3371e05078e11219770c701d9f341af35df1bc729de294825ff2e416aa11526612852777eb131f9c45151eb144980d70608d2fc4043477368369aa0fe487a48bd57e66b00c3c58f941549f5ec050fca64449debe7a0c4ac51e55cb71620a70312aa4bd85fac1410c9c7f9d6ec610b7d11bf8faeffa20255d1a1bead9297d0aa8765cd2805847d639bc439f4a6c896e2008f746f9590ff4596de5ddde000ed666c452c978043ff4298461eb5a26d5e63d821438627f91201924bf7f2aeee1727
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with null truncated ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = f4d565a3286784dbb85327db8807ae557ead229f92aba945cecda5225f606a7d6130edeeb6f26724d1eff1110f9eb18dc3248140ee3837e6688391e78796c526791384f045e21b6b853fb6342a11f309eb77962f37ce23925af600847fbd30e6e07e57de50b606e6b7f288cc777c1a6834f27e6edace508452128916eef7788c8bb227e3548c6a761cc4e9dd1a3584176dc053ba3500adb1d5e1611291654f12dfc5722832f635db3002d73f9defc310ace62c63868d341619c7ee15b20243b3371e05078e11219770c701d9f341af35df1bc729de294825ff2e416aa11526612852777eb131f9c45151eb144980d70608d2fc4043477368369aa0fe487a48bd57e66b00c3c58f941549f5ec050fca64449debe7a0c4ac51e55cb71620a70312aa4bd85fac1410c9c7f9d6ec610b7d11bf8faeffa20255d1a1bead9297d0aa8765cd2805847d639bc439f4a6c896e2008f746f9590ff4596de5ddde000ed666c452c978043ff4298461eb5a26d5e63d821438627f91201924bf7f2aeee1727
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with double null padded ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 00001ec97ac981dfd9dcc7a7389fdfa9d361141dac80c23a060410d472c16094e6cdffc0c3684d84aa402d7051dfccb2f6da33f66985d2a259f5b7fbf39ac537e95c5b7050eb18844a0513abef812cc8e74a3c5240009e6e805dcadf532bc1a2702d5acc9e585fad5b89d461fcc1397351cdce35171523758b171dc041f412e42966de7f94856477356d06f2a6b40e3ff0547562a4d91bbf1338e9e049facbee8b20171164505468cd308997447d3dc4b0acb49e7d368fedd8c734251f30a83491d2506f3f87318cc118823244a393dc7c5c739a2733d93e1b13db6840a9429947357f47b23fbe39b7d2d61e5ee26f9946c4632f6c4699e452f412a26641d4751135400713cd56ec66f0370423d55d2af70f5e7ad0adea8e4a0d904a01e4ac272eba4af1a029dd53eb71f115bf31f7a6c8b19a6523adeecc0d4c3c107575e38572a8f8474ccad163e46e2e8b08111132aa97a16fb588c9b7e37b3b3d7490381f3c55d1a9869a0fd42cd86fed59ecec78cb6b2dfd06a497f5afe3419691314ba0
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a positive test case with double null truncated ciphertext
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 1ec97ac981dfd9dcc7a7389fdfa9d361141dac80c23a060410d472c16094e6cdffc0c3684d84aa402d7051dfccb2f6da33f66985d2a259f5b7fbf39ac537e95c5b7050eb18844a0513abef812cc8e74a3c5240009e6e805dcadf532bc1a2702d5acc9e585fad5b89d461fcc1397351cdce35171523758b171dc041f412e42966de7f94856477356d06f2a6b40e3ff0547562a4d91bbf1338e9e049facbee8b20171164505468cd308997447d3dc4b0acb49e7d368fedd8c734251f30a83491d2506f3f87318cc118823244a393dc7c5c739a2733d93e1b13db6840a9429947357f47b23fbe39b7d2d61e5ee26f9946c4632f6c4699e452f412a26641d4751135400713cd56ec66f0370423d55d2af70f5e7ad0adea8e4a0d904a01e4ac272eba4af1a029dd53eb71f115bf31f7a6c8b19a6523adeecc0d4c3c107575e38572a8f8474ccad163e46e2e8b08111132aa97a16fb588c9b7e37b3b3d7490381f3c55d1a9869a0fd42cd86fed59ecec78cb6b2dfd06a497f5afe3419691314ba0
|
||||
+Output = "forty two"
|
||||
+
|
||||
+# a random negative test case that generates a 9 byte long message
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 5c8555f5cef627c15d37f85c7f5fd6e499264ea4b8e3f9112023aeb722eb38d8eac2be3751fd5a3785ab7f2d59fa3728e5be8c3de78a67464e30b21ee23b5484bb3cd06d0e1c6ad25649c8518165653eb80488bfb491b20c04897a6772f69292222fc5ef50b5cf9efc6d60426a449b6c489569d48c83488df629d695653d409ce49a795447fcec2c58a1a672e4a391401d428baaf781516e11e323d302fcf20f6eab2b2dbe53a48c987e407c4d7e1cb41131329138313d330204173a4f3ff06c6fadf970f0ed1005d0b27e35c3d11693e0429e272d583e57b2c58d24315c397856b34485dcb077665592b747f889d34febf2be8fce66c265fd9fc3575a6286a5ce88b4b413a08efc57a07a8f57a999605a837b0542695c0d189e678b53662ecf7c3d37d9dbeea585eebfaf79141118e06762c2381fe27ca6288edddc19fd67cd64f16b46e06d8a59ac530f22cd83cc0bc4e37feb52015cbb2283043ccf5e78a4eb7146827d7a466b66c8a4a4826c1bad68123a7f2d00fc1736525ff90c058f56
|
||||
+Output = 257906ca6de8307728
|
||||
+
|
||||
+# a random negative test case that generates a 9 byte long message based on
|
||||
+# second to last value from PRF
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 758c215aa6acd61248062b88284bf43c13cb3b3d02410be4238607442f1c0216706e21a03a2c10eb624a63322d854da195c017b76fea83e274fa371834dcd2f3b7accf433fc212ad76c0bac366e1ed32e25b279f94129be7c64d6e162adc08ccebc0cfe8e926f01c33ab9c065f0e0ac83ae5137a4cb66702615ad68a35707d8676d2740d7c1a954680c83980e19778ed11eed3a7c2dbdfc461a9bbef671c1bc00c882d361d29d5f80c42bdf5efec886c34138f83369c6933b2ac4e93e764265351b4a0083f040e14f511f09b22f96566138864e4e6ff24da4810095da98e0585410951538ced2f757a277ff8e17172f06572c9024eeae503f176fd46eb6c5cd9ba07af11cde31dccac12eb3a4249a7bfd3b19797ad1656984bfcbf6f74e8f99d8f1ac420811f3d166d87f935ef15ae858cf9e72c8e2b547bf16c3fb09a8c9bf88fd2e5d38bf24ed610896131a84df76b9f920fe76d71fff938e9199f3b8cd0c11fd0201f9139d7673a871a9e7d4adc3bbe360c8813617cd60a90128fbe34c9d5
|
||||
+Output = 043383c929060374ed
|
||||
+
|
||||
+# a random negative test that generates message based on 3rd last value from
|
||||
+# PRF
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 7b22d5e62d287968c6622171a1f75db4b0fd15cdf3134a1895d235d56f8d8fe619f2bf4868174a91d7601a82975d2255190d28b869141d7c395f0b8c4e2be2b2c1b4ffc12ce749a6f6803d4cfe7fba0a8d6949c04151f981c0d84592aa2ff25d1bd3ce5d10cb03daca6b496c6ad40d30bfa8acdfd02cdb9326c4bdd93b949c9dc46caa8f0e5f429785bce64136a429a3695ee674b647452bea1b0c6de9c5f1e8760d5ef6d5a9cfff40457b023d3c233c1dcb323e7808103e73963b2eafc928c9eeb0ee3294955415c1ddd9a1bb7e138fecd79a3cb89c57bd2305524624814aaf0fd1acbf379f7f5b39421f12f115ba488d380586095bb53f174fae424fa4c8e3b299709cd344b9f949b1ab57f1c645d7ed3c8f81d5594197355029fee8960970ff59710dc0e5eb50ea6f4c3938e3f89ed7933023a2c2ddffaba07be147f686828bd7d520f300507ed6e71bdaee05570b27bc92741108ac2eb433f028e138dd6d63067bc206ea2d826a7f41c0d613daed020f0f30f4e272e9618e0a8c39018a83
|
||||
+Output = 70263fa6050534b9e0
|
||||
+
|
||||
+# an otherwise valid plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 6db80adb5ff0a768caf1378ecc382a694e7d1bde2eff4ba12c48aaf794ded7a994a5b2b57acec20dbec4ae385c9dd531945c0f197a5496908725fc99d88601a17d3bb0b2d38d2c1c3100f39955a4cb3dbed5a38bf900f23d91e173640e4ec655c84fdfe71fcdb12a386108fcf718c9b7af37d39703e882436224c877a2235e8344fba6c951eb7e2a4d1d1de81fb463ac1b880f6cc0e59ade05c8ce35179ecd09546731fc07b141d3d6b342a97ae747e61a9130f72d37ac5a2c30215b6cbd66c7db893810df58b4c457b4b54f34428247d584e0fa71062446210db08254fb9ead1ba1a393c724bd291f0cf1a7143f32df849051dc896d7d176fef3b57ab6dffd626d0c3044e9edb2e3d012ace202d2581df01bec7e9aa0727a6650dd373d374f0bc0f4a611f8139dfe97d63e70c6188f4df5b672e47c51d8aa567097293fbff127c75ec690b43407578b73c85451710a0cece58fd497d7f7bd36a8a92783ef7dc6265dff52aac8b70340b996508d39217f2783ce6fc91a1cc94bb2ac487b84f62
|
||||
+Output = 6d8d3a094ff3afff4c
|
||||
+
|
||||
+# an otherwise valid plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 417328c034458563079a4024817d0150340c34e25ae16dcad690623f702e5c748a6ebb3419ff48f486f83ba9df35c05efbd7f40613f0fc996c53706c30df6bba6dcd4a40825f96133f3c21638a342bd4663dffbd0073980dac47f8c1dd8e97ce1412e4f91f2a8adb1ac2b1071066efe8d718bbb88ca4a59bd61500e826f2365255a409bece0f972df97c3a55e09289ef5fa815a2353ef393fd1aecfc888d611c16aec532e5148be15ef1bf2834b8f75bb26db08b66d2baad6464f8439d1986b533813321dbb180080910f233bcc4dd784fb21871aef41be08b7bfad4ecc3b68f228cb5317ac6ec1227bc7d0e452037ba918ee1da9fdb8393ae93b1e937a8d4691a17871d5092d2384b6190a53df888f65b951b05ed4ad57fe4b0c6a47b5b22f32a7f23c1a234c9feb5d8713d949686760680da4db454f4acad972470033472b9864d63e8d23eefc87ebcf464ecf33f67fbcdd48eab38c5292586b36aef5981ed2fa07b2f9e23fc57d9eb71bfff4111c857e9fff23ceb31e72592e70c874b4936
|
||||
+Output = c6ae80ffa80bc184b0
|
||||
+
|
||||
+# an otherwise valid plaintext, but with zero byte in first byte of padding
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 8542c626fe533467acffcd4e617692244c9b5a3bf0a215c5d64891ced4bf4f9591b4b2aedff9843057986d81631b0acb3704ec2180e5696e8bd15b217a0ec36d2061b0e2182faa3d1c59bd3f9086a10077a3337a3f5da503ec3753535ffd25b837a12f2541afefd0cffb0224b8f874e4bed13949e105c075ed44e287c5ae03b155e06b90ed247d2c07f1ef3323e3508cce4e4074606c54172ad74d12f8c3a47f654ad671104bf7681e5b061862747d9afd37e07d8e0e2291e01f14a95a1bb4cbb47c304ef067595a3947ee2d722067e38a0f046f43ec29cac6a8801c6e3e9a2331b1d45a7aa2c6af3205be382dd026e389614ee095665a611ab2e8dced2ee1c9d08ac9de11aef5b3803fc9a9ce8231ec87b5fed386fb92ee3db995a89307bcba844bd0a691c29ae51216e949dfc813133cb06a07265fd807bcb3377f6adb0a481d9b7f442003115895939773e6b95371c4febef29edae946fa245e7c50729e2e558cfaad773d1fd5f67b457a6d9d17a847c6fcbdb103a86f35f228cefc06cea0
|
||||
+Output = a8a9301daa01bb25c7
|
||||
+
|
||||
+# an otherwise valid plaintext, but with zero byte in eight byte of padding
|
||||
+Decrypt = RSA-3072
|
||||
+Input = 449dfa237a70a99cb0351793ec8677882021c2aa743580bf6a0ea672055cffe8303ac42855b1d1f3373aae6af09cb9074180fc963e9d1478a4f98b3b4861d3e7f0aa8560cf603711f139db77667ca14ba3a1acdedfca9ef4603d6d7eb0645bfc805304f9ad9d77d34762ce5cd84bd3ec9d35c30e3be72a1e8d355d5674a141b5530659ad64ebb6082e6f73a80832ab6388912538914654d34602f4b3b1c78589b4a5d964b2efcca1dc7004c41f6cafcb5a7159a7fc7c0398604d0edbd4c8f4f04067da6a153a05e7cbeea13b5ee412400ef7d4f3106f4798da707ec37a11286df2b7a204856d5ff773613fd1e453a7114b78e347d3e8078e1cb3276b3562486ba630bf719697e0073a123c3e60ebb5c7a1ccff4279faffa2402bc1109f8d559d6766e73591943dfcf25ba10c3762f02af85187799b8b4b135c3990793a6fd32642f1557405ba55cc7cf7336a0e967073c5fa50743f9cc5e3017c172d9898d2af83345e71b3e0c22ab791eacb6484a32ec60ebc226ec9deaee91b1a0560c2b571
|
||||
+Output = 6c716fe01d44398018
|
||||
+
|
||||
+# an otherwise valid plaintext, but with null separator missing
|
||||
+Decrypt = RSA-3072
|
||||
+Input = a7a5c99e50da48769ecb779d9abe86ef9ec8c38c6f43f17c7f2d7af608a4a1bd6cf695b47e97c191c61fb5a27318d02f495a176b9fae5a55b5d3fabd1d8aae4957e3879cb0c60f037724e11be5f30f08fc51c033731f14b44b414d11278cd3dba7e1c8bfe208d2b2bb7ec36366dacb6c88b24cd79ab394adf19dbbc21dfa5788bacbadc6a62f79cf54fd8cf585c615b5c0eb94c35aa9de25321c8ffefb8916bbaa2697cb2dd82ee98939df9b6704cee77793edd2b4947d82e00e5749664970736c59a84197bd72b5c71e36aae29cd39af6ac73a368edbc1ca792e1309f442aafcd77c992c88f8e4863149f221695cb7b0236e75b2339a02c4ea114854372c306b9412d8eedb600a31532002f2cea07b4df963a093185e4607732e46d753b540974fb5a5c3f9432df22e85bb17611370966c5522fd23f2ad3484341ba7fd8885fc8e6d379a611d13a2aca784fba2073208faad2137bf1979a0fa146c1880d4337db3274269493bab44a1bcd0681f7227ffdf589c2e925ed9d36302509d1109ba4
|
||||
+Output = aa2de6cde4e2442884
|
||||
+
|
||||
# RSA PSS key tests
|
||||
|
||||
# PSS only key, no parameter restrictions
|
||||
--
|
||||
2.34.1
|
||||
|
||||
284
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-5.patch
Normal file
284
meta/recipes-connectivity/openssl/openssl/CVE-2023-50781-5.patch
Normal file
@@ -0,0 +1,284 @@
|
||||
From c693522a96b6fb2bb4b55a53d86550811bc0d7df Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Thu, 3 Nov 2022 17:45:58 +0100
|
||||
Subject: [PATCH] rsa: Skip the synthethic plaintext test with old FIPS
|
||||
provider
|
||||
|
||||
since the 3.0.0 FIPS provider doesn't implement the Bleichenbacher
|
||||
workaround, the decryption fails instead of providing a synthetic
|
||||
plaintext, so skip them then
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/ddecbef6e389d263b728b7fa30fd3d9ce13feddb]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
.../30-test_evp_data/evppkey_rsa_common.txt | 66 ++++++++++++++++++-
|
||||
1 file changed, 63 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
index d569e78..4bd7c72 100644
|
||||
--- a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
+++ b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
@@ -253,12 +253,12 @@ Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A78
|
||||
Output = "Hello World"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# Corrupted ciphertext
|
||||
-FIPSversion = <3.2.0
|
||||
Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A79
|
||||
-Output = "Hello World"
|
||||
-Result = KEYOP_ERROR
|
||||
+Output = 4cbb988d6a46228379132b0b5f8c249b3860043848c93632fb982c807c7c82fffc7a9ef83f4908f890373ac181ffea6381e103bcaa27e65638b6ecebef38b59ed4226a9d12af675cfcb634d8c40e7a7aff
|
||||
|
||||
# OAEP padding
|
||||
Decrypt = RSA-2048
|
||||
@@ -330,21 +330,29 @@ Decrypt = RSA-2048-2
|
||||
Input = 8bfe264e85d3bdeaa6b8851b8e3b956ee3d226fd3f69063a86880173a273d9f283b2eebdd1ed35f7e02d91c571981b6737d5320bd8396b0f3ad5b019daec1b0aab3cbbc026395f4fd14f13673f2dfc81f9b660ec26ac381e6db3299b4e460b43fab9955df2b3cfaa20e900e19c856238fd371899c2bf2ce8c868b76754e5db3b036533fd603746be13c10d4e3e6022ebc905d20c2a7f32b215a4cd53b3f44ca1c327d2c2b651145821c08396c89071f665349c25e44d2733cd9305985ceef6430c3cf57af5fa224089221218fa34737c79c446d28a94c41c96e4e92ac53fbcf384dea8419ea089f8784445a492c812eb0d409467f75afd7d4d1078886205a066
|
||||
Output = "lorem ipsum dolor sit amet"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case decrypting to empty
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 20aaa8adbbc593a924ba1c5c7990b5c2242ae4b99d0fe636a19a4cf754edbcee774e472fe028160ed42634f8864900cb514006da642cae6ae8c7d087caebcfa6dad1551301e130344989a1d462d4164505f6393933450c67bc6d39d8f5160907cabc251b737925a1cf21e5c6aa5781b7769f6a2a583d97cce008c0f8b6add5f0b2bd80bee60237aa39bb20719fe75749f4bc4e42466ef5a861ae3a92395c7d858d430bfe38040f445ea93fa2958b503539800ffa5ce5f8cf51fa8171a91f36cb4f4575e8de6b4d3f096ee140b938fd2f50ee13f0d050222e2a72b0a3069ff3a6738e82c87090caa5aed4fcbe882c49646aa250b98f12f83c8d528113614a29e7
|
||||
Output =
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# invalid decrypting to max length message
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 48cceab10f39a4db32f60074feea473cbcdb7accf92e150417f76b44756b190e843e79ec12aa85083a21f5437e7bad0a60482e601198f9d86923239c8786ee728285afd0937f7dde12717f28389843d7375912b07b991f4fdb0190fced8ba665314367e8c5f9d2981d0f5128feeb46cb50fc237e64438a86df198dd0209364ae3a842d77532b66b7ef263b83b1541ed671b120dfd660462e2107a4ee7b964e734a7bd68d90dda61770658a3c242948532da32648687e0318286473f675b412d6468f013f14d760a358dfcad3cda2afeec5e268a37d250c37f722f468a70dfd92d7294c3c1ee1e7f8843b7d16f9f37ef35748c3ae93aa155cdcdfeb4e78567303
|
||||
Output = 22d850137b9eebe092b24f602dc5bb7918c16bd89ddbf20467b119d205f9c2e4bd7d2592cf1e532106e0f33557565923c73a02d4f09c0c22bea89148183e60317f7028b3aa1f261f91c979393101d7e15f4067e63979b32751658ef769610fe97cf9cef3278b3117d384051c3b1d82c251c2305418c8f6840530e631aad63e70e20e025bcd8efb54c92ec6d3b106a2f8e64eeff7d38495b0fc50c97138af4b1c0a67a1c4e27b077b8439332edfa8608dfeae653cd6a628ac550395f7e74390e42c11682234870925eeaa1fa71b76cf1f2ee3bda69f6717033ff8b7c95c9799e7a3bea5e7e4a1c359772fb6b1c6e6c516661dfe30c3
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# invalid decrypting to message with length specified by second to last value from PRF
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 1439e08c3f84c1a7fec74ce07614b20e01f6fa4e8c2a6cffdc3520d8889e5d9a950c6425798f85d4be38d300ea5695f13ecd4cb389d1ff5b82484b494d6280ab7fa78e645933981cb934cce8bfcd114cc0e6811eefa47aae20af638a1cd163d2d3366186d0a07df0c81f6c9f3171cf3561472e98a6006bf75ddb457bed036dcce199369de7d94ef2c68e8467ee0604eea2b3009479162a7891ba5c40cab17f49e1c438cb6eaea4f76ce23cce0e483ff0e96fa790ea15be67671814342d0a23f4a20262b6182e72f3a67cd289711503c85516a9ed225422f98b116f1ab080a80abd6f0216df88d8cfd67c139243be8dd78502a7aaf6bc99d7da71bcdf627e7354
|
||||
Output = 0f9b
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# invalid decrypting to message with length specified by third to last value from PRF
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 1690ebcceece2ce024f382e467cf8510e74514120937978576caf684d4a02ad569e8d76cbe365a060e00779de2f0865ccf0d923de3b4783a4e2c74f422e2f326086c390b658ba47f31ab013aa80f468c71256e5fa5679b24e83cd82c3d1e05e398208155de2212993cd2b8bab6987cf4cc1293f19909219439d74127545e9ed8a706961b8ee2119f6bfacafbef91b75a789ba65b8b833bc6149cf49b5c4d2c6359f62808659ba6541e1cd24bf7f7410486b5103f6c0ea29334ea6f4975b17387474fe920710ea61568d7b7c0a7916acf21665ad5a31c4eabcde44f8fb6120d8457afa1f3c85d517cda364af620113ae5a3c52a048821731922737307f77a1081
|
||||
@@ -385,23 +393,31 @@ Decrypt = RSA-2048-2
|
||||
Input = 1ea0b50ca65203d0a09280d39704b24fe6e47800189db5033f202761a78bafb270c5e25abd1f7ecc6e7abc4f26d1b0cd9b8c648d529416ee64ccbdd7aa72a771d0353262b543f0e436076f40a1095f5c7dfd10dcf0059ccb30e92dfa5e0156618215f1c3ff3aa997a9d999e506924f5289e3ac72e5e2086cc7b499d71583ed561028671155db4005bee01800a7cdbdae781dd32199b8914b5d4011dd6ff11cd26d46aad54934d293b0bc403dd211bf13b5a5c6836a5e769930f437ffd8634fb7371776f4bc88fa6c271d8aa6013df89ae6470154497c4ac861be2a1c65ebffec139bf7aaba3a81c7c5cdd84da9af5d3edfb957848074686b5837ecbcb6a41c50
|
||||
Output = "lorem ipsum"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test that generates an 11 byte long message
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 5f02f4b1f46935c742ebe62b6f05aa0a3286aab91a49b34780adde6410ab46f7386e05748331864ac98e1da63686e4babe3a19ed40a7f5ceefb89179596aab07ab1015e03b8f825084dab028b6731288f2e511a4b314b6ea3997d2e8fe2825cef8897cbbdfb6c939d441d6e04948414bb69e682927ef8576c9a7090d4aad0e74c520d6d5ce63a154720f00b76de8cc550b1aa14f016d63a7b6d6eaa1f7dbe9e50200d3159b3d099c900116bf4eba3b94204f18b1317b07529751abf64a26b0a0bf1c8ce757333b3d673211b67cc0653f2fe2620d57c8b6ee574a0323a167eab1106d9bc7fd90d415be5f1e9891a0e6c709f4fc0404e8226f8477b4e939b36eb2
|
||||
Output = af9ac70191c92413cb9f2d
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise correct plaintext, but with wrong first byte
|
||||
# (0x01 instead of 0x00), generates a random 11 byte long plaintext
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 9b2ec9c0c917c98f1ad3d0119aec6be51ae3106e9af1914d48600ab6a2c0c0c8ae02a2dc3039906ff3aac904af32ec798fd65f3ad1afa2e69400e7c1de81f5728f3b3291f38263bc7a90a0563e43ce7a0d4ee9c0d8a716621ca5d3d081188769ce1b131af7d35b13dea99153579c86db31fe07d5a2c14d621b77854e48a8df41b5798563af489a291e417b6a334c63222627376118c02c53b6e86310f728734ffc86ef9d7c8bf56c0c841b24b82b59f51aee4526ba1c4268506d301e4ebc498c6aebb6fd5258c876bf900bac8ca4d309dd522f6a6343599a8bc3760f422c10c72d0ad527ce4af1874124ace3d99bb74db8d69d2528db22c3a37644640f95c05f
|
||||
Output = a1f8c9255c35cfba403ccc
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise correct plaintext, but with wrong second byte
|
||||
# (0x01 instead of 0x02), generates a random 11 byte long plaintext
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 782c2b59a21a511243820acedd567c136f6d3090c115232a82a5efb0b178285f55b5ec2d2bac96bf00d6592ea7cdc3341610c8fb07e527e5e2d20cfaf2c7f23e375431f45e998929a02f25fd95354c33838090bca838502259e92d86d568bc2cdb132fab2a399593ca60a015dc2bb1afcd64fef8a3834e17e5358d822980dc446e845b3ab4702b1ee41fe5db716d92348d5091c15d35a110555a35deb4650a5a1d2c98025d42d4544f8b32aa6a5e02dc02deaed9a7313b73b49b0d4772a3768b0ea0db5846ace6569cae677bf67fb0acf3c255dc01ec8400c963b6e49b1067728b4e563d7e1e1515664347b92ee64db7efb5452357a02fff7fcb7437abc2e579
|
||||
Output = e6d700309ca0ed62452254
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with a zero byte in first byte of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -409,6 +425,8 @@ Decrypt = RSA-2048-2
|
||||
Input = 0096136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
Output = ba27b1842e7c21c0e7ef6a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with a zero byte removed from first byte of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -416,6 +434,8 @@ Decrypt = RSA-2048-2
|
||||
Input = 96136621faf36d5290b16bd26295de27f895d1faa51c800dafce73d001d60796cd4e2ac3fa2162131d859cd9da5a0c8a42281d9a63e5f353971b72e36b5722e4ac444d77f892a5443deb3dca49fa732fe855727196e23c26eeac55eeced8267a209ebc0f92f4656d64a6c13f7f7ce544ebeb0f668fe3a6c0f189e4bcd5ea12b73cf63e0c8350ee130dd62f01e5c97a1e13f52fde96a9a1bc9936ce734fdd61f27b18216f1d6de87f49cf4f2ea821fb8efd1f92cdad529baf7e31aff9bff4074f2cad2b4243dd15a711adcf7de900851fbd6bcb53dac399d7c880531d06f25f7002e1aaf1722765865d2c2b902c7736acd27bc6cbd3e38b560e2eecf7d4b576
|
||||
Output = ba27b1842e7c21c0e7ef6a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with two zero bytes in first bytes of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -423,6 +443,8 @@ Decrypt = RSA-2048-2
|
||||
Input = 0000587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
Output = d5cf555b1d6151029a429a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an invalid ciphertext, with two zero bytes removed from first bytes of
|
||||
# ciphertext, decrypts to a random 11 byte long synthethic
|
||||
# plaintext
|
||||
@@ -430,24 +452,32 @@ Decrypt = RSA-2048-2
|
||||
Input = 587cccc6b264bdfe0dc2149a988047fa921801f3502ea64624c510c6033d2f427e3f136c26e88ea9f6519e86a542cec96aad1e5e9013c3cc203b6de15a69183050813af5c9ad79703136d4b92f50ce171eefc6aa7988ecf02f319ffc5eafd6ee7a137f8fce64b255bb1b8dd19cfe767d64fdb468b9b2e9e7a0c24dae03239c8c714d3f40b7ee9c4e59ac15b17e4d328f1100756bce17133e8e7493b54e5006c3cbcdacd134130c5132a1edebdbd01a0c41452d16ed7a0788003c34730d0808e7e14c797a21f2b45a8aa1644357fd5e988f99b017d9df37563a354c788dc0e2f9466045622fa3f3e17db63414d27761f57392623a2bef6467501c63e8d645
|
||||
Output = d5cf555b1d6151029a429a
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# and invalid ciphertext, otherwise valid but starting with 000002, decrypts
|
||||
# to random 11 byte long synthethic plaintext
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 1786550ce8d8433052e01ecba8b76d3019f1355b212ac9d0f5191b023325a7e7714b7802f8e9a17c4cb3cd3a84041891471b10ca1fcfb5d041d34c82e6d0011cf4dc76b90e9c2e0743590579d55bcd7857057152c4a8040361343d1d22ba677d62b011407c652e234b1d663af25e2386251d7409190f19fc8ec3f9374fdf1254633874ce2ec2bff40ad0cb473f9761ec7b68da45a4bd5e33f5d7dac9b9a20821df9406b653f78a95a6c0ea0a4d57f867e4db22c17bf9a12c150f809a7b72b6db86c22a8732241ebf3c6a4f2cf82671d917aba8bc61052b40ccddd743a94ea9b538175106201971cca9d136d25081739aaf6cd18b2aecf9ad320ea3f89502f955
|
||||
Output = 3d4a054d9358209e9cbbb9
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# negative test with otherwise valid padding but a zero byte in first byte
|
||||
# of padding
|
||||
Decrypt = RSA-2048-2
|
||||
Input = 179598823812d2c58a7eb50521150a48bcca8b4eb53414018b6bca19f4801456c5e36a940037ac516b0d6412ba44ec6b4f268a55ef1c5ffbf18a2f4e3522bb7b6ed89774b79bffa22f7d3102165565642de0d43a955e96a1f2e80e5430671d7266eb4f905dc8ff5e106dc5588e5b0289e49a4913940e392a97062616d2bda38155471b7d360cfb94681c702f60ed2d4de614ea72bf1c53160e63179f6c5b897b59492bee219108309f0b7b8cb2b136c346a5e98b8b4b8415fb1d713bae067911e3057f1c335b4b7e39101eafd5d28f0189037e4334f4fdb9038427b1d119a6702aa8233319cc97d496cc289ae8c956ddc84042659a2d43d6aa22f12b81ab884e
|
||||
Output = 1f037dd717b07d3e7f7359
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# negative test with otherwise valid padding but a zero byte at the eigth
|
||||
# byte of padding
|
||||
Decrypt = RSA-2048-2
|
||||
Input = a7a340675a82c30e22219a55bc07cdf36d47d01834c1834f917f18b517419ce9de2a96460e745024436470ed85e94297b283537d52189c406a3f533cb405cc6a9dba46b482ce98b6e3dd52d8fce2237425617e38c11fbc46b61897ef200d01e4f25f5f6c4c5b38cd0de38ba11908b86595a8036a08a42a3d05b79600a97ac18ba368a08d6cf6ccb624f6e8002afc75599fba4de3d4f3ba7d208391ebe8d21f8282b18e2c10869eb2702e68f9176b42b0ddc9d763f0c86ba0ff92c957aaeab76d9ab8da52ea297ec11d92d770146faa1b300e0f91ef969b53e7d2907ffc984e9a9c9d11fb7d6cba91972059b46506b035efec6575c46d7114a6b935864858445f
|
||||
Output = 63cb0bf65fc8255dd29e17
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# negative test with an otherwise valid plaintext but with missing separator
|
||||
# byte
|
||||
Decrypt = RSA-2048-2
|
||||
@@ -501,6 +531,8 @@ PrivPubKeyPair = RSA-2049:RSA-2049-PUBLIC
|
||||
|
||||
# RSA decrypt
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# malformed that generates length specified by 3rd last value from PRF
|
||||
Decrypt = RSA-2049
|
||||
Input = 00b26f6404b82649629f2704494282443776929122e279a9cf30b0c6fe8122a0a9042870d97cc8ef65490fe58f031eb2442352191f5fbc311026b5147d32df914599f38b825ebb824af0d63f2d541a245c5775d1c4b78630e4996cc5fe413d38455a776cf4edcc0aa7fccb31c584d60502ed2b77398f536e137ff7ba6430e9258e21c2db5b82f5380f566876110ac4c759178900fbad7ab70ea07b1daf7a1639cbb4196543a6cbe8271f35dddb8120304f6eef83059e1c5c5678710f904a6d760c4d1d8ad076be17904b9e69910040b47914a0176fb7eea0c06444a6c4b86d674d19a556a1de5490373cb01ce31bbd15a5633362d3d2cd7d4af1b4c5121288b894
|
||||
@@ -531,16 +563,22 @@ Decrypt = RSA-2049
|
||||
Input = f36da3b72d8ff6ded74e7efd08c01908f3f5f0de7b55eab92b5f875190809c39d4162e1e6649618f854fd84aeab03970d16bb814e999852c06de38d82b95c0f32e2a7b5714021fe303389be9c0eac24c90a6b7210f929d390fabf903d44e04110bb7a7fd6c383c275804721efa6d7c93aa64c0bb2b18d97c5220a846c66a4895ae52adddbe2a9996825e013585adcec4b32ba61d782737bd343e5fabd68e8a95b8b1340318559860792dd70dffbe05a1052b54cbfb48cfa7bb3c19cea52076bddac5c25ee276f153a610f6d06ed696d192d8ae4507ffae4e5bdda10a625d6b67f32f7cffcd48dee2431fe66f6105f9d17e611cdcc674868e81692a360f4052
|
||||
Output = "lorem ipsum"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case that generates an 11 byte long message
|
||||
Decrypt = RSA-2049
|
||||
Input = 00f910200830fc8fff478e99e145f1474b312e2512d0f90b8cef77f8001d09861688c156d1cbaf8a8957f7ebf35f724466952d0524cad48aad4fba1e45ce8ea27e8f3ba44131b7831b62d60c0762661f4c1d1a88cd06263a259abf1ba9e6b0b172069afb86a7e88387726f8ab3adb30bfd6b3f6be6d85d5dfd044e7ef052395474a9cbb1c3667a92780b43a22693015af6c513041bdaf87d43b24ddd244e791eeaea1066e1f4917117b3a468e22e0f7358852bb981248de4d720add2d15dccba6280355935b67c96f9dcb6c419cc38ab9f6fba2d649ef2066e0c34c9f788ae49babd9025fa85b21113e56ce4f43aa134c512b030dd7ac7ce82e76f0be9ce09ebca
|
||||
Output = 1189b6f5498fd6df532b00
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# otherwise correct plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
Decrypt = RSA-2049
|
||||
Input = 002c9ddc36ba4cf0038692b2d3a1c61a4bb3786a97ce2e46a3ba74d03158aeef456ce0f4db04dda3fe062268a1711250a18c69778a6280d88e133a16254e1f0e30ce8dac9b57d2e39a2f7d7be3ee4e08aec2fdbe8dadad7fdbf442a29a8fb40857407bf6be35596b8eefb5c2b3f58b894452c2dc54a6123a1a38d642e23751746597e08d71ac92704adc17803b19e131b4d1927881f43b0200e6f95658f559f912c889b4cd51862784364896cd6e8618f485a992f82997ad6a0917e32ae5872eaf850092b2d6c782ad35f487b79682333c1750c685d7d32ab3e1538f31dcaa5e7d5d2825875242c83947308dcf63ba4bfff20334c9c140c837dbdbae7a8dee72ff
|
||||
Output = f6d0f5b78082fe61c04674
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# otherwise correct plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
Decrypt = RSA-2049
|
||||
Input = 00c5d77826c1ab7a34d6390f9d342d5dbe848942e2618287952ba0350d7de6726112e9cebc391a0fae1839e2bf168229e3e0d71d4161801509f1f28f6e1487ca52df05c466b6b0a6fbbe57a3268a970610ec0beac39ec0fa67babce1ef2a86bf77466dc127d7d0d2962c20e66593126f276863cd38dc6351428f884c1384f67cad0a0ffdbc2af16711fb68dc559b96b37b4f04cd133ffc7d79c43c42ca4948fa895b9daeb853150c8a5169849b730cc77d68b0217d6c0e3dbf38d751a1998186633418367e7576530566c23d6d4e0da9b038d0bb5169ce40133ea076472d055001f0135645940fd08ea44269af2604c8b1ba225053d6db9ab43577689401bdc0f3
|
||||
@@ -603,17 +641,23 @@ ooCElYcob01/JWzoXl61Z5sdrMH5CVZJty5foHKusAN5AgMBAAE=
|
||||
|
||||
PrivPubKeyPair = RSA-3072:RSA-3072-PUBLIC
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random invalid ciphertext that generates an empty synthethic one
|
||||
Decrypt = RSA-3072
|
||||
Input = 5e956cd9652f4a2ece902931013e09662b6a9257ad1e987fb75f73a0606df2a4b04789770820c2e02322c4e826f767bd895734a01e20609c3be4517a7a2a589ea1cdc137beb73eb38dac781b52e863de9620f79f9b90fd5b953651fcbfef4a9f1cc07421d511a87dd6942caab6a5a0f4df473e62defb529a7de1509ab99c596e1dff1320402298d8be73a896cc86c38ae3f2f576e9ea70cc28ad575cb0f854f0be43186baa9c18e29c47c6ca77135db79c811231b7c1730955887d321fdc06568382b86643cf089b10e35ab23e827d2e5aa7b4e99ff2e914f302351819eb4d1693243b35f8bf1d42d08f8ec4acafa35f747a4a975a28643ec630d8e4fa5be59d81995660a14bb64c1fea5146d6b11f92da6a3956dd5cb5e0d747cf2ea23f81617769185336263d46ef4c144b754de62a6337342d6c85a95f19f015724546ee3fc4823eca603dbc1dc01c2d5ed50bd72d8e96df2dc048edde0081284068283fc5e73a6139851abf2f29977d0b3d160c883a42a37efba1be05c1a0b1741d7ddf59
|
||||
Output =
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random invalid that has PRF output with a length one byte too long
|
||||
# in the last value
|
||||
Decrypt = RSA-3072
|
||||
Input = 7db0390d75fcf9d4c59cf27b264190d856da9abd11e92334d0e5f71005cfed865a711dfa28b791188374b61916dbc11339bf14b06f5f3f68c206c5607380e13da3129bfb744157e1527dd6fdf6651248b028a496ae1b97702d44706043cdaa7a59c0f41367303f21f268968bf3bd2904db3ae5239b55f8b438d93d7db9d1666c071c0857e2ec37757463769c54e51f052b2a71b04c2869e9e7049a1037b8429206c99726f07289bac18363e7eb2a5b417f47c37a55090cda676517b3549c873f2fe95da9681752ec9864b069089a2ed2f340c8b04ee00079055a817a3355b46ac7dc00d17f4504ccfbcfcadb0c04cb6b22069e179385ae1eafabad5521bac2b8a8ee1dfff59a22eb3fdacfc87175d10d7894cfd869d056057dd9944b869c1784fcc27f731bc46171d39570fbffbadf082d33f6352ecf44aca8d9478e53f5a5b7c852b401e8f5f74da49da91e65bdc97765a9523b7a0885a6f8afe5759d58009fbfa837472a968e6ae92026a5e0202a395483095302d6c3985b5f5831c521a271
|
||||
Output = 56a3bea054e01338be9b7d7957539c
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random invalid that generates a synthethic of maximum size
|
||||
Decrypt = RSA-3072
|
||||
Input = 1715065322522dff85049800f6a29ab5f98c465020467414b2a44127fe9446da47fa18047900f99afe67c2df6f50160bb8e90bff296610fde632b3859d4d0d2e644f23835028c46cca01b84b88231d7e03154edec6627bcba23de76740d839851fa12d74c8f92e540c73fe837b91b7d699b311997d5f0f7864c486d499c3a79c111faaacbe4799597a25066c6200215c3d158f3817c1aa57f18bdaad0be1658da9da93f5cc6c3c4dd72788af57adbb6a0c26f42d32d95b8a4f95e8c6feb2f8a5d53b19a50a0b7cbc25e055ad03e5ace8f3f7db13e57759f67b65d143f08cca15992c6b2aae643390483de111c2988d4e76b42596266005103c8de6044fb7398eb3c28a864fa672de5fd8774510ff45e05969a11a4c7d3f343e331190d2dcf24fb9154ba904dc94af98afc5774a9617d0418fe6d13f8245c7d7626c176138dd698a23547c25f27c2b98ea4d8a45c7842b81888e4cc14e5b72e9cf91f56956c93dbf2e5f44a8282a7813157fc481ff1371a0f66b31797e81ebdb09a673d4db96d6
|
||||
@@ -644,43 +688,59 @@ Decrypt = RSA-3072
|
||||
Input = 1ec97ac981dfd9dcc7a7389fdfa9d361141dac80c23a060410d472c16094e6cdffc0c3684d84aa402d7051dfccb2f6da33f66985d2a259f5b7fbf39ac537e95c5b7050eb18844a0513abef812cc8e74a3c5240009e6e805dcadf532bc1a2702d5acc9e585fad5b89d461fcc1397351cdce35171523758b171dc041f412e42966de7f94856477356d06f2a6b40e3ff0547562a4d91bbf1338e9e049facbee8b20171164505468cd308997447d3dc4b0acb49e7d368fedd8c734251f30a83491d2506f3f87318cc118823244a393dc7c5c739a2733d93e1b13db6840a9429947357f47b23fbe39b7d2d61e5ee26f9946c4632f6c4699e452f412a26641d4751135400713cd56ec66f0370423d55d2af70f5e7ad0adea8e4a0d904a01e4ac272eba4af1a029dd53eb71f115bf31f7a6c8b19a6523adeecc0d4c3c107575e38572a8f8474ccad163e46e2e8b08111132aa97a16fb588c9b7e37b3b3d7490381f3c55d1a9869a0fd42cd86fed59ecec78cb6b2dfd06a497f5afe3419691314ba0
|
||||
Output = "forty two"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case that generates a 9 byte long message
|
||||
Decrypt = RSA-3072
|
||||
Input = 5c8555f5cef627c15d37f85c7f5fd6e499264ea4b8e3f9112023aeb722eb38d8eac2be3751fd5a3785ab7f2d59fa3728e5be8c3de78a67464e30b21ee23b5484bb3cd06d0e1c6ad25649c8518165653eb80488bfb491b20c04897a6772f69292222fc5ef50b5cf9efc6d60426a449b6c489569d48c83488df629d695653d409ce49a795447fcec2c58a1a672e4a391401d428baaf781516e11e323d302fcf20f6eab2b2dbe53a48c987e407c4d7e1cb41131329138313d330204173a4f3ff06c6fadf970f0ed1005d0b27e35c3d11693e0429e272d583e57b2c58d24315c397856b34485dcb077665592b747f889d34febf2be8fce66c265fd9fc3575a6286a5ce88b4b413a08efc57a07a8f57a999605a837b0542695c0d189e678b53662ecf7c3d37d9dbeea585eebfaf79141118e06762c2381fe27ca6288edddc19fd67cd64f16b46e06d8a59ac530f22cd83cc0bc4e37feb52015cbb2283043ccf5e78a4eb7146827d7a466b66c8a4a4826c1bad68123a7f2d00fc1736525ff90c058f56
|
||||
Output = 257906ca6de8307728
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test case that generates a 9 byte long message based on
|
||||
# second to last value from PRF
|
||||
Decrypt = RSA-3072
|
||||
Input = 758c215aa6acd61248062b88284bf43c13cb3b3d02410be4238607442f1c0216706e21a03a2c10eb624a63322d854da195c017b76fea83e274fa371834dcd2f3b7accf433fc212ad76c0bac366e1ed32e25b279f94129be7c64d6e162adc08ccebc0cfe8e926f01c33ab9c065f0e0ac83ae5137a4cb66702615ad68a35707d8676d2740d7c1a954680c83980e19778ed11eed3a7c2dbdfc461a9bbef671c1bc00c882d361d29d5f80c42bdf5efec886c34138f83369c6933b2ac4e93e764265351b4a0083f040e14f511f09b22f96566138864e4e6ff24da4810095da98e0585410951538ced2f757a277ff8e17172f06572c9024eeae503f176fd46eb6c5cd9ba07af11cde31dccac12eb3a4249a7bfd3b19797ad1656984bfcbf6f74e8f99d8f1ac420811f3d166d87f935ef15ae858cf9e72c8e2b547bf16c3fb09a8c9bf88fd2e5d38bf24ed610896131a84df76b9f920fe76d71fff938e9199f3b8cd0c11fd0201f9139d7673a871a9e7d4adc3bbe360c8813617cd60a90128fbe34c9d5
|
||||
Output = 043383c929060374ed
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# a random negative test that generates message based on 3rd last value from
|
||||
# PRF
|
||||
Decrypt = RSA-3072
|
||||
Input = 7b22d5e62d287968c6622171a1f75db4b0fd15cdf3134a1895d235d56f8d8fe619f2bf4868174a91d7601a82975d2255190d28b869141d7c395f0b8c4e2be2b2c1b4ffc12ce749a6f6803d4cfe7fba0a8d6949c04151f981c0d84592aa2ff25d1bd3ce5d10cb03daca6b496c6ad40d30bfa8acdfd02cdb9326c4bdd93b949c9dc46caa8f0e5f429785bce64136a429a3695ee674b647452bea1b0c6de9c5f1e8760d5ef6d5a9cfff40457b023d3c233c1dcb323e7808103e73963b2eafc928c9eeb0ee3294955415c1ddd9a1bb7e138fecd79a3cb89c57bd2305524624814aaf0fd1acbf379f7f5b39421f12f115ba488d380586095bb53f174fae424fa4c8e3b299709cd344b9f949b1ab57f1c645d7ed3c8f81d5594197355029fee8960970ff59710dc0e5eb50ea6f4c3938e3f89ed7933023a2c2ddffaba07be147f686828bd7d520f300507ed6e71bdaee05570b27bc92741108ac2eb433f028e138dd6d63067bc206ea2d826a7f41c0d613daed020f0f30f4e272e9618e0a8c39018a83
|
||||
Output = 70263fa6050534b9e0
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with wrong first byte (0x01 instead of 0x00)
|
||||
Decrypt = RSA-3072
|
||||
Input = 6db80adb5ff0a768caf1378ecc382a694e7d1bde2eff4ba12c48aaf794ded7a994a5b2b57acec20dbec4ae385c9dd531945c0f197a5496908725fc99d88601a17d3bb0b2d38d2c1c3100f39955a4cb3dbed5a38bf900f23d91e173640e4ec655c84fdfe71fcdb12a386108fcf718c9b7af37d39703e882436224c877a2235e8344fba6c951eb7e2a4d1d1de81fb463ac1b880f6cc0e59ade05c8ce35179ecd09546731fc07b141d3d6b342a97ae747e61a9130f72d37ac5a2c30215b6cbd66c7db893810df58b4c457b4b54f34428247d584e0fa71062446210db08254fb9ead1ba1a393c724bd291f0cf1a7143f32df849051dc896d7d176fef3b57ab6dffd626d0c3044e9edb2e3d012ace202d2581df01bec7e9aa0727a6650dd373d374f0bc0f4a611f8139dfe97d63e70c6188f4df5b672e47c51d8aa567097293fbff127c75ec690b43407578b73c85451710a0cece58fd497d7f7bd36a8a92783ef7dc6265dff52aac8b70340b996508d39217f2783ce6fc91a1cc94bb2ac487b84f62
|
||||
Output = 6d8d3a094ff3afff4c
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with wrong second byte (0x01 instead of 0x02)
|
||||
Decrypt = RSA-3072
|
||||
Input = 417328c034458563079a4024817d0150340c34e25ae16dcad690623f702e5c748a6ebb3419ff48f486f83ba9df35c05efbd7f40613f0fc996c53706c30df6bba6dcd4a40825f96133f3c21638a342bd4663dffbd0073980dac47f8c1dd8e97ce1412e4f91f2a8adb1ac2b1071066efe8d718bbb88ca4a59bd61500e826f2365255a409bece0f972df97c3a55e09289ef5fa815a2353ef393fd1aecfc888d611c16aec532e5148be15ef1bf2834b8f75bb26db08b66d2baad6464f8439d1986b533813321dbb180080910f233bcc4dd784fb21871aef41be08b7bfad4ecc3b68f228cb5317ac6ec1227bc7d0e452037ba918ee1da9fdb8393ae93b1e937a8d4691a17871d5092d2384b6190a53df888f65b951b05ed4ad57fe4b0c6a47b5b22f32a7f23c1a234c9feb5d8713d949686760680da4db454f4acad972470033472b9864d63e8d23eefc87ebcf464ecf33f67fbcdd48eab38c5292586b36aef5981ed2fa07b2f9e23fc57d9eb71bfff4111c857e9fff23ceb31e72592e70c874b4936
|
||||
Output = c6ae80ffa80bc184b0
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with zero byte in first byte of padding
|
||||
Decrypt = RSA-3072
|
||||
Input = 8542c626fe533467acffcd4e617692244c9b5a3bf0a215c5d64891ced4bf4f9591b4b2aedff9843057986d81631b0acb3704ec2180e5696e8bd15b217a0ec36d2061b0e2182faa3d1c59bd3f9086a10077a3337a3f5da503ec3753535ffd25b837a12f2541afefd0cffb0224b8f874e4bed13949e105c075ed44e287c5ae03b155e06b90ed247d2c07f1ef3323e3508cce4e4074606c54172ad74d12f8c3a47f654ad671104bf7681e5b061862747d9afd37e07d8e0e2291e01f14a95a1bb4cbb47c304ef067595a3947ee2d722067e38a0f046f43ec29cac6a8801c6e3e9a2331b1d45a7aa2c6af3205be382dd026e389614ee095665a611ab2e8dced2ee1c9d08ac9de11aef5b3803fc9a9ce8231ec87b5fed386fb92ee3db995a89307bcba844bd0a691c29ae51216e949dfc813133cb06a07265fd807bcb3377f6adb0a481d9b7f442003115895939773e6b95371c4febef29edae946fa245e7c50729e2e558cfaad773d1fd5f67b457a6d9d17a847c6fcbdb103a86f35f228cefc06cea0
|
||||
Output = a8a9301daa01bb25c7
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with zero byte in eight byte of padding
|
||||
Decrypt = RSA-3072
|
||||
Input = 449dfa237a70a99cb0351793ec8677882021c2aa743580bf6a0ea672055cffe8303ac42855b1d1f3373aae6af09cb9074180fc963e9d1478a4f98b3b4861d3e7f0aa8560cf603711f139db77667ca14ba3a1acdedfca9ef4603d6d7eb0645bfc805304f9ad9d77d34762ce5cd84bd3ec9d35c30e3be72a1e8d355d5674a141b5530659ad64ebb6082e6f73a80832ab6388912538914654d34602f4b3b1c78589b4a5d964b2efcca1dc7004c41f6cafcb5a7159a7fc7c0398604d0edbd4c8f4f04067da6a153a05e7cbeea13b5ee412400ef7d4f3106f4798da707ec37a11286df2b7a204856d5ff773613fd1e453a7114b78e347d3e8078e1cb3276b3562486ba630bf719697e0073a123c3e60ebb5c7a1ccff4279faffa2402bc1109f8d559d6766e73591943dfcf25ba10c3762f02af85187799b8b4b135c3990793a6fd32642f1557405ba55cc7cf7336a0e967073c5fa50743f9cc5e3017c172d9898d2af83345e71b3e0c22ab791eacb6484a32ec60ebc226ec9deaee91b1a0560c2b571
|
||||
Output = 6c716fe01d44398018
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
# an otherwise valid plaintext, but with null separator missing
|
||||
Decrypt = RSA-3072
|
||||
Input = a7a5c99e50da48769ecb779d9abe86ef9ec8c38c6f43f17c7f2d7af608a4a1bd6cf695b47e97c191c61fb5a27318d02f495a176b9fae5a55b5d3fabd1d8aae4957e3879cb0c60f037724e11be5f30f08fc51c033731f14b44b414d11278cd3dba7e1c8bfe208d2b2bb7ec36366dacb6c88b24cd79ab394adf19dbbc21dfa5788bacbadc6a62f79cf54fd8cf585c615b5c0eb94c35aa9de25321c8ffefb8916bbaa2697cb2dd82ee98939df9b6704cee77793edd2b4947d82e00e5749664970736c59a84197bd72b5c71e36aae29cd39af6ac73a368edbc1ca792e1309f442aafcd77c992c88f8e4863149f221695cb7b0236e75b2339a02c4ea114854372c306b9412d8eedb600a31532002f2cea07b4df963a093185e4607732e46d753b540974fb5a5c3f9432df22e85bb17611370966c5522fd23f2ad3484341ba7fd8885fc8e6d379a611d13a2aca784fba2073208faad2137bf1979a0fa146c1880d4337db3274269493bab44a1bcd0681f7227ffdf589c2e925ed9d36302509d1109ba4
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
From 455db0c94c0b83083ce8b792982c03aa56fc866f Mon Sep 17 00:00:00 2001
|
||||
From: Hubert Kario <hkario@redhat.com>
|
||||
Date: Tue, 22 Nov 2022 17:42:11 +0100
|
||||
Subject: [PATCH] rsa: add test for the option to disable implicit rejection
|
||||
|
||||
CVE: CVE-2023-50781
|
||||
|
||||
Upstream-Status: Backport [https://github.com/openssl/openssl/commit/455db0c94c0b83083ce8b792982c03aa56fc866f]
|
||||
|
||||
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Tomas Mraz <tomas@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/13817)
|
||||
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
|
||||
---
|
||||
.../30-test_evp_data/evppkey_rsa_common.txt | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
index 0ad654fc60..a3d01eec45 100644
|
||||
--- a/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
+++ b/test/recipes/30-test_evp_data/evppkey_rsa_common.txt
|
||||
@@ -253,6 +253,14 @@ Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A78
|
||||
Output = "Hello World"
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
+# Note: disable the Bleichenbacher workaround to see if it passes
|
||||
+Decrypt = RSA-2048
|
||||
+Ctrl = rsa_pkcs1_implicit_rejection:0
|
||||
+Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A78
|
||||
+Output = "Hello World"
|
||||
+
|
||||
# The old FIPS provider doesn't include the workaround (#13817)
|
||||
FIPSversion = >3.0.0
|
||||
# Corrupted ciphertext
|
||||
@@ -261,6 +269,16 @@ Decrypt = RSA-2048
|
||||
Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A79
|
||||
Output = 4cbb988d6a46228379132b0b5f8c249b3860043848c93632fb982c807c7c82fffc7a9ef83f4908f890373ac181ffea6381e103bcaa27e65638b6ecebef38b59ed4226a9d12af675cfcb634d8c40e7a7aff
|
||||
|
||||
+# The old FIPS provider doesn't include the workaround (#13817)
|
||||
+FIPSversion = >3.0.0
|
||||
+# Corrupted ciphertext
|
||||
+# Note: disable the Bleichenbacher workaround to see if it fails
|
||||
+Decrypt = RSA-2048
|
||||
+Ctrl = rsa_pkcs1_implicit_rejection:0
|
||||
+Input = 550AF55A2904E7B9762352F8FB7FA235A9CB053AACB2D5FCB8CA48453CB2EE3619746C701ABF2D4CC67003471A187900B05AA812BD25ED05C675DFC8C97A24A7BF49BD6214992CAD766D05A9A2B57B74F26A737E0237B8B76C45F1F226A836D7CFBC75BA999BDBE48DBC09227AA46C88F21DCCBA7840141AD5A5D71FD122E6BD6AC3E564780DFE623FC1CA9B995A6037BF0BBD43B205A84AC5444F34202C05CE9113087176432476576DE6FFFF9A52EA57C08BE3EC2F49676CB8E12F762AC71FA3C321E00AC988910C85FF52F93825666CE0D40FFAA0592078919D4493F46D95CCF76364C6D57760DD0B64805F9AFC76A2365A5575CA301D5103F0EA76CB9A79
|
||||
+Output = "Hello World"
|
||||
+Result = KEYOP_ERROR
|
||||
+
|
||||
# OAEP padding
|
||||
Decrypt = RSA-2048
|
||||
Ctrl = rsa_padding_mode:oaep
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -13,7 +13,13 @@ SRC_URI = "https://github.com/openssl/openssl/releases/download/openssl-${PV}/op
|
||||
file://afalg.patch \
|
||||
file://0001-Configure-do-not-tweak-mips-cflags.patch \
|
||||
file://CVE-2024-41996.patch \
|
||||
"
|
||||
file://CVE-2023-50781-1.patch \
|
||||
file://CVE-2023-50781-2.patch \
|
||||
file://CVE-2023-50781-3.patch \
|
||||
file://CVE-2023-50781-4.patch \
|
||||
file://CVE-2023-50781-5.patch \
|
||||
file://CVE-2023-50781-6.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-nativesdk = " \
|
||||
file://environment.d-openssl.sh \
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
From 9d3f347a2b14652e767d51142600206a32676b62 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Mon, 24 Jan 2022 20:57:19 +0200
|
||||
Subject: [PATCH] DPP3: Add PKEX initiator retries and fallback from v2 to v1
|
||||
for hostapd
|
||||
|
||||
This extends hostapd with the design used in wpa_supplicant for PKEX
|
||||
initiator retries and automatic version fallback from v2 to v1 (the
|
||||
latter is enabled only with CONFIG_DPP3=y).
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=9d3f347a2b14652e767d51142600206a32676b62]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 188 +++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 171 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index 13e1fc5..6c30ba3 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -216,6 +216,163 @@ static void hostapd_dpp_auth_resp_retry(struct hostapd_data *hapd)
|
||||
}
|
||||
|
||||
|
||||
+static int hostapd_dpp_allow_ir(struct hostapd_data *hapd, unsigned int freq)
|
||||
+{
|
||||
+ int i, j;
|
||||
+
|
||||
+ if (!hapd->iface->hw_features)
|
||||
+ return -1;
|
||||
+
|
||||
+ for (i = 0; i < hapd->iface->num_hw_features; i++) {
|
||||
+ struct hostapd_hw_modes *mode = &hapd->iface->hw_features[i];
|
||||
+
|
||||
+ for (j = 0; j < mode->num_channels; j++) {
|
||||
+ struct hostapd_channel_data *chan = &mode->channels[j];
|
||||
+
|
||||
+ if (chan->freq != (int) freq)
|
||||
+ continue;
|
||||
+
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_DISABLED |
|
||||
+ HOSTAPD_CHAN_NO_IR |
|
||||
+ HOSTAPD_CHAN_RADAR))
|
||||
+ continue;
|
||||
+
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Frequency %u MHz not supported or does not allow PKEX initiation in the current channel list",
|
||||
+ freq);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
+ struct dpp_pkex *pkex)
|
||||
+{
|
||||
+ if (pkex->freq == 2437)
|
||||
+ pkex->freq = 5745;
|
||||
+ else if (pkex->freq == 5745)
|
||||
+ pkex->freq = 5220;
|
||||
+ else if (pkex->freq == 5220)
|
||||
+ pkex->freq = 60480;
|
||||
+ else
|
||||
+ return -1; /* no more channels to try */
|
||||
+
|
||||
+ if (hostapd_dpp_allow_ir(hapd, pkex->freq) == 1) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Try to initiate on %u MHz",
|
||||
+ pkex->freq);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ /* Could not use this channel - try the next one */
|
||||
+ return hostapd_dpp_pkex_next_channel(hapd, pkex);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int hostapd_dpp_pkex_init(struct hostapd_data *hapd, bool v2)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ unsigned int wait_time;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
+ dpp_pkex_free(hapd->dpp_pkex);
|
||||
+ hapd->dpp_pkex = dpp_pkex_init(hapd->msg_ctx, hapd->dpp_pkex_bi,
|
||||
+ hapd->own_addr,
|
||||
+ hapd->dpp_pkex_identifier,
|
||||
+ hapd->dpp_pkex_code, v2);
|
||||
+ pkex = hapd->dpp_pkex;
|
||||
+ if (!pkex)
|
||||
+ return -1;
|
||||
+
|
||||
+ msg = hapd->dpp_pkex->exchange_req;
|
||||
+ wait_time = 2000; /* TODO: hapd->max_remain_on_chan; */
|
||||
+ pkex->freq = 2437;
|
||||
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
+ " freq=%u type=%d", MAC2STR(broadcast), pkex->freq,
|
||||
+ v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
+ DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
+ hostapd_drv_send_action(hapd, pkex->freq, 0, broadcast,
|
||||
+ wpabuf_head(msg), wpabuf_len(msg));
|
||||
+ pkex->exch_req_wait_time = wait_time;
|
||||
+ pkex->exch_req_tries = 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void hostapd_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = eloop_ctx;
|
||||
+ struct dpp_pkex *pkex = hapd->dpp_pkex;
|
||||
+
|
||||
+ if (!pkex || !pkex->exchange_req)
|
||||
+ return;
|
||||
+ if (pkex->exch_req_tries >= 5) {
|
||||
+ if (hostapd_dpp_pkex_next_channel(hapd, pkex) < 0) {
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ if (pkex->v2) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Fall back to PKEXv1");
|
||||
+ hostapd_dpp_pkex_init(hapd, false);
|
||||
+ return;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_FAIL
|
||||
+ "No response from PKEX peer");
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ hapd->dpp_pkex = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
+ pkex->exch_req_tries = 0;
|
||||
+ }
|
||||
+
|
||||
+ pkex->exch_req_tries++;
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Retransmit PKEX Exchange Request (try %u)",
|
||||
+ pkex->exch_req_tries);
|
||||
+ wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
+ " freq=%u type=%d",
|
||||
+ MAC2STR(broadcast), pkex->freq,
|
||||
+ pkex->v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
+ DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
+ hostapd_drv_send_action(hapd, pkex->freq, pkex->exch_req_wait_time,
|
||||
+ broadcast,
|
||||
+ wpabuf_head(pkex->exchange_req),
|
||||
+ wpabuf_len(pkex->exchange_req));
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void hostapd_dpp_pkex_tx_status(struct hostapd_data *hapd, const u8 *dst,
|
||||
+ const u8 *data, size_t data_len, int ok)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = hapd->dpp_pkex;
|
||||
+
|
||||
+ if (pkex->failed) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Terminate PKEX exchange due to an earlier error");
|
||||
+ if (pkex->t > pkex->own_bi->pkex_t)
|
||||
+ pkex->own_bi->pkex_t = pkex->t;
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ hapd->dpp_pkex = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (pkex->exch_req_wait_time && pkex->exchange_req) {
|
||||
+ /* Wait for PKEX Exchange Response frame and retry request if
|
||||
+ * no response is seen. */
|
||||
+ eloop_cancel_timeout(hostapd_dpp_pkex_retry_timeout, hapd,
|
||||
+ NULL);
|
||||
+ eloop_register_timeout(pkex->exch_req_wait_time / 1000,
|
||||
+ (pkex->exch_req_wait_time % 1000) * 1000,
|
||||
+ hostapd_dpp_pkex_retry_timeout, hapd,
|
||||
+ NULL);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
void hostapd_dpp_tx_status(struct hostapd_data *hapd, const u8 *dst,
|
||||
const u8 *data, size_t data_len, int ok)
|
||||
{
|
||||
@@ -227,6 +384,11 @@ void hostapd_dpp_tx_status(struct hostapd_data *hapd, const u8 *dst,
|
||||
" result=%s", MAC2STR(dst), ok ? "SUCCESS" : "FAILED");
|
||||
|
||||
if (!hapd->dpp_auth) {
|
||||
+ if (hapd->dpp_pkex) {
|
||||
+ hostapd_dpp_pkex_tx_status(hapd, dst, data, data_len,
|
||||
+ ok);
|
||||
+ return;
|
||||
+ }
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Ignore TX status since there is no ongoing authentication exchange");
|
||||
return;
|
||||
@@ -1783,6 +1945,9 @@ hostapd_dpp_rx_pkex_exchange_resp(struct hostapd_data *hapd, const u8 *src,
|
||||
return;
|
||||
}
|
||||
|
||||
+ eloop_cancel_timeout(hostapd_dpp_pkex_retry_timeout, hapd, NULL);
|
||||
+ hapd->dpp_pkex->exch_req_wait_time = 0;
|
||||
+
|
||||
msg = dpp_pkex_rx_exchange_resp(hapd->dpp_pkex, src, buf, len);
|
||||
if (!msg) {
|
||||
wpa_printf(MSG_DEBUG, "DPP: Failed to process the response");
|
||||
@@ -2172,26 +2337,14 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
return -1;
|
||||
|
||||
if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
- struct wpabuf *msg;
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ bool v2 = true;
|
||||
+#else /* CONFIG_DPP3 */
|
||||
bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "DPP: Initiating PKEX");
|
||||
- dpp_pkex_free(hapd->dpp_pkex);
|
||||
- hapd->dpp_pkex = dpp_pkex_init(hapd->msg_ctx, own_bi,
|
||||
- hapd->own_addr,
|
||||
- hapd->dpp_pkex_identifier,
|
||||
- hapd->dpp_pkex_code, v2);
|
||||
- if (!hapd->dpp_pkex)
|
||||
+ if (hostapd_dpp_pkex_init(hapd, v2) < 0)
|
||||
return -1;
|
||||
-
|
||||
- msg = hapd->dpp_pkex->exchange_req;
|
||||
- /* TODO: Which channel to use? */
|
||||
- wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
- " freq=%u type=%d", MAC2STR(broadcast), 2437,
|
||||
- v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
- DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
- hostapd_drv_send_action(hapd, 2437, 0, broadcast,
|
||||
- wpabuf_head(msg), wpabuf_len(msg));
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
@@ -2319,6 +2472,7 @@ void hostapd_dpp_deinit(struct hostapd_data *hapd)
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
if (!hapd->dpp_init_done)
|
||||
return;
|
||||
+ eloop_cancel_timeout(hostapd_dpp_pkex_retry_timeout, hapd, NULL);
|
||||
eloop_cancel_timeout(hostapd_dpp_reply_wait_timeout, hapd, NULL);
|
||||
eloop_cancel_timeout(hostapd_dpp_auth_conf_wait_timeout, hapd, NULL);
|
||||
eloop_cancel_timeout(hostapd_dpp_init_timeout, hapd, NULL);
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
From 80213629981a21825e4688fde1b590e4c4d4bcea Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Mon, 24 Jan 2022 20:21:24 +0200
|
||||
Subject: [PATCH] DPP3: Start with PKEXv2 and fall back to v1
|
||||
|
||||
Use automatic PKEX version negotiation as the initiator by starting with
|
||||
PKEXv2 and if no response is received, trying again with PKEXv1. For
|
||||
now, this is enabled only in wpa_supplicant CONFIG_DPP3=y builds.
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=80213629981a21825e4688fde1b590e4c4d4bcea]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
wpa_supplicant/dpp_supplicant.c | 81 +++++++++++++++++++++------------
|
||||
1 file changed, 52 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index 584654a..43c85d3 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,6 +2557,45 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
+static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s, bool v2)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ unsigned int wait_time;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
+ dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
+ wpa_s->dpp_pkex = dpp_pkex_init(wpa_s, wpa_s->dpp_pkex_bi,
|
||||
+ wpa_s->own_addr,
|
||||
+ wpa_s->dpp_pkex_identifier,
|
||||
+ wpa_s->dpp_pkex_code, v2);
|
||||
+ pkex = wpa_s->dpp_pkex;
|
||||
+ if (!pkex)
|
||||
+ return -1;
|
||||
+
|
||||
+ msg = pkex->exchange_req;
|
||||
+ wait_time = wpa_s->max_remain_on_chan;
|
||||
+ if (wait_time > 2000)
|
||||
+ wait_time = 2000;
|
||||
+ pkex->freq = 2437;
|
||||
+ wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
+ " freq=%u type=%d",
|
||||
+ MAC2STR(broadcast), pkex->freq,
|
||||
+ v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
+ DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
+ offchannel_send_action(wpa_s, pkex->freq, broadcast,
|
||||
+ wpa_s->own_addr, broadcast,
|
||||
+ wpabuf_head(msg), wpabuf_len(msg),
|
||||
+ wait_time, wpas_dpp_tx_pkex_status, 0);
|
||||
+ if (wait_time == 0)
|
||||
+ wait_time = 2000;
|
||||
+ pkex->exch_req_wait_time = wait_time;
|
||||
+ pkex->exch_req_tries = 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = eloop_ctx;
|
||||
@@ -2566,6 +2605,14 @@ static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
return;
|
||||
if (pkex->exch_req_tries >= 5) {
|
||||
if (wpas_dpp_pkex_next_channel(wpa_s, pkex) < 0) {
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ if (pkex->v2) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Fall back to PKEXv1");
|
||||
+ wpas_dpp_pkex_init(wpa_s, false);
|
||||
+ return;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_FAIL
|
||||
"No response from PKEX peer");
|
||||
dpp_pkex_free(pkex);
|
||||
@@ -3271,7 +3318,6 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
{
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
const char *pos, *end;
|
||||
- unsigned int wait_time;
|
||||
|
||||
pos = os_strstr(cmd, " own=");
|
||||
if (!pos)
|
||||
@@ -3315,37 +3361,14 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
return -1;
|
||||
|
||||
if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
- struct dpp_pkex *pkex;
|
||||
- struct wpabuf *msg;
|
||||
+#ifdef CONFIG_DPP3
|
||||
+ bool v2 = true;
|
||||
+#else /* CONFIG_DPP3 */
|
||||
bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+#endif /* CONFIG_DPP3 */
|
||||
|
||||
- wpa_printf(MSG_DEBUG, "DPP: Initiating PKEX");
|
||||
- dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
- wpa_s->dpp_pkex = dpp_pkex_init(wpa_s, own_bi, wpa_s->own_addr,
|
||||
- wpa_s->dpp_pkex_identifier,
|
||||
- wpa_s->dpp_pkex_code, v2);
|
||||
- pkex = wpa_s->dpp_pkex;
|
||||
- if (!pkex)
|
||||
+ if (wpas_dpp_pkex_init(wpa_s, v2) < 0)
|
||||
return -1;
|
||||
-
|
||||
- msg = pkex->exchange_req;
|
||||
- wait_time = wpa_s->max_remain_on_chan;
|
||||
- if (wait_time > 2000)
|
||||
- wait_time = 2000;
|
||||
- pkex->freq = 2437;
|
||||
- wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR
|
||||
- " freq=%u type=%d",
|
||||
- MAC2STR(broadcast), pkex->freq,
|
||||
- v2 ? DPP_PA_PKEX_EXCHANGE_REQ :
|
||||
- DPP_PA_PKEX_V1_EXCHANGE_REQ);
|
||||
- offchannel_send_action(wpa_s, pkex->freq, broadcast,
|
||||
- wpa_s->own_addr, broadcast,
|
||||
- wpabuf_head(msg), wpabuf_len(msg),
|
||||
- wait_time, wpas_dpp_tx_pkex_status, 0);
|
||||
- if (wait_time == 0)
|
||||
- wait_time = 2000;
|
||||
- pkex->exch_req_wait_time = wait_time;
|
||||
- pkex->exch_req_tries = 1;
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
From bdcccbc2755dd1a75731496782e02b5435fb9534 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Tue, 25 Jan 2022 20:06:49 +0200
|
||||
Subject: [PATCH] DPP: Change PKEX version configuration design
|
||||
|
||||
Use a separate ver=<1|2> parameter to DPP_PKEX_ADD instead of
|
||||
overloading init=1 with version indication. This allows additional
|
||||
options for forcing v1-only and v2-only in addition to automatic mode
|
||||
(start with v2 and fall back to v1, if needed).
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=bdcccbc2755dd1a75731496782e02b5435fb9534]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 37 ++++++++++++++++++++++++++-------
|
||||
src/common/dpp.h | 1 +
|
||||
wpa_supplicant/dpp_supplicant.c | 37 ++++++++++++++++++++++++++-------
|
||||
3 files changed, 61 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index 6c30ba3..fdfdcf9 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -272,11 +272,19 @@ static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
}
|
||||
|
||||
|
||||
-static int hostapd_dpp_pkex_init(struct hostapd_data *hapd, bool v2)
|
||||
+enum hostapd_dpp_pkex_ver {
|
||||
+ PKEX_VER_AUTO,
|
||||
+ PKEX_VER_ONLY_1,
|
||||
+ PKEX_VER_ONLY_2,
|
||||
+};
|
||||
+
|
||||
+static int hostapd_dpp_pkex_init(struct hostapd_data *hapd,
|
||||
+ enum hostapd_dpp_pkex_ver ver)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
unsigned int wait_time;
|
||||
+ bool v2 = ver != PKEX_VER_ONLY_1;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(hapd->dpp_pkex);
|
||||
@@ -287,6 +295,7 @@ static int hostapd_dpp_pkex_init(struct hostapd_data *hapd, bool v2)
|
||||
pkex = hapd->dpp_pkex;
|
||||
if (!pkex)
|
||||
return -1;
|
||||
+ pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
msg = hapd->dpp_pkex->exchange_req;
|
||||
wait_time = 2000; /* TODO: hapd->max_remain_on_chan; */
|
||||
@@ -314,10 +323,10 @@ static void hostapd_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->exch_req_tries >= 5) {
|
||||
if (hostapd_dpp_pkex_next_channel(hapd, pkex) < 0) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- if (pkex->v2) {
|
||||
+ if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- hostapd_dpp_pkex_init(hapd, false);
|
||||
+ hostapd_dpp_pkex_init(hapd, PKEX_VER_ONLY_1);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -2336,14 +2345,28 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
if (!hapd->dpp_pkex_code)
|
||||
return -1;
|
||||
|
||||
- if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
+ if (os_strstr(cmd, " init=1")) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- bool v2 = true;
|
||||
+ enum hostapd_dpp_pkex_ver ver = PKEX_VER_AUTO;
|
||||
#else /* CONFIG_DPP3 */
|
||||
- bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+ enum hostapd_dpp_pkex_ver ver = PKEX_VER_ONLY_1;
|
||||
#endif /* CONFIG_DPP3 */
|
||||
|
||||
- if (hostapd_dpp_pkex_init(hapd, v2) < 0)
|
||||
+ pos = os_strstr(cmd, " ver=");
|
||||
+ if (pos) {
|
||||
+ int v;
|
||||
+
|
||||
+ pos += 5;
|
||||
+ v = atoi(pos);
|
||||
+ if (v == 1)
|
||||
+ ver = PKEX_VER_ONLY_1;
|
||||
+ else if (v == 2)
|
||||
+ ver = PKEX_VER_ONLY_2;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (hostapd_dpp_pkex_init(hapd, ver) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
diff --git a/src/common/dpp.h b/src/common/dpp.h
|
||||
index 8d62a0e..bfea446 100644
|
||||
--- a/src/common/dpp.h
|
||||
+++ b/src/common/dpp.h
|
||||
@@ -177,6 +177,7 @@ struct dpp_pkex {
|
||||
unsigned int exchange_done:1;
|
||||
unsigned int failed:1;
|
||||
unsigned int v2:1;
|
||||
+ unsigned int forced_ver:1;
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
u8 own_mac[ETH_ALEN];
|
||||
u8 peer_mac[ETH_ALEN];
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index 43c85d3..61b300f 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,11 +2557,19 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
-static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s, bool v2)
|
||||
+enum wpas_dpp_pkex_ver {
|
||||
+ PKEX_VER_AUTO,
|
||||
+ PKEX_VER_ONLY_1,
|
||||
+ PKEX_VER_ONLY_2,
|
||||
+};
|
||||
+
|
||||
+static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s,
|
||||
+ enum wpas_dpp_pkex_ver ver)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
unsigned int wait_time;
|
||||
+ bool v2 = ver != PKEX_VER_ONLY_1;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
@@ -2572,6 +2580,7 @@ static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s, bool v2)
|
||||
pkex = wpa_s->dpp_pkex;
|
||||
if (!pkex)
|
||||
return -1;
|
||||
+ pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
msg = pkex->exchange_req;
|
||||
wait_time = wpa_s->max_remain_on_chan;
|
||||
@@ -2606,10 +2615,10 @@ static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->exch_req_tries >= 5) {
|
||||
if (wpas_dpp_pkex_next_channel(wpa_s, pkex) < 0) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- if (pkex->v2) {
|
||||
+ if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- wpas_dpp_pkex_init(wpa_s, false);
|
||||
+ wpas_dpp_pkex_init(wpa_s, PKEX_VER_ONLY_1);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -3360,14 +3369,28 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
if (!wpa_s->dpp_pkex_code)
|
||||
return -1;
|
||||
|
||||
- if (os_strstr(cmd, " init=1") || os_strstr(cmd, " init=2")) {
|
||||
+ if (os_strstr(cmd, " init=1")) {
|
||||
#ifdef CONFIG_DPP3
|
||||
- bool v2 = true;
|
||||
+ enum wpas_dpp_pkex_ver ver = PKEX_VER_AUTO;
|
||||
#else /* CONFIG_DPP3 */
|
||||
- bool v2 = os_strstr(cmd, " init=2") != NULL;
|
||||
+ enum wpas_dpp_pkex_ver ver = PKEX_VER_ONLY_1;
|
||||
#endif /* CONFIG_DPP3 */
|
||||
|
||||
- if (wpas_dpp_pkex_init(wpa_s, v2) < 0)
|
||||
+ pos = os_strstr(cmd, " ver=");
|
||||
+ if (pos) {
|
||||
+ int v;
|
||||
+
|
||||
+ pos += 5;
|
||||
+ v = atoi(pos);
|
||||
+ if (v == 1)
|
||||
+ ver = PKEX_VER_ONLY_1;
|
||||
+ else if (v == 2)
|
||||
+ ver = PKEX_VER_ONLY_2;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (wpas_dpp_pkex_init(wpa_s, ver) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,941 @@
|
||||
From d7be749335f2585658cf98c4f0e7d6cd5ac06865 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
Date: Tue, 25 Jan 2022 00:35:36 +0200
|
||||
Subject: [PATCH] DPP3: PKEX over TCP
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=d7be749335f2585658cf98c4f0e7d6cd5ac06865]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 155 ++++++++++++++--
|
||||
src/common/dpp.h | 13 ++
|
||||
src/common/dpp_pkex.c | 18 +-
|
||||
src/common/dpp_tcp.c | 308 +++++++++++++++++++++++++++++++-
|
||||
wpa_supplicant/dpp_supplicant.c | 122 ++++++++++++-
|
||||
5 files changed, 580 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index fdfdcf9..d956be9 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -28,12 +28,16 @@ static void hostapd_dpp_auth_conf_wait_timeout(void *eloop_ctx,
|
||||
static void hostapd_dpp_auth_success(struct hostapd_data *hapd, int initiator);
|
||||
static void hostapd_dpp_init_timeout(void *eloop_ctx, void *timeout_ctx);
|
||||
static int hostapd_dpp_auth_init_next(struct hostapd_data *hapd);
|
||||
+static void hostapd_dpp_set_testing_options(struct hostapd_data *hapd,
|
||||
+ struct dpp_authentication *auth);
|
||||
#ifdef CONFIG_DPP2
|
||||
static void hostapd_dpp_reconfig_reply_wait_timeout(void *eloop_ctx,
|
||||
void *timeout_ctx);
|
||||
static void hostapd_dpp_handle_config_obj(struct hostapd_data *hapd,
|
||||
struct dpp_authentication *auth,
|
||||
struct dpp_config_obj *conf);
|
||||
+static int hostapd_dpp_process_conf_obj(void *ctx,
|
||||
+ struct dpp_authentication *auth);
|
||||
#endif /* CONFIG_DPP2 */
|
||||
|
||||
static const u8 broadcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
@@ -272,6 +276,75 @@ static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
}
|
||||
|
||||
|
||||
+#ifdef CONFIG_DPP2
|
||||
+static int hostapd_dpp_pkex_done(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *peer_bi)
|
||||
+{
|
||||
+ struct hostapd_data *hapd = ctx;
|
||||
+ const char *cmd = hapd->dpp_pkex_auth_cmd;
|
||||
+ const char *pos;
|
||||
+ u8 allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ struct dpp_bootstrap_info *own_bi = NULL;
|
||||
+ struct dpp_authentication *auth;
|
||||
+
|
||||
+ if (!cmd)
|
||||
+ cmd = "";
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
+ cmd);
|
||||
+
|
||||
+ pos = os_strstr(cmd, " own=");
|
||||
+ if (pos) {
|
||||
+ pos += 5;
|
||||
+ own_bi = dpp_bootstrap_get_id(hapd->iface->interfaces->dpp,
|
||||
+ atoi(pos));
|
||||
+ if (!own_bi) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Could not find bootstrapping info for the identified local entry");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (peer_bi->curve != own_bi->curve) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Mismatching curves in bootstrapping info (peer=%s own=%s)",
|
||||
+ peer_bi->curve->name, own_bi->curve->name);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ pos = os_strstr(cmd, " role=");
|
||||
+ if (pos) {
|
||||
+ pos += 6;
|
||||
+ if (os_strncmp(pos, "configurator", 12) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ else if (os_strncmp(pos, "enrollee", 8) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_ENROLLEE;
|
||||
+ else if (os_strncmp(pos, "either", 6) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR |
|
||||
+ DPP_CAPAB_ENROLLEE;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ auth = dpp_auth_init(hapd->iface->interfaces->dpp, hapd->msg_ctx,
|
||||
+ peer_bi, own_bi, allowed_roles, 0,
|
||||
+ hapd->iface->hw_features,
|
||||
+ hapd->iface->num_hw_features);
|
||||
+ if (!auth)
|
||||
+ return -1;
|
||||
+
|
||||
+ hostapd_dpp_set_testing_options(hapd, auth);
|
||||
+ if (dpp_set_configurator(auth, cmd) < 0) {
|
||||
+ dpp_auth_deinit(auth);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return dpp_tcp_auth(hapd->iface->interfaces->dpp, conn, auth,
|
||||
+ hapd->conf->dpp_name, DPP_NETROLE_AP,
|
||||
+ hostapd_dpp_process_conf_obj);
|
||||
+}
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+
|
||||
+
|
||||
enum hostapd_dpp_pkex_ver {
|
||||
PKEX_VER_AUTO,
|
||||
PKEX_VER_ONLY_1,
|
||||
@@ -279,7 +352,9 @@ enum hostapd_dpp_pkex_ver {
|
||||
};
|
||||
|
||||
static int hostapd_dpp_pkex_init(struct hostapd_data *hapd,
|
||||
- enum hostapd_dpp_pkex_ver ver)
|
||||
+ enum hostapd_dpp_pkex_ver ver,
|
||||
+ const struct hostapd_ip_addr *ipaddr,
|
||||
+ int tcp_port)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
@@ -288,15 +363,26 @@ static int hostapd_dpp_pkex_init(struct hostapd_data *hapd,
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(hapd->dpp_pkex);
|
||||
- hapd->dpp_pkex = dpp_pkex_init(hapd->msg_ctx, hapd->dpp_pkex_bi,
|
||||
- hapd->own_addr,
|
||||
- hapd->dpp_pkex_identifier,
|
||||
- hapd->dpp_pkex_code, v2);
|
||||
- pkex = hapd->dpp_pkex;
|
||||
+ hapd->dpp_pkex = NULL;
|
||||
+ pkex = dpp_pkex_init(hapd->msg_ctx, hapd->dpp_pkex_bi, hapd->own_addr,
|
||||
+ hapd->dpp_pkex_identifier,
|
||||
+ hapd->dpp_pkex_code, v2);
|
||||
if (!pkex)
|
||||
return -1;
|
||||
pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
+ if (ipaddr) {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ return dpp_tcp_pkex_init(hapd->iface->interfaces->dpp, pkex,
|
||||
+ ipaddr, tcp_port,
|
||||
+ hapd->msg_ctx, hapd,
|
||||
+ hostapd_dpp_pkex_done);
|
||||
+#else /* CONFIG_DPP2 */
|
||||
+ return -1;
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+ }
|
||||
+
|
||||
+ hapd->dpp_pkex = pkex;
|
||||
msg = hapd->dpp_pkex->exchange_req;
|
||||
wait_time = 2000; /* TODO: hapd->max_remain_on_chan; */
|
||||
pkex->freq = 2437;
|
||||
@@ -326,7 +412,8 @@ static void hostapd_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- hostapd_dpp_pkex_init(hapd, PKEX_VER_ONLY_1);
|
||||
+ hostapd_dpp_pkex_init(hapd, PKEX_VER_ONLY_1,
|
||||
+ NULL, 0);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -1883,7 +1970,7 @@ static void hostapd_dpp_rx_peer_disc_req(struct hostapd_data *hapd,
|
||||
|
||||
static void
|
||||
hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
- const u8 *buf, size_t len,
|
||||
+ const u8 *hdr, const u8 *buf, size_t len,
|
||||
unsigned int freq, bool v2)
|
||||
{
|
||||
struct wpabuf *msg;
|
||||
@@ -1897,14 +1984,14 @@ hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
if (!hapd->dpp_pkex_code || !hapd->dpp_pkex_bi) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: No PKEX code configured - ignore request");
|
||||
- return;
|
||||
+ goto try_relay;
|
||||
}
|
||||
|
||||
if (hapd->dpp_pkex) {
|
||||
/* TODO: Support parallel operations */
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Already in PKEX session - ignore new request");
|
||||
- return;
|
||||
+ goto try_relay;
|
||||
}
|
||||
|
||||
hapd->dpp_pkex = dpp_pkex_rx_exchange_req(hapd->msg_ctx,
|
||||
@@ -1916,7 +2003,7 @@ hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
if (!hapd->dpp_pkex) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Failed to process the request - ignore it");
|
||||
- return;
|
||||
+ goto try_relay;
|
||||
}
|
||||
|
||||
msg = hapd->dpp_pkex->exchange_resp;
|
||||
@@ -1933,6 +2020,17 @@ hostapd_dpp_rx_pkex_exchange_req(struct hostapd_data *hapd, const u8 *src,
|
||||
dpp_pkex_free(hapd->dpp_pkex);
|
||||
hapd->dpp_pkex = NULL;
|
||||
}
|
||||
+
|
||||
+ return;
|
||||
+
|
||||
+try_relay:
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ if (v2)
|
||||
+ dpp_relay_rx_action(hapd->iface->interfaces->dpp,
|
||||
+ src, hdr, buf, len, freq, NULL, NULL, hapd);
|
||||
+#else /* CONFIG_DPP2 */
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No relay functionality included - skip");
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
}
|
||||
|
||||
|
||||
@@ -2132,12 +2230,12 @@ void hostapd_dpp_rx_action(struct hostapd_data *hapd, const u8 *src,
|
||||
/* This is for PKEXv2, but for now, process only with
|
||||
* CONFIG_DPP3 to avoid issues with a capability that has not
|
||||
* been tested with other implementations. */
|
||||
- hostapd_dpp_rx_pkex_exchange_req(hapd, src, buf, len, freq,
|
||||
+ hostapd_dpp_rx_pkex_exchange_req(hapd, src, hdr, buf, len, freq,
|
||||
true);
|
||||
break;
|
||||
#endif /* CONFIG_DPP3 */
|
||||
case DPP_PA_PKEX_V1_EXCHANGE_REQ:
|
||||
- hostapd_dpp_rx_pkex_exchange_req(hapd, src, buf, len, freq,
|
||||
+ hostapd_dpp_rx_pkex_exchange_req(hapd, src, hdr, buf, len, freq,
|
||||
false);
|
||||
break;
|
||||
case DPP_PA_PKEX_EXCHANGE_RESP:
|
||||
@@ -2303,6 +2401,29 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
{
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
const char *pos, *end;
|
||||
+ int tcp_port = DPP_TCP_PORT;
|
||||
+ struct hostapd_ip_addr *ipaddr = NULL;
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ struct hostapd_ip_addr ipaddr_buf;
|
||||
+ char *addr;
|
||||
+
|
||||
+ pos = os_strstr(cmd, " tcp_port=");
|
||||
+ if (pos) {
|
||||
+ pos += 10;
|
||||
+ tcp_port = atoi(pos);
|
||||
+ }
|
||||
+
|
||||
+ addr = get_param(cmd, " tcp_addr=");
|
||||
+ if (addr) {
|
||||
+ int res;
|
||||
+
|
||||
+ res = hostapd_parse_ip_addr(addr, &ipaddr_buf);
|
||||
+ os_free(addr);
|
||||
+ if (res)
|
||||
+ return -1;
|
||||
+ ipaddr = &ipaddr_buf;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
|
||||
pos = os_strstr(cmd, " own=");
|
||||
if (!pos)
|
||||
@@ -2366,8 +2487,14 @@ int hostapd_dpp_pkex_add(struct hostapd_data *hapd, const char *cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (hostapd_dpp_pkex_init(hapd, ver) < 0)
|
||||
+ if (hostapd_dpp_pkex_init(hapd, ver, ipaddr, tcp_port) < 0)
|
||||
return -1;
|
||||
+ } else {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ dpp_controller_pkex_add(hapd->iface->interfaces->dpp, own_bi,
|
||||
+ hapd->dpp_pkex_code,
|
||||
+ hapd->dpp_pkex_identifier);
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
diff --git a/src/common/dpp.h b/src/common/dpp.h
|
||||
index bfea446..ca33fe3 100644
|
||||
--- a/src/common/dpp.h
|
||||
+++ b/src/common/dpp.h
|
||||
@@ -550,6 +550,9 @@ int dpp_auth_conf_rx(struct dpp_authentication *auth, const u8 *hdr,
|
||||
const u8 *attr_start, size_t attr_len);
|
||||
int dpp_notify_new_qr_code(struct dpp_authentication *auth,
|
||||
struct dpp_bootstrap_info *peer_bi);
|
||||
+void dpp_controller_pkex_add(struct dpp_global *dpp,
|
||||
+ struct dpp_bootstrap_info *bi,
|
||||
+ const char *code, const char *identifier);
|
||||
struct dpp_configuration * dpp_configuration_alloc(const char *type);
|
||||
int dpp_akm_psk(enum dpp_akm akm);
|
||||
int dpp_akm_sae(enum dpp_akm akm);
|
||||
@@ -688,12 +691,22 @@ struct dpp_authentication * dpp_controller_get_auth(struct dpp_global *dpp,
|
||||
unsigned int id);
|
||||
void dpp_controller_new_qr_code(struct dpp_global *dpp,
|
||||
struct dpp_bootstrap_info *bi);
|
||||
+int dpp_tcp_pkex_init(struct dpp_global *dpp, struct dpp_pkex *pkex,
|
||||
+ const struct hostapd_ip_addr *addr, int port,
|
||||
+ void *msg_ctx, void *cb_ctx,
|
||||
+ int (*pkex_done)(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *bi));
|
||||
int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
const struct hostapd_ip_addr *addr, int port,
|
||||
const char *name, enum dpp_netrole netrole, void *msg_ctx,
|
||||
void *cb_ctx,
|
||||
int (*process_conf_obj)(void *ctx,
|
||||
struct dpp_authentication *auth));
|
||||
+int dpp_tcp_auth(struct dpp_global *dpp, void *_conn,
|
||||
+ struct dpp_authentication *auth, const char *name,
|
||||
+ enum dpp_netrole netrole,
|
||||
+ int (*process_conf_obj)(void *ctx,
|
||||
+ struct dpp_authentication *auth));
|
||||
|
||||
struct wpabuf * dpp_build_presence_announcement(struct dpp_bootstrap_info *bi);
|
||||
void dpp_notify_chirp_received(void *msg_ctx, int id, const u8 *src,
|
||||
diff --git a/src/common/dpp_pkex.c b/src/common/dpp_pkex.c
|
||||
index 38349fa..72084d9 100644
|
||||
--- a/src/common/dpp_pkex.c
|
||||
+++ b/src/common/dpp_pkex.c
|
||||
@@ -469,8 +469,10 @@ struct dpp_pkex * dpp_pkex_rx_exchange_req(void *msg_ctx,
|
||||
pkex->t = bi->pkex_t;
|
||||
pkex->msg_ctx = msg_ctx;
|
||||
pkex->own_bi = bi;
|
||||
- os_memcpy(pkex->own_mac, own_mac, ETH_ALEN);
|
||||
- os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
+ if (own_mac)
|
||||
+ os_memcpy(pkex->own_mac, own_mac, ETH_ALEN);
|
||||
+ if (peer_mac)
|
||||
+ os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
if (identifier) {
|
||||
pkex->identifier = os_strdup(identifier);
|
||||
if (!pkex->identifier)
|
||||
@@ -742,7 +744,8 @@ struct wpabuf * dpp_pkex_rx_exchange_resp(struct dpp_pkex *pkex,
|
||||
}
|
||||
#endif /* CONFIG_DPP2 */
|
||||
|
||||
- os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
+ if (peer_mac)
|
||||
+ os_memcpy(pkex->peer_mac, peer_mac, ETH_ALEN);
|
||||
|
||||
attr_status = dpp_get_attr(buf, buflen, DPP_ATTR_STATUS,
|
||||
&attr_status_len);
|
||||
@@ -1341,9 +1344,12 @@ dpp_pkex_finish(struct dpp_global *dpp, struct dpp_pkex *pkex, const u8 *peer,
|
||||
return NULL;
|
||||
bi->id = dpp_next_id(dpp);
|
||||
bi->type = DPP_BOOTSTRAP_PKEX;
|
||||
- os_memcpy(bi->mac_addr, peer, ETH_ALEN);
|
||||
- bi->num_freq = 1;
|
||||
- bi->freq[0] = freq;
|
||||
+ if (peer)
|
||||
+ os_memcpy(bi->mac_addr, peer, ETH_ALEN);
|
||||
+ if (freq) {
|
||||
+ bi->num_freq = 1;
|
||||
+ bi->freq[0] = freq;
|
||||
+ }
|
||||
bi->curve = pkex->own_bi->curve;
|
||||
bi->pubkey = pkex->peer_bootstrap_key;
|
||||
pkex->peer_bootstrap_key = NULL;
|
||||
diff --git a/src/common/dpp_tcp.c b/src/common/dpp_tcp.c
|
||||
index fb8ef1c..1a8a7c7 100644
|
||||
--- a/src/common/dpp_tcp.c
|
||||
+++ b/src/common/dpp_tcp.c
|
||||
@@ -24,10 +24,12 @@ struct dpp_connection {
|
||||
struct dpp_controller *ctrl;
|
||||
struct dpp_relay_controller *relay;
|
||||
struct dpp_global *global;
|
||||
+ struct dpp_pkex *pkex;
|
||||
struct dpp_authentication *auth;
|
||||
void *msg_ctx;
|
||||
void *cb_ctx;
|
||||
int (*process_conf_obj)(void *ctx, struct dpp_authentication *auth);
|
||||
+ int (*pkex_done)(void *ctx, void *conn, struct dpp_bootstrap_info *bi);
|
||||
int sock;
|
||||
u8 mac_addr[ETH_ALEN];
|
||||
unsigned int freq;
|
||||
@@ -71,6 +73,9 @@ struct dpp_controller {
|
||||
struct dl_list conn; /* struct dpp_connection */
|
||||
char *configurator_params;
|
||||
enum dpp_netrole netrole;
|
||||
+ struct dpp_bootstrap_info *pkex_bi;
|
||||
+ char *pkex_code;
|
||||
+ char *pkex_identifier;
|
||||
void *msg_ctx;
|
||||
void *cb_ctx;
|
||||
int (*process_conf_obj)(void *ctx, struct dpp_authentication *auth);
|
||||
@@ -102,6 +107,7 @@ static void dpp_connection_free(struct dpp_connection *conn)
|
||||
wpabuf_free(conn->msg);
|
||||
wpabuf_free(conn->msg_out);
|
||||
dpp_auth_deinit(conn->auth);
|
||||
+ dpp_pkex_free(conn->pkex);
|
||||
os_free(conn->name);
|
||||
os_free(conn);
|
||||
}
|
||||
@@ -525,6 +531,8 @@ int dpp_relay_rx_action(struct dpp_global *dpp, const u8 *src, const u8 *hdr,
|
||||
/* TODO: Could send this to all configured Controllers. For now,
|
||||
* only the first Controller is supported. */
|
||||
ctrl = dpp_relay_controller_get_ctx(dpp, cb_ctx);
|
||||
+ } else if (type == DPP_PA_PKEX_EXCHANGE_REQ) {
|
||||
+ ctrl = dpp_relay_controller_get_ctx(dpp, cb_ctx);
|
||||
} else {
|
||||
if (!r_bootstrap)
|
||||
return -1;
|
||||
@@ -609,6 +617,8 @@ static void dpp_controller_free(struct dpp_controller *ctrl)
|
||||
eloop_unregister_sock(ctrl->sock, EVENT_TYPE_READ);
|
||||
}
|
||||
os_free(ctrl->configurator_params);
|
||||
+ os_free(ctrl->pkex_code);
|
||||
+ os_free(ctrl->pkex_identifier);
|
||||
os_free(ctrl);
|
||||
}
|
||||
|
||||
@@ -955,6 +965,143 @@ static int dpp_controller_rx_reconfig_auth_resp(struct dpp_connection *conn,
|
||||
}
|
||||
|
||||
|
||||
+static int dpp_controller_rx_pkex_exchange_req(struct dpp_connection *conn,
|
||||
+ const u8 *hdr, const u8 *buf,
|
||||
+ size_t len)
|
||||
+{
|
||||
+ struct dpp_controller *ctrl = conn->ctrl;
|
||||
+
|
||||
+ if (!ctrl)
|
||||
+ return 0;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Exchange Request");
|
||||
+
|
||||
+ /* TODO: Support multiple PKEX codes by iterating over all the enabled
|
||||
+ * values here */
|
||||
+
|
||||
+ if (!ctrl->pkex_code || !ctrl->pkex_bi) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: No PKEX code configured - ignore request");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (conn->pkex || conn->auth) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Already in PKEX/Authentication session - ignore new PKEX request");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ conn->pkex = dpp_pkex_rx_exchange_req(conn->ctrl->global, ctrl->pkex_bi,
|
||||
+ NULL, NULL,
|
||||
+ ctrl->pkex_identifier,
|
||||
+ ctrl->pkex_code,
|
||||
+ buf, len, true);
|
||||
+ if (!conn->pkex) {
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Failed to process the request");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return dpp_tcp_send_msg(conn, conn->pkex->exchange_resp);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int dpp_controller_rx_pkex_exchange_resp(struct dpp_connection *conn,
|
||||
+ const u8 *hdr, const u8 *buf,
|
||||
+ size_t len)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = conn->pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ int res;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Exchange Response");
|
||||
+
|
||||
+ if (!pkex || !pkex->initiator || pkex->exchange_done) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No matching PKEX session");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ msg = dpp_pkex_rx_exchange_resp(pkex, NULL, buf, len);
|
||||
+ if (!msg) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to process the response");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Send PKEX Commit-Reveal Request");
|
||||
+ res = dpp_tcp_send_msg(conn, msg);
|
||||
+ wpabuf_free(msg);
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int dpp_controller_rx_pkex_commit_reveal_req(struct dpp_connection *conn,
|
||||
+ const u8 *hdr,
|
||||
+ const u8 *buf, size_t len)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = conn->pkex;
|
||||
+ struct wpabuf *msg;
|
||||
+ int res;
|
||||
+ struct dpp_bootstrap_info *bi;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Commit-Reveal Request");
|
||||
+
|
||||
+ if (!pkex || pkex->initiator || !pkex->exchange_done) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No matching PKEX session");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ msg = dpp_pkex_rx_commit_reveal_req(pkex, hdr, buf, len);
|
||||
+ if (!msg) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to process the request");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Send PKEX Commit-Reveal Response");
|
||||
+ res = dpp_tcp_send_msg(conn, msg);
|
||||
+ wpabuf_free(msg);
|
||||
+ if (res < 0)
|
||||
+ return res;
|
||||
+ bi = dpp_pkex_finish(conn->global, pkex, NULL, 0);
|
||||
+ if (!bi)
|
||||
+ return -1;
|
||||
+ conn->pkex = NULL;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int
|
||||
+dpp_controller_rx_pkex_commit_reveal_resp(struct dpp_connection *conn,
|
||||
+ const u8 *hdr,
|
||||
+ const u8 *buf, size_t len)
|
||||
+{
|
||||
+ struct dpp_pkex *pkex = conn->pkex;
|
||||
+ int res;
|
||||
+ struct dpp_bootstrap_info *bi;
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: PKEX Commit-Reveal Response");
|
||||
+
|
||||
+ if (!pkex || !pkex->initiator || !pkex->exchange_done) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: No matching PKEX session");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ res = dpp_pkex_rx_commit_reveal_resp(pkex, hdr, buf, len);
|
||||
+ if (res < 0) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to process the response");
|
||||
+ return res;
|
||||
+ }
|
||||
+
|
||||
+ bi = dpp_pkex_finish(conn->global, pkex, NULL, 0);
|
||||
+ if (!bi)
|
||||
+ return -1;
|
||||
+ conn->pkex = NULL;
|
||||
+
|
||||
+ if (!conn->pkex_done)
|
||||
+ return -1;
|
||||
+ return conn->pkex_done(conn->cb_ctx, conn, bi);
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int dpp_controller_rx_action(struct dpp_connection *conn, const u8 *msg,
|
||||
size_t len)
|
||||
{
|
||||
@@ -1014,6 +1161,22 @@ static int dpp_controller_rx_action(struct dpp_connection *conn, const u8 *msg,
|
||||
case DPP_PA_RECONFIG_AUTH_RESP:
|
||||
return dpp_controller_rx_reconfig_auth_resp(conn, msg, pos,
|
||||
end - pos);
|
||||
+ case DPP_PA_PKEX_V1_EXCHANGE_REQ:
|
||||
+ wpa_printf(MSG_DEBUG,
|
||||
+ "DPP: Ignore PKEXv1 Exchange Request - not supported over TCP");
|
||||
+ return -1;
|
||||
+ case DPP_PA_PKEX_EXCHANGE_REQ:
|
||||
+ return dpp_controller_rx_pkex_exchange_req(conn, msg, pos,
|
||||
+ end - pos);
|
||||
+ case DPP_PA_PKEX_EXCHANGE_RESP:
|
||||
+ return dpp_controller_rx_pkex_exchange_resp(conn, msg, pos,
|
||||
+ end - pos);
|
||||
+ case DPP_PA_PKEX_COMMIT_REVEAL_REQ:
|
||||
+ return dpp_controller_rx_pkex_commit_reveal_req(conn, msg, pos,
|
||||
+ end - pos);
|
||||
+ case DPP_PA_PKEX_COMMIT_REVEAL_RESP:
|
||||
+ return dpp_controller_rx_pkex_commit_reveal_resp(conn, msg, pos,
|
||||
+ end - pos);
|
||||
default:
|
||||
/* TODO: missing messages types */
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@@ -1559,6 +1722,101 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
+int dpp_tcp_pkex_init(struct dpp_global *dpp, struct dpp_pkex *pkex,
|
||||
+ const struct hostapd_ip_addr *addr, int port,
|
||||
+ void *msg_ctx, void *cb_ctx,
|
||||
+ int (*pkex_done)(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *bi))
|
||||
+{
|
||||
+ struct dpp_connection *conn;
|
||||
+ struct sockaddr_storage saddr;
|
||||
+ socklen_t addrlen;
|
||||
+ const u8 *hdr, *pos, *end;
|
||||
+ char txt[100];
|
||||
+
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Initialize TCP connection to %s port %d",
|
||||
+ hostapd_ip_txt(addr, txt, sizeof(txt)), port);
|
||||
+ if (dpp_ipaddr_to_sockaddr((struct sockaddr *) &saddr, &addrlen,
|
||||
+ addr, port) < 0) {
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ conn = os_zalloc(sizeof(*conn));
|
||||
+ if (!conn) {
|
||||
+ dpp_pkex_free(pkex);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ conn->msg_ctx = msg_ctx;
|
||||
+ conn->cb_ctx = cb_ctx;
|
||||
+ conn->pkex_done = pkex_done;
|
||||
+ conn->global = dpp;
|
||||
+ conn->pkex = pkex;
|
||||
+ conn->sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
+ if (conn->sock < 0)
|
||||
+ goto fail;
|
||||
+
|
||||
+ if (fcntl(conn->sock, F_SETFL, O_NONBLOCK) != 0) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: fnctl(O_NONBLOCK) failed: %s",
|
||||
+ strerror(errno));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ if (connect(conn->sock, (struct sockaddr *) &saddr, addrlen) < 0) {
|
||||
+ if (errno != EINPROGRESS) {
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Failed to connect: %s",
|
||||
+ strerror(errno));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Continue connecting in the background; eloop will call us
|
||||
+ * once the connection is ready (or failed).
|
||||
+ */
|
||||
+ }
|
||||
+
|
||||
+ if (eloop_register_sock(conn->sock, EVENT_TYPE_WRITE,
|
||||
+ dpp_conn_tx_ready, conn, NULL) < 0)
|
||||
+ goto fail;
|
||||
+ conn->write_eloop = 1;
|
||||
+
|
||||
+ hdr = wpabuf_head(pkex->exchange_req);
|
||||
+ end = hdr + wpabuf_len(pkex->exchange_req);
|
||||
+ hdr += 2; /* skip Category and Actiom */
|
||||
+ pos = hdr + DPP_HDR_LEN;
|
||||
+ conn->msg_out = dpp_tcp_encaps(hdr, pos, end - pos);
|
||||
+ if (!conn->msg_out)
|
||||
+ goto fail;
|
||||
+ /* Message will be sent in dpp_conn_tx_ready() */
|
||||
+
|
||||
+ /* TODO: eloop timeout to clear a connection if it does not complete
|
||||
+ * properly */
|
||||
+ dl_list_add(&dpp->tcp_init, &conn->list);
|
||||
+ return 0;
|
||||
+fail:
|
||||
+ dpp_connection_free(conn);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int dpp_tcp_auth_start(struct dpp_connection *conn,
|
||||
+ struct dpp_authentication *auth)
|
||||
+{
|
||||
+ const u8 *hdr, *pos, *end;
|
||||
+
|
||||
+ hdr = wpabuf_head(auth->req_msg);
|
||||
+ end = hdr + wpabuf_len(auth->req_msg);
|
||||
+ hdr += 2; /* skip Category and Actiom */
|
||||
+ pos = hdr + DPP_HDR_LEN;
|
||||
+ conn->msg_out = dpp_tcp_encaps(hdr, pos, end - pos);
|
||||
+ if (!conn->msg_out)
|
||||
+ return -1;
|
||||
+ /* Message will be sent in dpp_conn_tx_ready() */
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
const struct hostapd_ip_addr *addr, int port, const char *name,
|
||||
enum dpp_netrole netrole, void *msg_ctx, void *cb_ctx,
|
||||
@@ -1568,7 +1826,6 @@ int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
struct dpp_connection *conn;
|
||||
struct sockaddr_storage saddr;
|
||||
socklen_t addrlen;
|
||||
- const u8 *hdr, *pos, *end;
|
||||
char txt[100];
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initialize TCP connection to %s port %d",
|
||||
@@ -1620,14 +1877,8 @@ int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
|
||||
goto fail;
|
||||
conn->write_eloop = 1;
|
||||
|
||||
- hdr = wpabuf_head(auth->req_msg);
|
||||
- end = hdr + wpabuf_len(auth->req_msg);
|
||||
- hdr += 2; /* skip Category and Actiom */
|
||||
- pos = hdr + DPP_HDR_LEN;
|
||||
- conn->msg_out = dpp_tcp_encaps(hdr, pos, end - pos);
|
||||
- if (!conn->msg_out)
|
||||
+ if (dpp_tcp_auth_start(conn, auth) < 0)
|
||||
goto fail;
|
||||
- /* Message will be sent in dpp_conn_tx_ready() */
|
||||
|
||||
/* TODO: eloop timeout to clear a connection if it does not complete
|
||||
* properly */
|
||||
@@ -1639,6 +1890,30 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
+int dpp_tcp_auth(struct dpp_global *dpp, void *_conn,
|
||||
+ struct dpp_authentication *auth, const char *name,
|
||||
+ enum dpp_netrole netrole,
|
||||
+ int (*process_conf_obj)(void *ctx,
|
||||
+ struct dpp_authentication *auth))
|
||||
+{
|
||||
+ struct dpp_connection *conn = _conn;
|
||||
+
|
||||
+ /* Continue with Authentication exchange on an existing TCP connection.
|
||||
+ */
|
||||
+ conn->process_conf_obj = process_conf_obj;
|
||||
+ os_free(conn->name);
|
||||
+ conn->name = os_strdup(name ? name : "Test");
|
||||
+ conn->netrole = netrole;
|
||||
+ conn->auth = auth;
|
||||
+
|
||||
+ if (dpp_tcp_auth_start(conn, auth) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ dpp_conn_tx_ready(conn->sock, conn, NULL);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
int dpp_controller_start(struct dpp_global *dpp,
|
||||
struct dpp_controller_config *config)
|
||||
{
|
||||
@@ -1789,6 +2064,23 @@ void dpp_controller_new_qr_code(struct dpp_global *dpp,
|
||||
}
|
||||
|
||||
|
||||
+void dpp_controller_pkex_add(struct dpp_global *dpp,
|
||||
+ struct dpp_bootstrap_info *bi,
|
||||
+ const char *code, const char *identifier)
|
||||
+{
|
||||
+ struct dpp_controller *ctrl = dpp->controller;
|
||||
+
|
||||
+ if (!ctrl)
|
||||
+ return;
|
||||
+
|
||||
+ ctrl->pkex_bi = bi;
|
||||
+ os_free(ctrl->pkex_code);
|
||||
+ ctrl->pkex_code = code ? os_strdup(code) : NULL;
|
||||
+ os_free(ctrl->pkex_identifier);
|
||||
+ ctrl->pkex_identifier = identifier ? os_strdup(identifier) : NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
void dpp_tcp_init_flush(struct dpp_global *dpp)
|
||||
{
|
||||
struct dpp_connection *conn, *tmp;
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index 61b300f..aab94cb 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,6 +2557,71 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
+#ifdef CONFIG_DPP2
|
||||
+static int wpas_dpp_pkex_done(void *ctx, void *conn,
|
||||
+ struct dpp_bootstrap_info *peer_bi)
|
||||
+{
|
||||
+ struct wpa_supplicant *wpa_s = ctx;
|
||||
+ const char *cmd = wpa_s->dpp_pkex_auth_cmd;
|
||||
+ const char *pos;
|
||||
+ u8 allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ struct dpp_bootstrap_info *own_bi = NULL;
|
||||
+ struct dpp_authentication *auth;
|
||||
+
|
||||
+ if (!cmd)
|
||||
+ cmd = "";
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
+ cmd);
|
||||
+
|
||||
+ pos = os_strstr(cmd, " own=");
|
||||
+ if (pos) {
|
||||
+ pos += 5;
|
||||
+ own_bi = dpp_bootstrap_get_id(wpa_s->dpp, atoi(pos));
|
||||
+ if (!own_bi) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Could not find bootstrapping info for the identified local entry");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (peer_bi->curve != own_bi->curve) {
|
||||
+ wpa_printf(MSG_INFO,
|
||||
+ "DPP: Mismatching curves in bootstrapping info (peer=%s own=%s)",
|
||||
+ peer_bi->curve->name, own_bi->curve->name);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ pos = os_strstr(cmd, " role=");
|
||||
+ if (pos) {
|
||||
+ pos += 6;
|
||||
+ if (os_strncmp(pos, "configurator", 12) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR;
|
||||
+ else if (os_strncmp(pos, "enrollee", 8) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_ENROLLEE;
|
||||
+ else if (os_strncmp(pos, "either", 6) == 0)
|
||||
+ allowed_roles = DPP_CAPAB_CONFIGURATOR |
|
||||
+ DPP_CAPAB_ENROLLEE;
|
||||
+ else
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ auth = dpp_auth_init(wpa_s->dpp, wpa_s, peer_bi, own_bi, allowed_roles,
|
||||
+ 0, wpa_s->hw.modes, wpa_s->hw.num_modes);
|
||||
+ if (!auth)
|
||||
+ return -1;
|
||||
+
|
||||
+ wpas_dpp_set_testing_options(wpa_s, auth);
|
||||
+ if (dpp_set_configurator(auth, cmd) < 0) {
|
||||
+ dpp_auth_deinit(auth);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return dpp_tcp_auth(wpa_s->dpp, conn, auth, wpa_s->conf->dpp_name,
|
||||
+ DPP_NETROLE_STA, wpas_dpp_process_conf_obj);
|
||||
+}
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+
|
||||
+
|
||||
enum wpas_dpp_pkex_ver {
|
||||
PKEX_VER_AUTO,
|
||||
PKEX_VER_ONLY_1,
|
||||
@@ -2564,7 +2629,9 @@ enum wpas_dpp_pkex_ver {
|
||||
};
|
||||
|
||||
static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s,
|
||||
- enum wpas_dpp_pkex_ver ver)
|
||||
+ enum wpas_dpp_pkex_ver ver,
|
||||
+ const struct hostapd_ip_addr *ipaddr,
|
||||
+ int tcp_port)
|
||||
{
|
||||
struct dpp_pkex *pkex;
|
||||
struct wpabuf *msg;
|
||||
@@ -2573,15 +2640,24 @@ static int wpas_dpp_pkex_init(struct wpa_supplicant *wpa_s,
|
||||
|
||||
wpa_printf(MSG_DEBUG, "DPP: Initiating PKEXv%d", v2 ? 2 : 1);
|
||||
dpp_pkex_free(wpa_s->dpp_pkex);
|
||||
- wpa_s->dpp_pkex = dpp_pkex_init(wpa_s, wpa_s->dpp_pkex_bi,
|
||||
- wpa_s->own_addr,
|
||||
- wpa_s->dpp_pkex_identifier,
|
||||
- wpa_s->dpp_pkex_code, v2);
|
||||
- pkex = wpa_s->dpp_pkex;
|
||||
+ wpa_s->dpp_pkex = NULL;
|
||||
+ pkex = dpp_pkex_init(wpa_s, wpa_s->dpp_pkex_bi, wpa_s->own_addr,
|
||||
+ wpa_s->dpp_pkex_identifier,
|
||||
+ wpa_s->dpp_pkex_code, v2);
|
||||
if (!pkex)
|
||||
return -1;
|
||||
pkex->forced_ver = ver != PKEX_VER_AUTO;
|
||||
|
||||
+ if (ipaddr) {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ return dpp_tcp_pkex_init(wpa_s->dpp, pkex, ipaddr, tcp_port,
|
||||
+ wpa_s, wpa_s, wpas_dpp_pkex_done);
|
||||
+#else /* CONFIG_DPP2 */
|
||||
+ return -1;
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
+ }
|
||||
+
|
||||
+ wpa_s->dpp_pkex = pkex;
|
||||
msg = pkex->exchange_req;
|
||||
wait_time = wpa_s->max_remain_on_chan;
|
||||
if (wait_time > 2000)
|
||||
@@ -2618,7 +2694,8 @@ static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||
if (pkex->v2 && !pkex->forced_ver) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"DPP: Fall back to PKEXv1");
|
||||
- wpas_dpp_pkex_init(wpa_s, PKEX_VER_ONLY_1);
|
||||
+ wpas_dpp_pkex_init(wpa_s, PKEX_VER_ONLY_1,
|
||||
+ NULL, 0);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_DPP3 */
|
||||
@@ -3327,6 +3404,29 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
{
|
||||
struct dpp_bootstrap_info *own_bi;
|
||||
const char *pos, *end;
|
||||
+ int tcp_port = DPP_TCP_PORT;
|
||||
+ struct hostapd_ip_addr *ipaddr = NULL;
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ struct hostapd_ip_addr ipaddr_buf;
|
||||
+ char *addr;
|
||||
+
|
||||
+ pos = os_strstr(cmd, " tcp_port=");
|
||||
+ if (pos) {
|
||||
+ pos += 10;
|
||||
+ tcp_port = atoi(pos);
|
||||
+ }
|
||||
+
|
||||
+ addr = get_param(cmd, " tcp_addr=");
|
||||
+ if (addr) {
|
||||
+ int res;
|
||||
+
|
||||
+ res = hostapd_parse_ip_addr(addr, &ipaddr_buf);
|
||||
+ os_free(addr);
|
||||
+ if (res)
|
||||
+ return -1;
|
||||
+ ipaddr = &ipaddr_buf;
|
||||
+ }
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
|
||||
pos = os_strstr(cmd, " own=");
|
||||
if (!pos)
|
||||
@@ -3390,8 +3490,14 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (wpas_dpp_pkex_init(wpa_s, ver) < 0)
|
||||
+ if (wpas_dpp_pkex_init(wpa_s, ver, ipaddr, tcp_port) < 0)
|
||||
return -1;
|
||||
+ } else {
|
||||
+#ifdef CONFIG_DPP2
|
||||
+ dpp_controller_pkex_add(wpa_s->dpp, own_bi,
|
||||
+ wpa_s->dpp_pkex_code,
|
||||
+ wpa_s->dpp_pkex_identifier);
|
||||
+#endif /* CONFIG_DPP2 */
|
||||
}
|
||||
|
||||
/* TODO: Support multiple PKEX info entries */
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
From 15af83cf1846870873a011ed4d714732f01cd2e4 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
Date: Tue, 19 Jul 2022 21:23:04 +0300
|
||||
Subject: [PATCH] DPP: Delete PKEX code and identifier on success completion of
|
||||
PKEX
|
||||
|
||||
We are not supposed to reuse these without being explicitly requested to
|
||||
perform PKEX again. There is not a strong use case for being able to
|
||||
provision an Enrollee multiple times with PKEX, so this should have no
|
||||
issues on the Enrollee. For a Configurator, there might be some use
|
||||
cases that would benefit from being able to use the same code with
|
||||
multiple Enrollee devices, e.g., for guess access with a laptop and a
|
||||
smart phone. That case will now require a new DPP_PKEX_ADD command on
|
||||
the Configurator after each completion of the provisioning exchange.
|
||||
|
||||
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
|
||||
|
||||
CVE: CVE-2022-37660
|
||||
|
||||
Upstream-Status: Backport [https://git.w1.fi/cgit/hostap/commit/?id=15af83cf1846870873a011ed4d714732f01cd2e4]
|
||||
|
||||
Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
|
||||
---
|
||||
src/ap/dpp_hostapd.c | 22 +++++++++++++++++++++-
|
||||
wpa_supplicant/dpp_supplicant.c | 21 ++++++++++++++++++++-
|
||||
2 files changed, 41 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
|
||||
index d956be9..73b09ba 100644
|
||||
--- a/src/ap/dpp_hostapd.c
|
||||
+++ b/src/ap/dpp_hostapd.c
|
||||
@@ -276,6 +276,22 @@ static int hostapd_dpp_pkex_next_channel(struct hostapd_data *hapd,
|
||||
}
|
||||
|
||||
|
||||
+static void hostapd_dpp_pkex_clear_code(struct hostapd_data *hapd)
|
||||
+{
|
||||
+ if (!hapd->dpp_pkex_code && !hapd->dpp_pkex_identifier)
|
||||
+ return;
|
||||
+
|
||||
+ /* Delete PKEX code and identifier on successful completion of
|
||||
+ * PKEX. We are not supposed to reuse these without being
|
||||
+ * explicitly requested to perform PKEX again. */
|
||||
+ wpa_printf(MSG_DEBUG, "DPP: Delete PKEX code/identifier");
|
||||
+ os_free(hapd->dpp_pkex_code);
|
||||
+ hapd->dpp_pkex_code = NULL;
|
||||
+ os_free(hapd->dpp_pkex_identifier);
|
||||
+ hapd->dpp_pkex_identifier = NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
#ifdef CONFIG_DPP2
|
||||
static int hostapd_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *peer_bi)
|
||||
@@ -287,6 +303,8 @@ static int hostapd_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *own_bi = NULL;
|
||||
struct dpp_authentication *auth;
|
||||
|
||||
+ hostapd_dpp_pkex_clear_code(hapd);
|
||||
+
|
||||
if (!cmd)
|
||||
cmd = "";
|
||||
wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
@@ -2114,6 +2132,7 @@ hostapd_dpp_rx_pkex_commit_reveal_req(struct hostapd_data *hapd, const u8 *src,
|
||||
wpabuf_head(msg), wpabuf_len(msg));
|
||||
wpabuf_free(msg);
|
||||
|
||||
+ hostapd_dpp_pkex_clear_code(hapd);
|
||||
bi = dpp_pkex_finish(hapd->iface->interfaces->dpp, pkex, src, freq);
|
||||
if (!bi)
|
||||
return;
|
||||
@@ -2145,6 +2164,7 @@ hostapd_dpp_rx_pkex_commit_reveal_resp(struct hostapd_data *hapd, const u8 *src,
|
||||
return;
|
||||
}
|
||||
|
||||
+ hostapd_dpp_pkex_clear_code(hapd);
|
||||
bi = dpp_pkex_finish(hapd->iface->interfaces->dpp, pkex, src, freq);
|
||||
if (!bi)
|
||||
return;
|
||||
@@ -2518,7 +2538,7 @@ int hostapd_dpp_pkex_remove(struct hostapd_data *hapd, const char *id)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((id_val != 0 && id_val != 1) || !hapd->dpp_pkex_code)
|
||||
+ if ((id_val != 0 && id_val != 1))
|
||||
return -1;
|
||||
|
||||
/* TODO: Support multiple PKEX entries */
|
||||
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
|
||||
index aab94cb..015ae66 100644
|
||||
--- a/wpa_supplicant/dpp_supplicant.c
|
||||
+++ b/wpa_supplicant/dpp_supplicant.c
|
||||
@@ -2557,6 +2557,22 @@ static int wpas_dpp_pkex_next_channel(struct wpa_supplicant *wpa_s,
|
||||
}
|
||||
|
||||
|
||||
+static void wpas_dpp_pkex_clear_code(struct wpa_supplicant *wpa_s)
|
||||
+{
|
||||
+ if (!wpa_s->dpp_pkex_code && !wpa_s->dpp_pkex_identifier)
|
||||
+ return;
|
||||
+
|
||||
+ /* Delete PKEX code and identifier on successful completion of
|
||||
+ * PKEX. We are not supposed to reuse these without being
|
||||
+ * explicitly requested to perform PKEX again. */
|
||||
+ os_free(wpa_s->dpp_pkex_code);
|
||||
+ wpa_s->dpp_pkex_code = NULL;
|
||||
+ os_free(wpa_s->dpp_pkex_identifier);
|
||||
+ wpa_s->dpp_pkex_identifier = NULL;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+
|
||||
#ifdef CONFIG_DPP2
|
||||
static int wpas_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *peer_bi)
|
||||
@@ -2568,6 +2584,8 @@ static int wpas_dpp_pkex_done(void *ctx, void *conn,
|
||||
struct dpp_bootstrap_info *own_bi = NULL;
|
||||
struct dpp_authentication *auth;
|
||||
|
||||
+ wpas_dpp_pkex_clear_code(wpa_s);
|
||||
+
|
||||
if (!cmd)
|
||||
cmd = "";
|
||||
wpa_printf(MSG_DEBUG, "DPP: Start authentication after PKEX (cmd: %s)",
|
||||
@@ -2872,6 +2890,7 @@ wpas_dpp_pkex_finish(struct wpa_supplicant *wpa_s, const u8 *peer,
|
||||
{
|
||||
struct dpp_bootstrap_info *bi;
|
||||
|
||||
+ wpas_dpp_pkex_clear_code(wpa_s);
|
||||
bi = dpp_pkex_finish(wpa_s->dpp, wpa_s->dpp_pkex, peer, freq);
|
||||
if (!bi)
|
||||
return NULL;
|
||||
@@ -3521,7 +3540,7 @@ int wpas_dpp_pkex_remove(struct wpa_supplicant *wpa_s, const char *id)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((id_val != 0 && id_val != 1) || !wpa_s->dpp_pkex_code)
|
||||
+ if ((id_val != 0 && id_val != 1))
|
||||
return -1;
|
||||
|
||||
/* TODO: Support multiple PKEX entries */
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -38,6 +38,11 @@ SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
|
||||
file://0001-SAE-Check-for-invalid-Rejected-Groups-element-length.patch \
|
||||
file://0002-SAE-Check-for-invalid-Rejected-Groups-element-length.patch \
|
||||
file://0003-SAE-Reject-invalid-Rejected-Groups-element-in-the-pa.patch \
|
||||
file://CVE-2022-37660-0001.patch \
|
||||
file://CVE-2022-37660-0002.patch \
|
||||
file://CVE-2022-37660-0003.patch \
|
||||
file://CVE-2022-37660-0004.patch \
|
||||
file://CVE-2022-37660-0005.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f"
|
||||
|
||||
|
||||
40
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch
Normal file
40
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 285db475ecaa4d2cc39ce326b4c63aacb87ca6ad Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Tue, 22 Aug 2023 19:57:48 +0200
|
||||
Subject: [PATCH] glib/gfileutils.c: use 64 bits for value in get_tmp_file()
|
||||
|
||||
On 32 bit systems 'long' value will overflow in 2038 and become negative.
|
||||
As it is used to index into letters array, and % operation preserves signs,
|
||||
data corruption will then occur.
|
||||
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
|
||||
CVE: CVE-2025-7039
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/285db475ecaa4d2cc39ce326b4c63aacb87ca6ad]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
glib/gfileutils.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
|
||||
index 9646c696e..bd3cc179a 100644
|
||||
--- a/glib/gfileutils.c
|
||||
+++ b/glib/gfileutils.c
|
||||
@@ -1475,7 +1475,7 @@ get_tmp_file (gchar *tmpl,
|
||||
static const char letters[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
static const int NLETTERS = sizeof (letters) - 1;
|
||||
- glong value;
|
||||
+ gint64 value;
|
||||
gint64 now_us;
|
||||
static int counter = 0;
|
||||
|
||||
@@ -1496,7 +1496,7 @@ get_tmp_file (gchar *tmpl,
|
||||
|
||||
for (count = 0; count < 100; value += 7777, ++count)
|
||||
{
|
||||
- glong v = value;
|
||||
+ gint64 v = value;
|
||||
|
||||
/* Fill in the random bits. */
|
||||
XXXXXX[0] = letters[v % NLETTERS];
|
||||
43
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch
Normal file
43
meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
From 61e963284889ddb4544e6f1d5261c16120f6fcc3 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Catanzaro <mcatanzaro@redhat.com>
|
||||
Date: Tue, 1 Jul 2025 10:58:07 -0500
|
||||
Subject: [PATCH] gfileutils: fix computation of temporary file name
|
||||
|
||||
We need to ensure that the value we use to index into the letters array
|
||||
is always positive.
|
||||
|
||||
Fixes #3716
|
||||
|
||||
CVE: CVE-2025-7039
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/61e963284889ddb4544e6f1d5261c16120f6fcc3]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
glib/gfileutils.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
|
||||
index c7d3339d1..286b1b154 100644
|
||||
--- a/glib/gfileutils.c
|
||||
+++ b/glib/gfileutils.c
|
||||
@@ -1475,9 +1475,9 @@ get_tmp_file (gchar *tmpl,
|
||||
static const char letters[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
static const int NLETTERS = sizeof (letters) - 1;
|
||||
- gint64 value;
|
||||
- gint64 now_us;
|
||||
- static int counter = 0;
|
||||
+ guint64 value;
|
||||
+ guint64 now_us;
|
||||
+ static guint counter = 0;
|
||||
|
||||
g_return_val_if_fail (tmpl != NULL, -1);
|
||||
|
||||
@@ -1496,7 +1496,7 @@ get_tmp_file (gchar *tmpl,
|
||||
|
||||
for (count = 0; count < 100; value += 7777, ++count)
|
||||
{
|
||||
- gint64 v = value;
|
||||
+ guint64 v = value;
|
||||
|
||||
/* Fill in the random bits. */
|
||||
XXXXXX[0] = letters[v % NLETTERS];
|
||||
@@ -62,6 +62,8 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
|
||||
file://CVE-2025-3360-06.patch \
|
||||
file://CVE-2025-4373-01.patch \
|
||||
file://CVE-2025-4373-02.patch \
|
||||
file://CVE-2025-7039-01.patch \
|
||||
file://CVE-2025-7039-02.patch \
|
||||
"
|
||||
SRC_URI:append:class-native = " file://relocate-modules.patch"
|
||||
|
||||
@@ -97,3 +99,6 @@ def find_meson_cross_files(d):
|
||||
python () {
|
||||
find_meson_cross_files(d)
|
||||
}
|
||||
|
||||
# not-applicable-platform: Issue only applies on Windows
|
||||
CVE_CHECK_IGNORE += "CVE-2025-4056"
|
||||
|
||||
@@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx"
|
||||
|
||||
inherit core-image setuptools3
|
||||
|
||||
SRCREV ?= "3c825671cb8f30e6205f1bcf177f3432161295f5"
|
||||
SRCREV ?= "49e837cefaa0d1844b32ff788c6e9de246a3a739"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=kirkstone \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
|
||||
@@ -33,16 +33,16 @@ Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/2eb4
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
man/systemd-coredump.xml | 12 ++++++++++++
|
||||
man/systemd-coredump.xml | 11 +++++++++++
|
||||
src/coredump/coredump.c | 21 ++++++++++++++++++---
|
||||
sysctl.d/50-coredump.conf.in | 2 +-
|
||||
3 files changed, 31 insertions(+), 4 deletions(-)
|
||||
3 files changed, 30 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/man/systemd-coredump.xml b/man/systemd-coredump.xml
|
||||
index cb9f47745b..ba7cad12bc 100644
|
||||
--- a/man/systemd-coredump.xml
|
||||
+++ b/man/systemd-coredump.xml
|
||||
@@ -259,6 +259,18 @@ COREDUMP_FILENAME=/var/lib/systemd/coredump/core.Web….552351.….zst
|
||||
@@ -259,6 +259,17 @@ COREDUMP_FILENAME=/var/lib/systemd/coredump/core.Web….552351.….zst
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -54,7 +54,6 @@ index cb9f47745b..ba7cad12bc 100644
|
||||
+ project='man-pages'><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
|
||||
+ </para>
|
||||
+
|
||||
+ <xi:include href="version-info.xml" xpointer="v258"/>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
|
||||
125
meta/recipes-devtools/dpkg/dpkg/CVE-2025-6297.patch
Normal file
125
meta/recipes-devtools/dpkg/dpkg/CVE-2025-6297.patch
Normal file
@@ -0,0 +1,125 @@
|
||||
From 98c623c8d6814ae46a3b30ca22e584c77d47d86b Mon Sep 17 00:00:00 2001
|
||||
From: Guillem Jover <guillem@debian.org>
|
||||
Date: Sat, 7 Jun 2025 14:17:07 +0200
|
||||
Subject: [PATCH] dpkg-deb: Fix cleanup for control member with restricted
|
||||
directories
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When extracting a control member into a temporary directory, which is
|
||||
documented as being a safe operation even on untrusted data, the code
|
||||
in charge of the temporary directory cleanup does not sanitize the
|
||||
directory permissions, which is then unable to perform the «rm -rf»
|
||||
when running as a non-root user, leaving temporary files behind.
|
||||
|
||||
Given automated and repeated execution of dpkg-deb commands on
|
||||
adversarial .deb packages or with well compressible files, placed
|
||||
inside a directory with permissions not allowing removal by a non-root
|
||||
user, this can end up with a DoS scenario due to causing disk quota
|
||||
exhaustion or disk full conditions.
|
||||
|
||||
This is considered a minor issue, given the required conditions to
|
||||
trigger a problem with it, but an issue non the less given the
|
||||
documented security guarantees of the command. This has been an
|
||||
issue since the initial commit introducing dpkg-deb in C.
|
||||
|
||||
We use an existing string for the error message to avoid new strings
|
||||
needing translation for stable branches, which make the error message
|
||||
less descriptive than what would be ideal. This will be improved in
|
||||
git HEAD.
|
||||
|
||||
Reported-by: zhutyra on HackerOne
|
||||
Fixes: CVE-2025-6297
|
||||
Stable-Candidate: 1.20.x 1.21.x 1.22.x
|
||||
(cherry picked from commit ed6bbd445dd8800308c67236ba35d08004c98e82)
|
||||
(cherry picked from commit 02ad0532bd490cbc95b344f670e622a38eecfbf6)
|
||||
(cherry picked from commit d8a76551e22abe76eefd7fef5c7f51f4118eb40e)
|
||||
|
||||
CVE: CVE-2025-6297
|
||||
Upstream-Status: Backport [https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=98c623c8d6814ae46a3b30ca22e584c77d47d86b]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
src/at/deb-content.at | 32 ++++++++++++++++++++++++++++++++
|
||||
src/deb/info.c | 20 ++++++++++++++++++++
|
||||
2 files changed, 52 insertions(+)
|
||||
|
||||
diff --git a/src/at/deb-content.at b/src/at/deb-content.at
|
||||
index a192c9493..d48eed72b 100644
|
||||
--- a/src/at/deb-content.at
|
||||
+++ b/src/at/deb-content.at
|
||||
@@ -127,3 +127,35 @@ newline'
|
||||
])
|
||||
|
||||
AT_CLEANUP
|
||||
+
|
||||
+AT_SETUP([dpkg-deb .deb extraction cleanup])
|
||||
+AT_KEYWORDS([dpkg-deb deb extraction])
|
||||
+
|
||||
+DPKG_GEN_CONTROL([pkg-ctrl-dir-perms])
|
||||
+AT_CHECK([
|
||||
+dpkg-deb --root-owner-group -Znone -b pkg-ctrl-dir-perms
|
||||
+DPKG_AR_EXTRACT([pkg-ctrl-dir-perms.deb])
|
||||
+dpkg-deb -R pkg-ctrl-dir-perms.deb pkg-ctrl-dir-perms-bad
|
||||
+mkdir -p pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner
|
||||
+touch pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner/file
|
||||
+chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN
|
||||
+chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir
|
||||
+chmod 0555 pkg-ctrl-dir-perms-bad/DEBIAN/rx-subdir/inner
|
||||
+$TAR cf control.tar --format=gnu --sort=name --mtime @0 --clamp-mtime --owner root:0 --group root:0 -C pkg-ctrl-dir-perms-bad/DEBIAN .
|
||||
+DPKG_AR_GEN([pkg-ctrl-dir-perms.deb], [debian-binary control.tar data.tar])
|
||||
+], [0], [dpkg-deb: building package 'pkg-ctrl-dir-perms' in 'pkg-ctrl-dir-perms.deb'.
|
||||
+])
|
||||
+AT_CHECK([
|
||||
+dpkg-deb --ctrl-tarfile pkg-ctrl-dir-perms.deb | $TAR tvf -
|
||||
+], [0], [dr-xr-xr-x root/root 0 1970-01-01 00:00 ./
|
||||
+-rw-r--r-- root/root 176 1970-01-01 00:00 ./control
|
||||
+dr-xr-xr-x root/root 0 1970-01-01 00:00 ./rx-subdir/
|
||||
+dr-xr-xr-x root/root 0 1970-01-01 00:00 ./rx-subdir/inner/
|
||||
+-rw-r--r-- root/root 0 1970-01-01 00:00 ./rx-subdir/inner/file
|
||||
+])
|
||||
+# Check that we can cleanup the temporarily extracted control.tar member.
|
||||
+AT_CHECK([
|
||||
+dpkg-deb -I pkg-ctrl-dir-perms.deb
|
||||
+], [0], [ignore])
|
||||
+
|
||||
+AT_CLEANUP
|
||||
diff --git a/src/deb/info.c b/src/deb/info.c
|
||||
index f3d57e2ce..396ea4d14 100644
|
||||
--- a/src/deb/info.c
|
||||
+++ b/src/deb/info.c
|
||||
@@ -45,14 +45,34 @@
|
||||
#include <dpkg/pkg-format.h>
|
||||
#include <dpkg/buffer.h>
|
||||
#include <dpkg/path.h>
|
||||
+#include <dpkg/treewalk.h>
|
||||
#include <dpkg/options.h>
|
||||
|
||||
#include "dpkg-deb.h"
|
||||
|
||||
+static int
|
||||
+cu_info_treewalk_fixup_dir(struct treenode *node)
|
||||
+{
|
||||
+ const char *nodename;
|
||||
+
|
||||
+ if (!S_ISDIR(treenode_get_mode(node)))
|
||||
+ return 0;
|
||||
+
|
||||
+ nodename = treenode_get_pathname(node);
|
||||
+ if (chmod(nodename, 0755) < 0)
|
||||
+ ohshite(_("error setting permissions of '%.255s'"), nodename);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void cu_info_prepare(int argc, void **argv) {
|
||||
char *dir;
|
||||
+ struct treewalk_funcs cu_info_treewalk_funcs = {
|
||||
+ .visit = cu_info_treewalk_fixup_dir,
|
||||
+ };
|
||||
|
||||
dir = argv[0];
|
||||
+ treewalk(dir, TREEWALK_NONE, &cu_info_treewalk_funcs);
|
||||
path_remove_tree(dir);
|
||||
free(dir);
|
||||
}
|
||||
@@ -15,6 +15,7 @@ SRC_URI = "git://salsa.debian.org/dpkg-team/dpkg.git;protocol=https;branch=main
|
||||
file://pager.patch \
|
||||
file://0001-Add-support-for-riscv32-CPU.patch \
|
||||
file://0001-Dpkg-Source-Archive-Prevent-directory-traversal-for-.patch \
|
||||
file://CVE-2025-6297.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-native = " file://0001-build.c-ignore-return-of-1-from-tar-cf.patch"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
85
meta/recipes-devtools/git/git/CVE-2025-48384.patch
Normal file
85
meta/recipes-devtools/git/git/CVE-2025-48384.patch
Normal file
@@ -0,0 +1,85 @@
|
||||
From 05e9cd64ee23bbadcea6bcffd6660ed02b8eab89 Mon Sep 17 00:00:00 2001
|
||||
From: Justin Tobler <jltobler@gmail.com>
|
||||
Date: Mon, 19 May 2025 21:26:04 -0500
|
||||
Subject: [PATCH] config: quote values containing CR character
|
||||
|
||||
When reading the config, values that contain a trailing CRLF are
|
||||
stripped. If the value itself has a trailing CR, the normal LF that
|
||||
follows results in the CR being unintentionally stripped. This may lead
|
||||
to unintended behavior due to the config value written being different
|
||||
when it gets read.
|
||||
|
||||
One such issue involves a repository with a submodule path containing a
|
||||
trailing CR. When the submodule gets initialized, the submodule is
|
||||
cloned without being checked out and has "core.worktree" set to the
|
||||
submodule path. The git-checkout(1) that gets spawned later reads the
|
||||
"core.worktree" config value, but without the trailing CR, and
|
||||
consequently attempts to checkout to a different path than intended.
|
||||
|
||||
If the repository contains a matching path that is a symlink, it is
|
||||
possible for the submodule repository to be checked out in arbitrary
|
||||
locations. This is extra bad when the symlink points to the submodule
|
||||
hooks directory and the submodule repository contains an executable
|
||||
"post-checkout" hook. Once the submodule repository checkout completes,
|
||||
the "post-checkout" hook immediately executes.
|
||||
|
||||
To prevent mismatched config state due to misinterpreting a trailing CR,
|
||||
wrap config values containing CR in double quotes when writing the
|
||||
entry. This ensures a trailing CR is always separated for an LF and thus
|
||||
prevented from getting stripped.
|
||||
|
||||
Note that this problem cannot be addressed by just quoting each CR with
|
||||
"\r". The reading side of the config interprets only a few backslash
|
||||
escapes, and "\r" is not among them. This fix is sufficient though
|
||||
because it only affects the CR at the end of a line and any literal CR
|
||||
in the interior is already preserved.
|
||||
|
||||
Co-authored-by: David Leadbeater <dgl@dgl.cx>
|
||||
Signed-off-by: Justin Tobler <jltobler@gmail.com>
|
||||
Signed-off-by: Taylor Blau <me@ttaylorr.com>
|
||||
|
||||
CVE: CVE-2025-48384
|
||||
|
||||
Upstream-Status: Backport [https://github.com/git/git/commit/05e9cd64ee23bbadcea6bcffd6660ed02b8eab89]
|
||||
|
||||
Signed-off-by: Praveen Kumar <praveen.kumar@windriver.com>
|
||||
---
|
||||
config.c | 2 +-
|
||||
t/t1300-config.sh | 10 ++++++++++
|
||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/config.c b/config.c
|
||||
index 6a01938..4fbff51 100644
|
||||
--- a/config.c
|
||||
+++ b/config.c
|
||||
@@ -2756,7 +2756,7 @@ static ssize_t write_pair(int fd, const char *key, const char *value,
|
||||
if (value[0] == ' ')
|
||||
quote = "\"";
|
||||
for (i = 0; value[i]; i++)
|
||||
- if (value[i] == ';' || value[i] == '#')
|
||||
+ if (value[i] == ';' || value[i] == '#' || value[i] == '\r')
|
||||
quote = "\"";
|
||||
if (i && value[i - 1] == ' ')
|
||||
quote = "\"";
|
||||
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
|
||||
index b07feb1..49f4971 100755
|
||||
--- a/t/t1300-config.sh
|
||||
+++ b/t/t1300-config.sh
|
||||
@@ -2417,5 +2417,15 @@ test_expect_success '--get and --get-all with --fixed-value' '
|
||||
git config --file=config --get-regexp --fixed-value fixed+ "$META" &&
|
||||
test_must_fail git config --file=config --get-regexp --fixed-value fixed+ non-existent
|
||||
'
|
||||
+test_expect_success 'writing value with trailing CR not stripped on read' '
|
||||
+ test_when_finished "rm -rf cr-test" &&
|
||||
+
|
||||
+ printf "bar\r\n" >expect &&
|
||||
+ git init cr-test &&
|
||||
+ git -C cr-test config set core.foo $(printf "bar\r") &&
|
||||
+ git -C cr-test config get core.foo >actual &&
|
||||
+
|
||||
+ test_cmp expect actual
|
||||
+'
|
||||
|
||||
test_done
|
||||
--
|
||||
2.40.0
|
||||
@@ -26,6 +26,8 @@ SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
|
||||
file://CVE-2024-50349-0001.patch \
|
||||
file://CVE-2024-50349-0002.patch \
|
||||
file://CVE-2024-52006.patch \
|
||||
file://CVE-2025-27614-CVE-2025-27613-CVE-2025-46334-CVE-2025-46835.patch \
|
||||
file://CVE-2025-48384.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git-${PV}"
|
||||
|
||||
@@ -70,7 +70,8 @@ SRC_URI[main.sha256sum] = "a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784
|
||||
# Upstream don't believe it is a signifiant real world issue and will only
|
||||
# fix in 1.17 onwards where we can drop this.
|
||||
# https://github.com/golang/go/issues/30999#issuecomment-910470358
|
||||
CVE_CHECK_IGNORE += "CVE-2021-29923"
|
||||
# CVE-2024-24790: net/netip module was introduced in go1.18beta1 via a59e33224e42d60a97fa720a45e1b74eb6aaa3d0
|
||||
CVE_CHECK_IGNORE += "CVE-2021-29923 CVE-2024-24790"
|
||||
|
||||
# This are specific to Microsoft Windows
|
||||
CVE_CHECK_IGNORE += "CVE-2022-41716 CVE-2023-45283 CVE-2023-45284"
|
||||
CVE_CHECK_IGNORE += "CVE-2022-41716 CVE-2023-45283 CVE-2023-45284 CVE-2025-0913"
|
||||
|
||||
@@ -32,6 +32,10 @@ Date: Thu Jun 20 10:22:01 2024 +0100
|
||||
Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/78ff617d3f573fb3a9b2fef180fa0fd43d5584ea]
|
||||
CVE: CVE-2024-0151
|
||||
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
|
||||
|
||||
Added back RegVT variable, which was accidentally removed during backporting.
|
||||
|
||||
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||
---
|
||||
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
|
||||
index 900113244e41..e12f8c183db2 100644
|
||||
@@ -98,16 +102,15 @@ index 900113244e41..e12f8c183db2 100644
|
||||
Function::const_arg_iterator CurOrigArg = MF.getFunction().arg_begin();
|
||||
unsigned CurArgIdx = 0;
|
||||
|
||||
@@ -4432,7 +4450,7 @@ SDValue ARMTargetLowering::LowerFormalArguments(
|
||||
}
|
||||
@@ -4433,6 +4451,7 @@ SDValue ARMTargetLowering::LowerFormalArguments(
|
||||
// Arguments stored in registers.
|
||||
if (VA.isRegLoc()) {
|
||||
- EVT RegVT = VA.getLocVT();
|
||||
EVT RegVT = VA.getLocVT();
|
||||
+ SDValue ArgValue;
|
||||
|
||||
if (VA.needsCustom() && VA.getLocVT() == MVT::v2f64) {
|
||||
// f64 and vector types are split up into multiple registers or
|
||||
@@ -4496,16 +4514,6 @@ SDValue ARMTargetLowering::LowerFormalArguments(
|
||||
@@ -4496,16 +4515,6 @@ SDValue ARMTargetLowering::LowerFormalArguments(
|
||||
case CCValAssign::BCvt:
|
||||
ArgValue = DAG.getNode(ISD::BITCAST, dl, VA.getValVT(), ArgValue);
|
||||
break;
|
||||
@@ -124,7 +127,7 @@ index 900113244e41..e12f8c183db2 100644
|
||||
}
|
||||
|
||||
// f16 arguments have their size extended to 4 bytes and passed as if they
|
||||
@@ -4515,6 +4523,15 @@ SDValue ARMTargetLowering::LowerFormalArguments(
|
||||
@@ -4515,6 +4524,15 @@ SDValue ARMTargetLowering::LowerFormalArguments(
|
||||
(VA.getValVT() == MVT::f16 || VA.getValVT() == MVT::bf16))
|
||||
ArgValue = MoveToHPR(dl, DAG, VA.getLocVT(), VA.getValVT(), ArgValue);
|
||||
|
||||
|
||||
219
meta/recipes-devtools/python/python3/CVE-2025-8194.patch
Normal file
219
meta/recipes-devtools/python/python3/CVE-2025-8194.patch
Normal file
@@ -0,0 +1,219 @@
|
||||
From c9d9f78feb1467e73fd29356c040bde1c104f29f Mon Sep 17 00:00:00 2001
|
||||
From: "Miss Islington (bot)"
|
||||
<31488909+miss-islington@users.noreply.github.com>
|
||||
Date: Mon, 4 Aug 2025 13:45:06 +0200
|
||||
Subject: [PATCH] [3.12] gh-130577: tarfile now validates archives to ensure
|
||||
member offsets are non-negative (GH-137027) (#137171)
|
||||
|
||||
(cherry picked from commit 7040aa54f14676938970e10c5f74ea93cd56aa38)
|
||||
|
||||
Co-authored-by: Alexander Urieles <aeurielesn@users.noreply.github.com>
|
||||
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
||||
|
||||
CVE: CVE-2025-8194
|
||||
Upstream-Status: Backport [https://github.com/python/cpython/commit/c9d9f78feb1467e73fd29356c040bde1c104f29f]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
Lib/tarfile.py | 3 +
|
||||
Lib/test/test_tarfile.py | 156 ++++++++++++++++++
|
||||
...-07-23-00-35-29.gh-issue-130577.c7EITy.rst | 3 +
|
||||
3 files changed, 162 insertions(+)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst
|
||||
|
||||
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
|
||||
index 9999a99d54..59d3f6e5cc 100755
|
||||
--- a/Lib/tarfile.py
|
||||
+++ b/Lib/tarfile.py
|
||||
@@ -1613,6 +1613,9 @@ class TarInfo(object):
|
||||
"""Round up a byte count by BLOCKSIZE and return it,
|
||||
e.g. _block(834) => 1024.
|
||||
"""
|
||||
+ # Only non-negative offsets are allowed
|
||||
+ if count < 0:
|
||||
+ raise InvalidHeaderError("invalid offset")
|
||||
blocks, remainder = divmod(count, BLOCKSIZE)
|
||||
if remainder:
|
||||
blocks += 1
|
||||
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
|
||||
index a184ba75a8..759fa03ead 100644
|
||||
--- a/Lib/test/test_tarfile.py
|
||||
+++ b/Lib/test/test_tarfile.py
|
||||
@@ -49,6 +49,7 @@ bz2name = os.path.join(TEMPDIR, "testtar.tar.bz2")
|
||||
xzname = os.path.join(TEMPDIR, "testtar.tar.xz")
|
||||
tmpname = os.path.join(TEMPDIR, "tmp.tar")
|
||||
dotlessname = os.path.join(TEMPDIR, "testtar")
|
||||
+SPACE = b" "
|
||||
|
||||
sha256_regtype = (
|
||||
"e09e4bc8b3c9d9177e77256353b36c159f5f040531bbd4b024a8f9b9196c71ce"
|
||||
@@ -4273,6 +4274,161 @@ class TestExtractionFilters(unittest.TestCase):
|
||||
self.expect_exception(TypeError) # errorlevel is not int
|
||||
|
||||
|
||||
+class OffsetValidationTests(unittest.TestCase):
|
||||
+ tarname = tmpname
|
||||
+ invalid_posix_header = (
|
||||
+ # name: 100 bytes
|
||||
+ tarfile.NUL * tarfile.LENGTH_NAME
|
||||
+ # mode, space, null terminator: 8 bytes
|
||||
+ + b"000755" + SPACE + tarfile.NUL
|
||||
+ # uid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # gid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # size, space: 12 bytes
|
||||
+ + b"\xff" * 11 + SPACE
|
||||
+ # mtime, space: 12 bytes
|
||||
+ + tarfile.NUL * 11 + SPACE
|
||||
+ # chksum: 8 bytes
|
||||
+ + b"0011407" + tarfile.NUL
|
||||
+ # type: 1 byte
|
||||
+ + tarfile.REGTYPE
|
||||
+ # linkname: 100 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_LINK
|
||||
+ # magic: 6 bytes, version: 2 bytes
|
||||
+ + tarfile.POSIX_MAGIC
|
||||
+ # uname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # gname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # devmajor, space, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 6 + SPACE + tarfile.NUL
|
||||
+ # devminor, space, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 6 + SPACE + tarfile.NUL
|
||||
+ # prefix: 155 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_PREFIX
|
||||
+ # padding: 12 bytes
|
||||
+ + tarfile.NUL * 12
|
||||
+ )
|
||||
+ invalid_gnu_header = (
|
||||
+ # name: 100 bytes
|
||||
+ tarfile.NUL * tarfile.LENGTH_NAME
|
||||
+ # mode, null terminator: 8 bytes
|
||||
+ + b"0000755" + tarfile.NUL
|
||||
+ # uid, null terminator: 8 bytes
|
||||
+ + b"0000001" + tarfile.NUL
|
||||
+ # gid, space, null terminator: 8 bytes
|
||||
+ + b"0000001" + tarfile.NUL
|
||||
+ # size, space: 12 bytes
|
||||
+ + b"\xff" * 11 + SPACE
|
||||
+ # mtime, space: 12 bytes
|
||||
+ + tarfile.NUL * 11 + SPACE
|
||||
+ # chksum: 8 bytes
|
||||
+ + b"0011327" + tarfile.NUL
|
||||
+ # type: 1 byte
|
||||
+ + tarfile.REGTYPE
|
||||
+ # linkname: 100 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_LINK
|
||||
+ # magic: 8 bytes
|
||||
+ + tarfile.GNU_MAGIC
|
||||
+ # uname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # gname: 32 bytes
|
||||
+ + tarfile.NUL * 32
|
||||
+ # devmajor, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 8
|
||||
+ # devminor, null terminator: 8 bytes
|
||||
+ + tarfile.NUL * 8
|
||||
+ # padding: 167 bytes
|
||||
+ + tarfile.NUL * 167
|
||||
+ )
|
||||
+ invalid_v7_header = (
|
||||
+ # name: 100 bytes
|
||||
+ tarfile.NUL * tarfile.LENGTH_NAME
|
||||
+ # mode, space, null terminator: 8 bytes
|
||||
+ + b"000755" + SPACE + tarfile.NUL
|
||||
+ # uid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # gid, space, null terminator: 8 bytes
|
||||
+ + b"000001" + SPACE + tarfile.NUL
|
||||
+ # size, space: 12 bytes
|
||||
+ + b"\xff" * 11 + SPACE
|
||||
+ # mtime, space: 12 bytes
|
||||
+ + tarfile.NUL * 11 + SPACE
|
||||
+ # chksum: 8 bytes
|
||||
+ + b"0010070" + tarfile.NUL
|
||||
+ # type: 1 byte
|
||||
+ + tarfile.REGTYPE
|
||||
+ # linkname: 100 bytes
|
||||
+ + tarfile.NUL * tarfile.LENGTH_LINK
|
||||
+ # padding: 255 bytes
|
||||
+ + tarfile.NUL * 255
|
||||
+ )
|
||||
+ valid_gnu_header = tarfile.TarInfo("filename").tobuf(tarfile.GNU_FORMAT)
|
||||
+ data_block = b"\xff" * tarfile.BLOCKSIZE
|
||||
+
|
||||
+ def _write_buffer(self, buffer):
|
||||
+ with open(self.tarname, "wb") as f:
|
||||
+ f.write(buffer)
|
||||
+
|
||||
+ def _get_members(self, ignore_zeros=None):
|
||||
+ with open(self.tarname, "rb") as f:
|
||||
+ with tarfile.open(
|
||||
+ mode="r", fileobj=f, ignore_zeros=ignore_zeros
|
||||
+ ) as tar:
|
||||
+ return tar.getmembers()
|
||||
+
|
||||
+ def _assert_raises_read_error_exception(self):
|
||||
+ with self.assertRaisesRegex(
|
||||
+ tarfile.ReadError, "file could not be opened successfully"
|
||||
+ ):
|
||||
+ self._get_members()
|
||||
+
|
||||
+ def test_invalid_offset_header_validations(self):
|
||||
+ for tar_format, invalid_header in (
|
||||
+ ("posix", self.invalid_posix_header),
|
||||
+ ("gnu", self.invalid_gnu_header),
|
||||
+ ("v7", self.invalid_v7_header),
|
||||
+ ):
|
||||
+ with self.subTest(format=tar_format):
|
||||
+ self._write_buffer(invalid_header)
|
||||
+ self._assert_raises_read_error_exception()
|
||||
+
|
||||
+ def test_early_stop_at_invalid_offset_header(self):
|
||||
+ buffer = self.valid_gnu_header + self.invalid_gnu_header + self.valid_gnu_header
|
||||
+ self._write_buffer(buffer)
|
||||
+ members = self._get_members()
|
||||
+ self.assertEqual(len(members), 1)
|
||||
+ self.assertEqual(members[0].name, "filename")
|
||||
+ self.assertEqual(members[0].offset, 0)
|
||||
+
|
||||
+ def test_ignore_invalid_archive(self):
|
||||
+ # 3 invalid headers with their respective data
|
||||
+ buffer = (self.invalid_gnu_header + self.data_block) * 3
|
||||
+ self._write_buffer(buffer)
|
||||
+ members = self._get_members(ignore_zeros=True)
|
||||
+ self.assertEqual(len(members), 0)
|
||||
+
|
||||
+ def test_ignore_invalid_offset_headers(self):
|
||||
+ for first_block, second_block, expected_offset in (
|
||||
+ (
|
||||
+ (self.valid_gnu_header),
|
||||
+ (self.invalid_gnu_header + self.data_block),
|
||||
+ 0,
|
||||
+ ),
|
||||
+ (
|
||||
+ (self.invalid_gnu_header + self.data_block),
|
||||
+ (self.valid_gnu_header),
|
||||
+ 1024,
|
||||
+ ),
|
||||
+ ):
|
||||
+ self._write_buffer(first_block + second_block)
|
||||
+ members = self._get_members(ignore_zeros=True)
|
||||
+ self.assertEqual(len(members), 1)
|
||||
+ self.assertEqual(members[0].name, "filename")
|
||||
+ self.assertEqual(members[0].offset, expected_offset)
|
||||
+
|
||||
+
|
||||
def setUpModule():
|
||||
os_helper.unlink(TEMPDIR)
|
||||
os.makedirs(TEMPDIR)
|
||||
diff --git a/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst
|
||||
new file mode 100644
|
||||
index 0000000000..342cabbc86
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst
|
||||
@@ -0,0 +1,3 @@
|
||||
+:mod:`tarfile` now validates archives to ensure member offsets are
|
||||
+non-negative. (Contributed by Alexander Enrique Urieles Nieto in
|
||||
+:gh:`130577`.)
|
||||
@@ -37,6 +37,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
|
||||
file://0001-Avoid-shebang-overflow-on-python-config.py.patch \
|
||||
file://0001-test_storlines-skip-due-to-load-variability.patch \
|
||||
file://0001-gh-107811-tarfile-treat-overflow-in-UID-GID-as-failu.patch \
|
||||
file://CVE-2025-8194.patch \
|
||||
"
|
||||
|
||||
SRC_URI:append:class-native = " \
|
||||
@@ -170,7 +171,7 @@ do_install:append:class-native() {
|
||||
# when they're only used for python called with -O or -OO.
|
||||
#find ${D} -name *opt-*.pyc -delete
|
||||
# Remove all pyc files. There are a ton of them and it is probably faster to let
|
||||
# python create the ones it wants at runtime rather than manage in the sstate
|
||||
# python create the ones it wants at runtime rather than manage in the sstate
|
||||
# tarballs and sysroot creation.
|
||||
find ${D} -name *.pyc -delete
|
||||
|
||||
@@ -206,7 +207,7 @@ do_install:append() {
|
||||
rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_range.cpython*
|
||||
rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/test/__pycache__/test_xml_etree.cpython*
|
||||
|
||||
# Similar to the above, we're getting reproducibility issues with
|
||||
# Similar to the above, we're getting reproducibility issues with
|
||||
# /usr/lib/python3.10/__pycache__/traceback.cpython-310.pyc
|
||||
# so remove it too
|
||||
rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/__pycache__/traceback.cpython*
|
||||
@@ -266,7 +267,7 @@ py_package_preprocess () {
|
||||
cd -
|
||||
|
||||
mv ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}
|
||||
|
||||
|
||||
#Remove the unneeded copy of target sysconfig data
|
||||
rm -rf ${PKGD}/${libdir}/python-sysconfigdata
|
||||
}
|
||||
|
||||
@@ -164,6 +164,9 @@ CVE_CHECK_IGNORE += "CVE-2022-36648"
|
||||
# disputed: not an issue as per https://bugzilla.redhat.com/show_bug.cgi?id=2223985
|
||||
CVE_CHECK_IGNORE += "CVE-2023-1386"
|
||||
|
||||
# virtio-snd was implemented in 8.2.0, so version 6.2.0 is not yet affected
|
||||
CVE_CHECK_IGNORE += "CVE-2024-7730"
|
||||
|
||||
COMPATIBLE_HOST:mipsarchn32 = "null"
|
||||
COMPATIBLE_HOST:mipsarchn64 = "null"
|
||||
COMPATIBLE_HOST:riscv32 = "null"
|
||||
|
||||
@@ -25,6 +25,8 @@ SRC_URI = "https://github.com/OpenPrinting/cups/releases/download/v${PV}/cups-${
|
||||
file://CVE-2024-47175-3.patch \
|
||||
file://CVE-2024-47175-4.patch \
|
||||
file://CVE-2024-47175-5.patch \
|
||||
file://CVE-2025-58060.patch \
|
||||
file://CVE-2025-58364.patch \
|
||||
"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/OpenPrinting/cups/releases"
|
||||
|
||||
76
meta/recipes-extended/cups/cups/CVE-2025-58060.patch
Normal file
76
meta/recipes-extended/cups/cups/CVE-2025-58060.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
From 595d691075b1d396d2edfaa0a8fd0873a0a1f221 Mon Sep 17 00:00:00 2001
|
||||
From: Zdenek Dohnal <zdohnal@redhat.com>
|
||||
Date: Thu, 11 Sep 2025 14:44:59 +0200
|
||||
Subject: [PATCH] cupsd: Block authentication using alternate method
|
||||
|
||||
Fixes: CVE-2025-58060
|
||||
|
||||
Upstream-Status: Backport [import from debian 2.4.2-3+deb12u9
|
||||
Upstream commit https://github.com/OpenPrinting/cups/commit/595d691075b1d396d2edfaa0a8fd0873a0a1f221]
|
||||
CVE: CVE-2025-58060
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
scheduler/auth.c | 26 ++++++++++++++++++++------
|
||||
1 file changed, 20 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/scheduler/auth.c b/scheduler/auth.c
|
||||
index aa773f9..55f8912 100644
|
||||
--- a/scheduler/auth.c
|
||||
+++ b/scheduler/auth.c
|
||||
@@ -513,6 +513,16 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
|
||||
int userlen; /* Username:password length */
|
||||
|
||||
|
||||
+ /*
|
||||
+ * Only allow Basic if enabled...
|
||||
+ */
|
||||
+
|
||||
+ if (type != CUPSD_AUTH_BASIC)
|
||||
+ {
|
||||
+ cupsdLogClient(con, CUPSD_LOG_ERROR, "Basic authentication is not enabled.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
authorization += 5;
|
||||
while (isspace(*authorization & 255))
|
||||
authorization ++;
|
||||
@@ -558,10 +568,6 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
|
||||
* Validate the username and password...
|
||||
*/
|
||||
|
||||
- switch (type)
|
||||
- {
|
||||
- default :
|
||||
- case CUPSD_AUTH_BASIC :
|
||||
{
|
||||
#if HAVE_LIBPAM
|
||||
/*
|
||||
@@ -715,8 +721,6 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
|
||||
}
|
||||
|
||||
cupsdLogClient(con, CUPSD_LOG_DEBUG, "Authorized as \"%s\" using Basic.", username);
|
||||
- break;
|
||||
- }
|
||||
|
||||
con->type = type;
|
||||
}
|
||||
@@ -733,6 +737,16 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
|
||||
/* Output token for username */
|
||||
gss_name_t client_name; /* Client name */
|
||||
|
||||
+ /*
|
||||
+ * Only allow Kerberos if enabled...
|
||||
+ */
|
||||
+
|
||||
+ if (type != CUPSD_AUTH_NEGOTIATE)
|
||||
+ {
|
||||
+ cupsdLogClient(con, CUPSD_LOG_ERROR, "Kerberos authentication is not enabled.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
# ifdef __APPLE__
|
||||
/*
|
||||
* If the weak-linked GSSAPI/Kerberos library is not present, don't try
|
||||
--
|
||||
2.25.1
|
||||
|
||||
63
meta/recipes-extended/cups/cups/CVE-2025-58364.patch
Normal file
63
meta/recipes-extended/cups/cups/CVE-2025-58364.patch
Normal file
@@ -0,0 +1,63 @@
|
||||
From e58cba9d6fceed4242980e51dbd1302cf638ab1d Mon Sep 17 00:00:00 2001
|
||||
From: Zdenek Dohnal <zdohnal@redhat.com>
|
||||
Date: Thu, 11 Sep 2025 14:53:49 +0200
|
||||
Subject: [PATCH] libcups: Fix handling of extension tag in `ipp_read_io()`
|
||||
|
||||
Fixes: CVE-2025-58364
|
||||
|
||||
Upstream-Status: Backport [import from debian 2.4.2-3+deb12u9
|
||||
Upstream commit https://github.com/OpenPrinting/cups/commit/e58cba9d6fceed4242980e51dbd1302cf638ab1d]
|
||||
CVE: CVE-2025-58364
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
cups/ipp.c | 27 +--------------------------
|
||||
1 file changed, 1 insertion(+), 26 deletions(-)
|
||||
|
||||
diff --git a/cups/ipp.c b/cups/ipp.c
|
||||
index 42cf2fc..4b9dc4e 100644
|
||||
--- a/cups/ipp.c
|
||||
+++ b/cups/ipp.c
|
||||
@@ -2949,32 +2949,6 @@ ippReadIO(void *src, /* I - Data source */
|
||||
*/
|
||||
|
||||
tag = (ipp_tag_t)buffer[0];
|
||||
- if (tag == IPP_TAG_EXTENSION)
|
||||
- {
|
||||
- /*
|
||||
- * Read 32-bit "extension" tag...
|
||||
- */
|
||||
-
|
||||
- if ((*cb)(src, buffer, 4) < 4)
|
||||
- {
|
||||
- DEBUG_puts("1ippReadIO: Callback returned EOF/error");
|
||||
- goto rollback;
|
||||
- }
|
||||
-
|
||||
- tag = (ipp_tag_t)((((((buffer[0] << 8) | buffer[1]) << 8) |
|
||||
- buffer[2]) << 8) | buffer[3]);
|
||||
-
|
||||
- if (tag & IPP_TAG_CUPS_CONST)
|
||||
- {
|
||||
- /*
|
||||
- * Fail if the high bit is set in the tag...
|
||||
- */
|
||||
-
|
||||
- _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP extension tag larger than 0x7FFFFFFF."), 1);
|
||||
- DEBUG_printf(("1ippReadIO: bad tag 0x%x.", tag));
|
||||
- goto rollback;
|
||||
- }
|
||||
- }
|
||||
|
||||
if (tag == IPP_TAG_END)
|
||||
{
|
||||
@@ -3323,6 +3297,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
{
|
||||
if ((*cb)(src, buffer, (size_t)n) < n)
|
||||
{
|
||||
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to read IPP attribute name."), 1);
|
||||
DEBUG_puts("1ippReadIO: unable to read string value.");
|
||||
goto rollback;
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -2,8 +2,8 @@ DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program.
|
||||
SECTION = "examples"
|
||||
HOMEPAGE = "https://golang.org/"
|
||||
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
||||
|
||||
SRC_URI = "git://go.googlesource.com/example;branch=master;protocol=https"
|
||||
SRCREV = "787a929d5a0dfb8bbfcdd2c4a62e0fd89466113f"
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
From 09a2ed4853cd177264076a88c98e525e892a0d0b Mon Sep 17 00:00:00 2001
|
||||
From: ljdarj <ljd@luigiscorner.mu>
|
||||
Date: Sat, 15 Mar 2025 19:17:27 +0100
|
||||
Subject: [PATCH] FILE* seeking support (#2539)
|
||||
|
||||
Adding a seeker function to archive_read_open_FILE().
|
||||
|
||||
Fixes #437.
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/09a2ed4853cd177264076a88c98e525e892a0d0b]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_read_open_file.c | 82 +++++++++++++++++++++++------
|
||||
libarchive/test/test_open_file.c | 9 ++--
|
||||
2 files changed, 71 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c
|
||||
index cf49ebd8..ecd56dce 100644
|
||||
--- a/libarchive/archive_read_open_file.c
|
||||
+++ b/libarchive/archive_read_open_file.c
|
||||
@@ -57,9 +57,10 @@ struct read_FILE_data {
|
||||
char can_skip;
|
||||
};
|
||||
|
||||
-static int file_close(struct archive *, void *);
|
||||
-static ssize_t file_read(struct archive *, void *, const void **buff);
|
||||
-static int64_t file_skip(struct archive *, void *, int64_t request);
|
||||
+static int FILE_close(struct archive *, void *);
|
||||
+static ssize_t FILE_read(struct archive *, void *, const void **buff);
|
||||
+static int64_t FILE_seek(struct archive *, void *, int64_t, int);
|
||||
+static int64_t FILE_skip(struct archive *, void *, int64_t);
|
||||
|
||||
int
|
||||
archive_read_open_FILE(struct archive *a, FILE *f)
|
||||
@@ -70,7 +71,7 @@ archive_read_open_FILE(struct archive *a, FILE *f)
|
||||
void *b;
|
||||
|
||||
archive_clear_error(a);
|
||||
- mine = (struct read_FILE_data *)malloc(sizeof(*mine));
|
||||
+ mine = (struct read_FILE_data *)calloc(1, sizeof(*mine));
|
||||
b = malloc(block_size);
|
||||
if (mine == NULL || b == NULL) {
|
||||
archive_set_error(a, ENOMEM, "No memory");
|
||||
@@ -91,22 +92,22 @@ archive_read_open_FILE(struct archive *a, FILE *f)
|
||||
archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
|
||||
/* Enable the seek optimization only for regular files. */
|
||||
mine->can_skip = 1;
|
||||
- } else
|
||||
- mine->can_skip = 0;
|
||||
+ }
|
||||
|
||||
#if defined(__CYGWIN__) || defined(_WIN32)
|
||||
setmode(fileno(mine->f), O_BINARY);
|
||||
#endif
|
||||
|
||||
- archive_read_set_read_callback(a, file_read);
|
||||
- archive_read_set_skip_callback(a, file_skip);
|
||||
- archive_read_set_close_callback(a, file_close);
|
||||
+ archive_read_set_read_callback(a, FILE_read);
|
||||
+ archive_read_set_skip_callback(a, FILE_skip);
|
||||
+ archive_read_set_seek_callback(a, FILE_seek);
|
||||
+ archive_read_set_close_callback(a, FILE_close);
|
||||
archive_read_set_callback_data(a, mine);
|
||||
return (archive_read_open1(a));
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
-file_read(struct archive *a, void *client_data, const void **buff)
|
||||
+FILE_read(struct archive *a, void *client_data, const void **buff)
|
||||
{
|
||||
struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
|
||||
size_t bytes_read;
|
||||
@@ -120,13 +121,13 @@ file_read(struct archive *a, void *client_data, const void **buff)
|
||||
}
|
||||
|
||||
static int64_t
|
||||
-file_skip(struct archive *a, void *client_data, int64_t request)
|
||||
+FILE_skip(struct archive *a, void *client_data, int64_t request)
|
||||
{
|
||||
struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
|
||||
-#if HAVE_FSEEKO
|
||||
- off_t skip = (off_t)request;
|
||||
-#elif HAVE__FSEEKI64
|
||||
+#if HAVE__FSEEKI64
|
||||
int64_t skip = request;
|
||||
+#elif HAVE_FSEEKO
|
||||
+ off_t skip = (off_t)request;
|
||||
#else
|
||||
long skip = (long)request;
|
||||
#endif
|
||||
@@ -168,8 +169,57 @@ file_skip(struct archive *a, void *client_data, int64_t request)
|
||||
return (request);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * TODO: Store the offset and use it in the read callback.
|
||||
+ */
|
||||
+static int64_t
|
||||
+FILE_seek(struct archive *a, void *client_data, int64_t request, int whence)
|
||||
+{
|
||||
+ struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
|
||||
+#if HAVE__FSEEKI64
|
||||
+ int64_t skip = request;
|
||||
+#elif HAVE_FSEEKO
|
||||
+ off_t skip = (off_t)request;
|
||||
+#else
|
||||
+ long skip = (long)request;
|
||||
+#endif
|
||||
+ int skip_bits = sizeof(skip) * 8 - 1;
|
||||
+ (void)a; /* UNUSED */
|
||||
+
|
||||
+ /* If request is too big for a long or an off_t, reduce it. */
|
||||
+ if (sizeof(request) > sizeof(skip)) {
|
||||
+ int64_t max_skip =
|
||||
+ (((int64_t)1 << (skip_bits - 1)) - 1) * 2 + 1;
|
||||
+ if (request > max_skip)
|
||||
+ skip = max_skip;
|
||||
+ }
|
||||
+
|
||||
+#ifdef __ANDROID__
|
||||
+ /* Newer Android versions have fseeko...to meditate. */
|
||||
+ int64_t ret = lseek(fileno(mine->f), skip, whence);
|
||||
+ if (ret >= 0) {
|
||||
+ return ret;
|
||||
+ }
|
||||
+#elif HAVE__FSEEKI64
|
||||
+ if (_fseeki64(mine->f, skip, whence) == 0) {
|
||||
+ return _ftelli64(mine->f);
|
||||
+ }
|
||||
+#elif HAVE_FSEEKO
|
||||
+ if (fseeko(mine->f, skip, whence) == 0) {
|
||||
+ return ftello(mine->f);
|
||||
+ }
|
||||
+#else
|
||||
+ if (fseek(mine->f, skip, whence) == 0) {
|
||||
+ return ftell(mine->f);
|
||||
+ }
|
||||
+#endif
|
||||
+ /* If we arrive here, the input is corrupted or truncated so fail. */
|
||||
+ archive_set_error(a, errno, "Error seeking in FILE* pointer");
|
||||
+ return (ARCHIVE_FATAL);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
-file_close(struct archive *a, void *client_data)
|
||||
+FILE_close(struct archive *a, void *client_data)
|
||||
{
|
||||
struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
|
||||
|
||||
@@ -177,4 +227,4 @@ file_close(struct archive *a, void *client_data)
|
||||
free(mine->buffer);
|
||||
free(mine);
|
||||
return (ARCHIVE_OK);
|
||||
-}
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/libarchive/test/test_open_file.c b/libarchive/test/test_open_file.c
|
||||
index f4ca82bb..cc6b04d0 100644
|
||||
--- a/libarchive/test/test_open_file.c
|
||||
+++ b/libarchive/test/test_open_file.c
|
||||
@@ -32,14 +32,14 @@ DEFINE_TEST(test_open_file)
|
||||
struct archive *a;
|
||||
FILE *f;
|
||||
|
||||
- f = fopen("test.tar", "wb");
|
||||
+ f = fopen("test.7z", "wb");
|
||||
assert(f != NULL);
|
||||
if (f == NULL)
|
||||
return;
|
||||
|
||||
/* Write an archive through this FILE *. */
|
||||
assert((a = archive_write_new()) != NULL);
|
||||
- assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
|
||||
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a));
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_FILE(a, f));
|
||||
|
||||
@@ -71,9 +71,10 @@ DEFINE_TEST(test_open_file)
|
||||
fclose(f);
|
||||
|
||||
/*
|
||||
- * Now, read the data back.
|
||||
+ * Now, read the data back. 7z requiring seeking, that also
|
||||
+ * tests that the seeking support works.
|
||||
*/
|
||||
- f = fopen("test.tar", "rb");
|
||||
+ f = fopen("test.7z", "rb");
|
||||
assert(f != NULL);
|
||||
if (f == NULL)
|
||||
return;
|
||||
@@ -0,0 +1,320 @@
|
||||
From 89b8c35ff4b5addc08a85bf5df02b407f8af1f6c Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
|
||||
Date: Sun, 6 Apr 2025 22:34:37 +0200
|
||||
Subject: [PATCH] Improve lseek handling (#2564)
|
||||
|
||||
The skip functions are limited to 1 GB for cases in which libarchive
|
||||
runs on a system with an off_t or long with 32 bits. This has negative
|
||||
impact on 64 bit systems.
|
||||
|
||||
Instead, make sure that _all_ subsequent functions truncate properly.
|
||||
Some of them already did and some had regressions for over 10 years.
|
||||
|
||||
Tests pass on Debian 12 i686 configured with --disable-largefile, i.e.
|
||||
running with an off_t with 32 bits.
|
||||
|
||||
Casts added where needed to still pass MSVC builds.
|
||||
|
||||
---------
|
||||
|
||||
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/89b8c35ff4b5addc08a85bf5df02b407f8af1f6c]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_read.c | 6 ----
|
||||
libarchive/archive_read_disk_posix.c | 3 +-
|
||||
libarchive/archive_read_open_fd.c | 29 +++++++++++++------
|
||||
libarchive/archive_read_open_file.c | 35 ++++++++++++-----------
|
||||
libarchive/archive_read_open_filename.c | 37 ++++++++++++++++++-------
|
||||
libarchive/test/read_open_memory.c | 2 +-
|
||||
libarchive/test/test_sparse_basic.c | 6 ++--
|
||||
libarchive/test/test_tar_large.c | 2 +-
|
||||
8 files changed, 75 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c
|
||||
index 822c534b..50db8701 100644
|
||||
--- a/libarchive/archive_read.c
|
||||
+++ b/libarchive/archive_read.c
|
||||
@@ -177,15 +177,9 @@ client_skip_proxy(struct archive_read_filter *self, int64_t request)
|
||||
return 0;
|
||||
|
||||
if (self->archive->client.skipper != NULL) {
|
||||
- /* Seek requests over 1GiB are broken down into
|
||||
- * multiple seeks. This avoids overflows when the
|
||||
- * requests get passed through 32-bit arguments. */
|
||||
- int64_t skip_limit = (int64_t)1 << 30;
|
||||
int64_t total = 0;
|
||||
for (;;) {
|
||||
int64_t get, ask = request;
|
||||
- if (ask > skip_limit)
|
||||
- ask = skip_limit;
|
||||
get = (self->archive->client.skipper)
|
||||
(&self->archive->archive, self->data, ask);
|
||||
total += get;
|
||||
diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
|
||||
index 09965eb9..4839d62b 100644
|
||||
--- a/libarchive/archive_read_disk_posix.c
|
||||
+++ b/libarchive/archive_read_disk_posix.c
|
||||
@@ -779,7 +779,8 @@ _archive_read_data_block(struct archive *_a, const void **buff,
|
||||
*/
|
||||
if (t->current_sparse->offset > t->entry_total) {
|
||||
if (lseek(t->entry_fd,
|
||||
- (off_t)t->current_sparse->offset, SEEK_SET) < 0) {
|
||||
+ (off_t)t->current_sparse->offset, SEEK_SET) !=
|
||||
+ t->current_sparse->offset) {
|
||||
archive_set_error(&a->archive, errno, "Seek error");
|
||||
r = ARCHIVE_FATAL;
|
||||
a->archive.state = ARCHIVE_STATE_FATAL;
|
||||
diff --git a/libarchive/archive_read_open_fd.c b/libarchive/archive_read_open_fd.c
|
||||
index debfde20..3fd536d5 100644
|
||||
--- a/libarchive/archive_read_open_fd.c
|
||||
+++ b/libarchive/archive_read_open_fd.c
|
||||
@@ -132,7 +132,7 @@ static int64_t
|
||||
file_skip(struct archive *a, void *client_data, int64_t request)
|
||||
{
|
||||
struct read_fd_data *mine = (struct read_fd_data *)client_data;
|
||||
- int64_t skip = request;
|
||||
+ off_t skip = (off_t)request;
|
||||
int64_t old_offset, new_offset;
|
||||
int skip_bits = sizeof(skip) * 8 - 1; /* off_t is a signed type. */
|
||||
|
||||
@@ -141,15 +141,15 @@ file_skip(struct archive *a, void *client_data, int64_t request)
|
||||
|
||||
/* Reduce a request that would overflow the 'skip' variable. */
|
||||
if (sizeof(request) > sizeof(skip)) {
|
||||
- int64_t max_skip =
|
||||
+ const int64_t max_skip =
|
||||
(((int64_t)1 << (skip_bits - 1)) - 1) * 2 + 1;
|
||||
if (request > max_skip)
|
||||
- skip = max_skip;
|
||||
+ skip = (off_t)max_skip;
|
||||
}
|
||||
|
||||
- /* Reduce request to the next smallest multiple of block_size */
|
||||
- request = (request / mine->block_size) * mine->block_size;
|
||||
- if (request == 0)
|
||||
+ /* Reduce 'skip' to the next smallest multiple of block_size */
|
||||
+ skip = (off_t)(((int64_t)skip / mine->block_size) * mine->block_size);
|
||||
+ if (skip == 0)
|
||||
return (0);
|
||||
|
||||
if (((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0) &&
|
||||
@@ -179,11 +179,24 @@ static int64_t
|
||||
file_seek(struct archive *a, void *client_data, int64_t request, int whence)
|
||||
{
|
||||
struct read_fd_data *mine = (struct read_fd_data *)client_data;
|
||||
+ off_t seek = (off_t)request;
|
||||
int64_t r;
|
||||
+ int seek_bits = sizeof(seek) * 8 - 1; /* off_t is a signed type. */
|
||||
|
||||
/* We use off_t here because lseek() is declared that way. */
|
||||
- /* See above for notes about when off_t is less than 64 bits. */
|
||||
- r = lseek(mine->fd, request, whence);
|
||||
+
|
||||
+ /* Reduce a request that would overflow the 'seek' variable. */
|
||||
+ if (sizeof(request) > sizeof(seek)) {
|
||||
+ const int64_t max_seek =
|
||||
+ (((int64_t)1 << (seek_bits - 1)) - 1) * 2 + 1;
|
||||
+ const int64_t min_seek = ~max_seek;
|
||||
+ if (request > max_seek)
|
||||
+ seek = (off_t)max_seek;
|
||||
+ else if (request < min_seek)
|
||||
+ seek = (off_t)min_seek;
|
||||
+ }
|
||||
+
|
||||
+ r = lseek(mine->fd, seek, whence);
|
||||
if (r >= 0)
|
||||
return r;
|
||||
|
||||
diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c
|
||||
index ecd56dce..2829b9a5 100644
|
||||
--- a/libarchive/archive_read_open_file.c
|
||||
+++ b/libarchive/archive_read_open_file.c
|
||||
@@ -146,7 +146,7 @@ FILE_skip(struct archive *a, void *client_data, int64_t request)
|
||||
|
||||
/* If request is too big for a long or an off_t, reduce it. */
|
||||
if (sizeof(request) > sizeof(skip)) {
|
||||
- int64_t max_skip =
|
||||
+ const int64_t max_skip =
|
||||
(((int64_t)1 << (skip_bits - 1)) - 1) * 2 + 1;
|
||||
if (request > max_skip)
|
||||
skip = max_skip;
|
||||
@@ -177,39 +177,42 @@ FILE_seek(struct archive *a, void *client_data, int64_t request, int whence)
|
||||
{
|
||||
struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
|
||||
#if HAVE__FSEEKI64
|
||||
- int64_t skip = request;
|
||||
+ int64_t seek = request;
|
||||
#elif HAVE_FSEEKO
|
||||
- off_t skip = (off_t)request;
|
||||
+ off_t seek = (off_t)request;
|
||||
#else
|
||||
- long skip = (long)request;
|
||||
+ long seek = (long)request;
|
||||
#endif
|
||||
- int skip_bits = sizeof(skip) * 8 - 1;
|
||||
+ int seek_bits = sizeof(seek) * 8 - 1;
|
||||
(void)a; /* UNUSED */
|
||||
|
||||
- /* If request is too big for a long or an off_t, reduce it. */
|
||||
- if (sizeof(request) > sizeof(skip)) {
|
||||
- int64_t max_skip =
|
||||
- (((int64_t)1 << (skip_bits - 1)) - 1) * 2 + 1;
|
||||
- if (request > max_skip)
|
||||
- skip = max_skip;
|
||||
+ /* Reduce a request that would overflow the 'seek' variable. */
|
||||
+ if (sizeof(request) > sizeof(seek)) {
|
||||
+ const int64_t max_seek =
|
||||
+ (((int64_t)1 << (seek_bits - 1)) - 1) * 2 + 1;
|
||||
+ const int64_t min_seek = ~max_seek;
|
||||
+ if (request > max_seek)
|
||||
+ seek = max_seek;
|
||||
+ else if (request < min_seek)
|
||||
+ seek = min_seek;
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
/* Newer Android versions have fseeko...to meditate. */
|
||||
- int64_t ret = lseek(fileno(mine->f), skip, whence);
|
||||
+ int64_t ret = lseek(fileno(mine->f), seek, whence);
|
||||
if (ret >= 0) {
|
||||
return ret;
|
||||
}
|
||||
#elif HAVE__FSEEKI64
|
||||
- if (_fseeki64(mine->f, skip, whence) == 0) {
|
||||
+ if (_fseeki64(mine->f, seek, whence) == 0) {
|
||||
return _ftelli64(mine->f);
|
||||
}
|
||||
#elif HAVE_FSEEKO
|
||||
- if (fseeko(mine->f, skip, whence) == 0) {
|
||||
+ if (fseeko(mine->f, seek, whence) == 0) {
|
||||
return ftello(mine->f);
|
||||
}
|
||||
#else
|
||||
- if (fseek(mine->f, skip, whence) == 0) {
|
||||
+ if (fseek(mine->f, seek, whence) == 0) {
|
||||
return ftell(mine->f);
|
||||
}
|
||||
#endif
|
||||
@@ -227,4 +230,4 @@ FILE_close(struct archive *a, void *client_data)
|
||||
free(mine->buffer);
|
||||
free(mine);
|
||||
return (ARCHIVE_OK);
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
diff --git a/libarchive/archive_read_open_filename.c b/libarchive/archive_read_open_filename.c
|
||||
index 05f0ffbd..3894b15c 100644
|
||||
--- a/libarchive/archive_read_open_filename.c
|
||||
+++ b/libarchive/archive_read_open_filename.c
|
||||
@@ -449,20 +449,24 @@ file_skip_lseek(struct archive *a, void *client_data, int64_t request)
|
||||
struct read_file_data *mine = (struct read_file_data *)client_data;
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
/* We use _lseeki64() on Windows. */
|
||||
- int64_t old_offset, new_offset;
|
||||
+ int64_t old_offset, new_offset, skip = request;
|
||||
#else
|
||||
- off_t old_offset, new_offset;
|
||||
+ off_t old_offset, new_offset, skip = (off_t)request;
|
||||
#endif
|
||||
+ int skip_bits = sizeof(skip) * 8 - 1;
|
||||
|
||||
/* We use off_t here because lseek() is declared that way. */
|
||||
|
||||
- /* TODO: Deal with case where off_t isn't 64 bits.
|
||||
- * This shouldn't be a problem on Linux or other POSIX
|
||||
- * systems, since the configuration logic for libarchive
|
||||
- * tries to obtain a 64-bit off_t.
|
||||
- */
|
||||
+ /* Reduce a request that would overflow the 'skip' variable. */
|
||||
+ if (sizeof(request) > sizeof(skip)) {
|
||||
+ const int64_t max_skip =
|
||||
+ (((int64_t)1 << (skip_bits - 1)) - 1) * 2 + 1;
|
||||
+ if (request > max_skip)
|
||||
+ skip = max_skip;
|
||||
+ }
|
||||
+
|
||||
if ((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0 &&
|
||||
- (new_offset = lseek(mine->fd, request, SEEK_CUR)) >= 0)
|
||||
+ (new_offset = lseek(mine->fd, skip, SEEK_CUR)) >= 0)
|
||||
return (new_offset - old_offset);
|
||||
|
||||
/* If lseek() fails, don't bother trying again. */
|
||||
@@ -510,11 +514,24 @@ static int64_t
|
||||
file_seek(struct archive *a, void *client_data, int64_t request, int whence)
|
||||
{
|
||||
struct read_file_data *mine = (struct read_file_data *)client_data;
|
||||
+ off_t seek = (off_t)request;
|
||||
int64_t r;
|
||||
+ int seek_bits = sizeof(seek) * 8 - 1;
|
||||
|
||||
/* We use off_t here because lseek() is declared that way. */
|
||||
- /* See above for notes about when off_t is less than 64 bits. */
|
||||
- r = lseek(mine->fd, request, whence);
|
||||
+
|
||||
+ /* Reduce a request that would overflow the 'seek' variable. */
|
||||
+ if (sizeof(request) > sizeof(seek)) {
|
||||
+ const int64_t max_seek =
|
||||
+ (((int64_t)1 << (seek_bits - 1)) - 1) * 2 + 1;
|
||||
+ const int64_t min_seek = ~max_seek;
|
||||
+ if (request > max_seek)
|
||||
+ seek = (off_t)max_seek;
|
||||
+ else if (request < min_seek)
|
||||
+ seek = (off_t)min_seek;
|
||||
+ }
|
||||
+
|
||||
+ r = lseek(mine->fd, seek, whence);
|
||||
if (r >= 0)
|
||||
return r;
|
||||
|
||||
diff --git a/libarchive/test/read_open_memory.c b/libarchive/test/read_open_memory.c
|
||||
index 6d2468cd..9262ab9d 100644
|
||||
--- a/libarchive/test/read_open_memory.c
|
||||
+++ b/libarchive/test/read_open_memory.c
|
||||
@@ -168,7 +168,7 @@ memory_read_skip(struct archive *a, void *client_data, int64_t skip)
|
||||
|
||||
(void)a; /* UNUSED */
|
||||
/* We can't skip by more than is available. */
|
||||
- if ((off_t)skip > (off_t)(mine->end - mine->p))
|
||||
+ if (skip > mine->end - mine->p)
|
||||
skip = mine->end - mine->p;
|
||||
/* Always do small skips by prime amounts. */
|
||||
if (skip > 71)
|
||||
diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c
|
||||
index 23cde567..93710cb6 100644
|
||||
--- a/libarchive/test/test_sparse_basic.c
|
||||
+++ b/libarchive/test/test_sparse_basic.c
|
||||
@@ -606,7 +606,8 @@ DEFINE_TEST(test_sparse_basic)
|
||||
verify_sparse_file(a, "file2", sparse_file2, 20);
|
||||
/* Encoded non sparse; expect a data block but no sparse entries. */
|
||||
verify_sparse_file(a, "file3", sparse_file3, 0);
|
||||
- verify_sparse_file(a, "file4", sparse_file4, 2);
|
||||
+ if (sizeof(off_t) > 4)
|
||||
+ verify_sparse_file(a, "file4", sparse_file4, 2);
|
||||
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
|
||||
@@ -633,7 +634,8 @@ DEFINE_TEST(test_sparse_basic)
|
||||
verify_sparse_file(a, "file1", sparse_file1, 0);
|
||||
verify_sparse_file(a, "file2", sparse_file2, 0);
|
||||
verify_sparse_file(a, "file3", sparse_file3, 0);
|
||||
- verify_sparse_file(a, "file4", sparse_file4, 0);
|
||||
+ if (sizeof(off_t) > 4)
|
||||
+ verify_sparse_file(a, "file4", sparse_file4, 0);
|
||||
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
|
||||
diff --git a/libarchive/test/test_tar_large.c b/libarchive/test/test_tar_large.c
|
||||
index c1f37916..1cde3218 100644
|
||||
--- a/libarchive/test/test_tar_large.c
|
||||
+++ b/libarchive/test/test_tar_large.c
|
||||
@@ -176,7 +176,7 @@ memory_read_skip(struct archive *a, void *_private, int64_t skip)
|
||||
}
|
||||
if (private->filebytes > 0) {
|
||||
if (private->filebytes < skip)
|
||||
- skip = (off_t)private->filebytes;
|
||||
+ skip = private->filebytes;
|
||||
private->filebytes -= skip;
|
||||
} else {
|
||||
skip = 0;
|
||||
@@ -0,0 +1,217 @@
|
||||
From dcbf1e0ededa95849f098d154a25876ed5754bcf Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
|
||||
Date: Tue, 15 Apr 2025 06:02:17 +0200
|
||||
Subject: [PATCH] Do not skip past EOF while reading (#2584)
|
||||
|
||||
Make sure to not skip past end of file for better error messages. One
|
||||
such example is now visible with rar testsuite. You can see the
|
||||
difference already by an actually not useless use of cat:
|
||||
|
||||
```
|
||||
$ cat .../test_read_format_rar_ppmd_use_after_free.rar | bsdtar -t
|
||||
bsdtar: Archive entry has empty or unreadable filename ... skipping.
|
||||
bsdtar: Archive entry has empty or unreadable filename ... skipping.
|
||||
bsdtar: Truncated input file (needed 119 bytes, only 0 available)
|
||||
bsdtar: Error exit delayed from previous errors.
|
||||
```
|
||||
|
||||
compared to
|
||||
|
||||
```
|
||||
$ bsdtar -tf .../test_read_format_rar_ppmd_use_after_free.rar
|
||||
bsdtar: Archive entry has empty or unreadable filename ... skipping.
|
||||
bsdtar: Archive entry has empty or unreadable filename ... skipping.
|
||||
bsdtar: Error exit delayed from previous errors.
|
||||
```
|
||||
|
||||
Since the former cannot lseek, the error is a different one
|
||||
(ARCHIVE_FATAL vs ARCHIVE_EOF). The piped version states explicitly that
|
||||
truncation occurred, while the latter states EOF because the skip past
|
||||
the end of file was successful.
|
||||
|
||||
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
|
||||
CVE: CVE-2025-5918
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/dcbf1e0ededa95849f098d154a25876ed5754bcf]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_read_open_fd.c | 13 +++++++---
|
||||
libarchive/archive_read_open_file.c | 33 +++++++++++++++++++------
|
||||
libarchive/archive_read_open_filename.c | 16 +++++++++---
|
||||
libarchive/test/test_read_format_rar.c | 6 ++---
|
||||
4 files changed, 50 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_open_fd.c b/libarchive/archive_read_open_fd.c
|
||||
index 3fd536d5..dc7c9e52 100644
|
||||
--- a/libarchive/archive_read_open_fd.c
|
||||
+++ b/libarchive/archive_read_open_fd.c
|
||||
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_fd.c 201103 2009-12-28
|
||||
struct read_fd_data {
|
||||
int fd;
|
||||
size_t block_size;
|
||||
+ int64_t size;
|
||||
char use_lseek;
|
||||
void *buffer;
|
||||
};
|
||||
@@ -96,6 +97,7 @@ archive_read_open_fd(struct archive *a, int fd, size_t block_size)
|
||||
if (S_ISREG(st.st_mode)) {
|
||||
archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
|
||||
mine->use_lseek = 1;
|
||||
+ mine->size = st.st_size;
|
||||
}
|
||||
#if defined(__CYGWIN__) || defined(_WIN32)
|
||||
setmode(mine->fd, O_BINARY);
|
||||
@@ -152,9 +154,14 @@ file_skip(struct archive *a, void *client_data, int64_t request)
|
||||
if (skip == 0)
|
||||
return (0);
|
||||
|
||||
- if (((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0) &&
|
||||
- ((new_offset = lseek(mine->fd, skip, SEEK_CUR)) >= 0))
|
||||
- return (new_offset - old_offset);
|
||||
+ if ((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0) {
|
||||
+ if (old_offset >= mine->size ||
|
||||
+ skip > mine->size - old_offset) {
|
||||
+ /* Do not seek past end of file. */
|
||||
+ errno = ESPIPE;
|
||||
+ } else if ((new_offset = lseek(mine->fd, skip, SEEK_CUR)) >= 0)
|
||||
+ return (new_offset - old_offset);
|
||||
+ }
|
||||
|
||||
/* If seek failed once, it will probably fail again. */
|
||||
mine->use_lseek = 0;
|
||||
diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c
|
||||
index 2829b9a5..6ed18a0c 100644
|
||||
--- a/libarchive/archive_read_open_file.c
|
||||
+++ b/libarchive/archive_read_open_file.c
|
||||
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_file.c 201093 2009-12-
|
||||
struct read_FILE_data {
|
||||
FILE *f;
|
||||
size_t block_size;
|
||||
+ int64_t size;
|
||||
void *buffer;
|
||||
char can_skip;
|
||||
};
|
||||
@@ -92,6 +93,7 @@ archive_read_open_FILE(struct archive *a, FILE *f)
|
||||
archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
|
||||
/* Enable the seek optimization only for regular files. */
|
||||
mine->can_skip = 1;
|
||||
+ mine->size = st.st_size;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN__) || defined(_WIN32)
|
||||
@@ -131,6 +133,7 @@ FILE_skip(struct archive *a, void *client_data, int64_t request)
|
||||
#else
|
||||
long skip = (long)request;
|
||||
#endif
|
||||
+ int64_t old_offset, new_offset;
|
||||
int skip_bits = sizeof(skip) * 8 - 1;
|
||||
|
||||
(void)a; /* UNUSED */
|
||||
@@ -154,19 +157,33 @@ FILE_skip(struct archive *a, void *client_data, int64_t request)
|
||||
|
||||
#ifdef __ANDROID__
|
||||
/* fileno() isn't safe on all platforms ... see above. */
|
||||
- if (lseek(fileno(mine->f), skip, SEEK_CUR) < 0)
|
||||
+ old_offset = lseek(fileno(mine->f), 0, SEEK_CUR);
|
||||
#elif HAVE_FSEEKO
|
||||
- if (fseeko(mine->f, skip, SEEK_CUR) != 0)
|
||||
+ old_offset = ftello(mine->f);
|
||||
#elif HAVE__FSEEKI64
|
||||
- if (_fseeki64(mine->f, skip, SEEK_CUR) != 0)
|
||||
+ old_offset = _ftelli64(mine->f);
|
||||
#else
|
||||
- if (fseek(mine->f, skip, SEEK_CUR) != 0)
|
||||
+ old_offset = ftell(mine->f);
|
||||
#endif
|
||||
- {
|
||||
- mine->can_skip = 0;
|
||||
- return (0);
|
||||
+ if (old_offset >= 0) {
|
||||
+ if (old_offset < mine->size &&
|
||||
+ skip <= mine->size - old_offset) {
|
||||
+#ifdef __ANDROID__
|
||||
+ new_offset = lseek(fileno(mine->f), skip, SEEK_CUR);
|
||||
+#elif HAVE__FSEEKI64
|
||||
+ new_offset = _fseeki64(mine->f, skip, SEEK_CUR);
|
||||
+#elif HAVE_FSEEKO
|
||||
+ new_offset = fseeko(mine->f, skip, SEEK_CUR);
|
||||
+#else
|
||||
+ new_offset = fseek(mine->f, skip, SEEK_CUR);
|
||||
+#endif
|
||||
+ if (new_offset >= 0)
|
||||
+ return (new_offset - old_offset);
|
||||
+ }
|
||||
}
|
||||
- return (request);
|
||||
+
|
||||
+ mine->can_skip = 0;
|
||||
+ return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/libarchive/archive_read_open_filename.c b/libarchive/archive_read_open_filename.c
|
||||
index 3894b15c..5f5b3f1f 100644
|
||||
--- a/libarchive/archive_read_open_filename.c
|
||||
+++ b/libarchive/archive_read_open_filename.c
|
||||
@@ -75,6 +75,7 @@ struct read_file_data {
|
||||
size_t block_size;
|
||||
void *buffer;
|
||||
mode_t st_mode; /* Mode bits for opened file. */
|
||||
+ int64_t size;
|
||||
char use_lseek;
|
||||
enum fnt_e { FNT_STDIN, FNT_MBS, FNT_WCS } filename_type;
|
||||
union {
|
||||
@@ -370,8 +371,10 @@ file_open(struct archive *a, void *client_data)
|
||||
mine->st_mode = st.st_mode;
|
||||
|
||||
/* Disk-like inputs can use lseek(). */
|
||||
- if (is_disk_like)
|
||||
+ if (is_disk_like) {
|
||||
mine->use_lseek = 1;
|
||||
+ mine->size = st.st_size;
|
||||
+ }
|
||||
|
||||
return (ARCHIVE_OK);
|
||||
fail:
|
||||
@@ -465,9 +468,14 @@ file_skip_lseek(struct archive *a, void *client_data, int64_t request)
|
||||
skip = max_skip;
|
||||
}
|
||||
|
||||
- if ((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0 &&
|
||||
- (new_offset = lseek(mine->fd, skip, SEEK_CUR)) >= 0)
|
||||
- return (new_offset - old_offset);
|
||||
+ if ((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0) {
|
||||
+ if (old_offset >= mine->size ||
|
||||
+ skip > mine->size - old_offset) {
|
||||
+ /* Do not seek past end of file. */
|
||||
+ errno = ESPIPE;
|
||||
+ } else if ((new_offset = lseek(mine->fd, skip, SEEK_CUR)) >= 0)
|
||||
+ return (new_offset - old_offset);
|
||||
+ }
|
||||
|
||||
/* If lseek() fails, don't bother trying again. */
|
||||
mine->use_lseek = 0;
|
||||
diff --git a/libarchive/test/test_read_format_rar.c b/libarchive/test/test_read_format_rar.c
|
||||
index dce567af..fce44a9d 100644
|
||||
--- a/libarchive/test/test_read_format_rar.c
|
||||
+++ b/libarchive/test/test_read_format_rar.c
|
||||
@@ -3776,8 +3776,8 @@ DEFINE_TEST(test_read_format_rar_ppmd_use_after_free)
|
||||
assertA(ARCHIVE_OK == archive_read_next_header(a, &ae));
|
||||
assertA(archive_read_data(a, buf, sizeof(buf)) <= 0);
|
||||
|
||||
- /* Test EOF */
|
||||
- assertA(1 == archive_read_next_header(a, &ae));
|
||||
+ /* Test for truncation */
|
||||
+ assertA(ARCHIVE_FATAL == archive_read_next_header(a, &ae));
|
||||
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
@@ -3803,7 +3803,7 @@ DEFINE_TEST(test_read_format_rar_ppmd_use_after_free2)
|
||||
assertA(archive_read_data(a, buf, sizeof(buf)) <= 0);
|
||||
|
||||
/* Test EOF */
|
||||
- assertA(1 == archive_read_next_header(a, &ae));
|
||||
+ assertA(ARCHIVE_FATAL == archive_read_next_header(a, &ae));
|
||||
|
||||
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
|
||||
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
|
||||
@@ -0,0 +1,51 @@
|
||||
From 51b4c35bb38b7df4af24de7f103863dd79129b01 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
Date: Tue, 27 May 2025 17:09:12 +0200
|
||||
Subject: [PATCH] Fix FILE_skip regression
|
||||
|
||||
The fseek* family of functions return 0 on success, not the new offset.
|
||||
This is only true for lseek.
|
||||
|
||||
Fixes https://github.com/libarchive/libarchive/issues/2641
|
||||
Fixes dcbf1e0ededa95849f098d154a25876ed5754bcf
|
||||
|
||||
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
|
||||
CVE: CVE-2025-5918
|
||||
Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/51b4c35bb38b7df4af24de7f103863dd79129b01]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
libarchive/archive_read_open_file.c | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c
|
||||
index 6ed18a0c..742923ab 100644
|
||||
--- a/libarchive/archive_read_open_file.c
|
||||
+++ b/libarchive/archive_read_open_file.c
|
||||
@@ -133,7 +133,7 @@ FILE_skip(struct archive *a, void *client_data, int64_t request)
|
||||
#else
|
||||
long skip = (long)request;
|
||||
#endif
|
||||
- int64_t old_offset, new_offset;
|
||||
+ int64_t old_offset, new_offset = -1;
|
||||
int skip_bits = sizeof(skip) * 8 - 1;
|
||||
|
||||
(void)a; /* UNUSED */
|
||||
@@ -171,11 +171,14 @@ FILE_skip(struct archive *a, void *client_data, int64_t request)
|
||||
#ifdef __ANDROID__
|
||||
new_offset = lseek(fileno(mine->f), skip, SEEK_CUR);
|
||||
#elif HAVE__FSEEKI64
|
||||
- new_offset = _fseeki64(mine->f, skip, SEEK_CUR);
|
||||
+ if (_fseeki64(mine->f, skip, SEEK_CUR) == 0)
|
||||
+ new_offset = _ftelli64(mine->f);
|
||||
#elif HAVE_FSEEKO
|
||||
- new_offset = fseeko(mine->f, skip, SEEK_CUR);
|
||||
+ if (fseeko(mine->f, skip, SEEK_CUR) == 0)
|
||||
+ new_offset = ftello(mine->f);
|
||||
#else
|
||||
- new_offset = fseek(mine->f, skip, SEEK_CUR);
|
||||
+ if (fseek(mine->f, skip, SEEK_CUR) == 0)
|
||||
+ new_offset = ftell(mine->f);
|
||||
#endif
|
||||
if (new_offset >= 0)
|
||||
return (new_offset - old_offset);
|
||||
@@ -39,6 +39,10 @@ SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
|
||||
file://CVE-2025-5915.patch \
|
||||
file://CVE-2025-5916.patch \
|
||||
file://CVE-2025-5917.patch \
|
||||
file://0001-FILE-seeking-support-2539.patch \
|
||||
file://0001-Improve-lseek-handling-2564.patch \
|
||||
file://CVE-2025-5918-01.patch \
|
||||
file://CVE-2025-5918-02.patch \
|
||||
"
|
||||
UPSTREAM_CHECK_URI = "http://libarchive.org/"
|
||||
|
||||
|
||||
@@ -1,55 +1,3 @@
|
||||
# FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'.
|
||||
# The following is the difference between the old and the new license text.
|
||||
# Please update the LICENSE value if needed, and summarize the changes in
|
||||
# the commit message via 'License-Update:' tag.
|
||||
# (example: 'License-Update: copyright years updated.')
|
||||
#
|
||||
# The changes:
|
||||
#
|
||||
# --- LICENSE.md
|
||||
# +++ LICENSE.md
|
||||
# @@ -1,6 +1,6 @@
|
||||
# Sudo is distributed under the following license:
|
||||
#
|
||||
# - Copyright (c) 1994-1996, 1998-2023
|
||||
# + Copyright (c) 1994-1996, 1998-2025
|
||||
# Todd C. Miller <Todd.Miller@sudo.ws>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# @@ -247,9 +247,9 @@
|
||||
#
|
||||
# The file arc4random.c bears the following license:
|
||||
#
|
||||
# - Copyright (c) 1996, David Mazieres <dm@uun.org>
|
||||
# - Copyright (c) 2008, Damien Miller <djm@openbsd.org>
|
||||
# - Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
|
||||
# + Copyright (c) 1996, David Mazieres <dm@uun.org>
|
||||
# + Copyright (c) 2008, Damien Miller <djm@openbsd.org>
|
||||
# + Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
|
||||
# Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# @@ -282,7 +282,7 @@
|
||||
#
|
||||
# The file getentropy.c bears the following license:
|
||||
#
|
||||
# - Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
|
||||
# + Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
|
||||
# Copyright (c) 2014 Bob Beck <beck@obtuse.com>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# @@ -299,7 +299,7 @@
|
||||
#
|
||||
# The embedded copy of zlib bears the following license:
|
||||
#
|
||||
# - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||
# + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
#
|
||||
#
|
||||
|
||||
require sudo.inc
|
||||
|
||||
SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
From 0885e0b26225c90534642fe911632ec0779eebee Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Fri, 28 Mar 2025 09:43:52 +0100
|
||||
Subject: [PATCH] render: Avoid 0 or less animated cursors
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Animated cursors use a series of cursors that the client can set.
|
||||
|
||||
By default, the Xserver assumes at least one cursor is specified
|
||||
while a client may actually pass no cursor at all.
|
||||
|
||||
That causes an out-of-bound read creating the animated cursor and a
|
||||
crash of the Xserver:
|
||||
|
||||
| Invalid read of size 8
|
||||
| at 0x5323F4: AnimCursorCreate (animcur.c:325)
|
||||
| by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
|
||||
| by 0x52DC80: ProcRenderDispatch (render.c:1999)
|
||||
| by 0x4A1E9D: Dispatch (dispatch.c:560)
|
||||
| by 0x4B0169: dix_main (main.c:284)
|
||||
| by 0x4287F5: main (stubmain.c:34)
|
||||
| Address 0x59aa010 is 0 bytes after a block of size 0 alloc'd
|
||||
| at 0x48468D3: reallocarray (vg_replace_malloc.c:1803)
|
||||
| by 0x52D3DA: ProcRenderCreateAnimCursor (render.c:1802)
|
||||
| by 0x52DC80: ProcRenderDispatch (render.c:1999)
|
||||
| by 0x4A1E9D: Dispatch (dispatch.c:560)
|
||||
| by 0x4B0169: dix_main (main.c:284)
|
||||
| by 0x4287F5: main (stubmain.c:34)
|
||||
|
|
||||
| Invalid read of size 2
|
||||
| at 0x5323F7: AnimCursorCreate (animcur.c:325)
|
||||
| by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
|
||||
| by 0x52DC80: ProcRenderDispatch (render.c:1999)
|
||||
| by 0x4A1E9D: Dispatch (dispatch.c:560)
|
||||
| by 0x4B0169: dix_main (main.c:284)
|
||||
| by 0x4287F5: main (stubmain.c:34)
|
||||
| Address 0x8 is not stack'd, malloc'd or (recently) free'd
|
||||
|
||||
To avoid the issue, check the number of cursors specified and return a
|
||||
BadValue error in both the proc handler (early) and the animated cursor
|
||||
creation (as this is a public function) if there is 0 or less cursor.
|
||||
|
||||
CVE-2025-49175
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: José Expósito <jexposit@redhat.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/0885e0b26225c90534642fe911632ec0779eebee]
|
||||
CVE: CVE-2025-49175
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
render/animcur.c | 3 +++
|
||||
render/render.c | 2 ++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/render/animcur.c b/render/animcur.c
|
||||
index f906cd8130..1194cee7e7 100644
|
||||
--- a/render/animcur.c
|
||||
+++ b/render/animcur.c
|
||||
@@ -305,6 +305,9 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
|
||||
int rc = BadAlloc, i;
|
||||
AnimCurPtr ac;
|
||||
|
||||
+ if (ncursor <= 0)
|
||||
+ return BadValue;
|
||||
+
|
||||
for (i = 0; i < screenInfo.numScreens; i++)
|
||||
if (!GetAnimCurScreen(screenInfo.screens[i]))
|
||||
return BadImplementation;
|
||||
diff --git a/render/render.c b/render/render.c
|
||||
index 113f6e0c5a..fe9f03c8c8 100644
|
||||
--- a/render/render.c
|
||||
+++ b/render/render.c
|
||||
@@ -1799,6 +1799,8 @@ ProcRenderCreateAnimCursor(ClientPtr client)
|
||||
ncursor =
|
||||
(client->req_len -
|
||||
(bytes_to_int32(sizeof(xRenderCreateAnimCursorReq)))) >> 1;
|
||||
+ if (ncursor <= 0)
|
||||
+ return BadValue;
|
||||
cursors = xallocarray(ncursor, sizeof(CursorPtr) + sizeof(CARD32));
|
||||
if (!cursors)
|
||||
return BadAlloc;
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
From 03731b326a80b582e48d939fe62cb1e2b10400d9 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 7 Apr 2025 16:13:34 +0200
|
||||
Subject: [PATCH] os: Do not overflow the integer size with BigRequest
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The BigRequest extension allows requests larger than the 16-bit length
|
||||
limit.
|
||||
|
||||
It uses integers for the request length and checks for the size not to
|
||||
exceed the maxBigRequestSize limit, but does so after translating the
|
||||
length to integer by multiplying the given size in bytes by 4.
|
||||
|
||||
In doing so, it might overflow the integer size limit before actually
|
||||
checking for the overflow, defeating the purpose of the test.
|
||||
|
||||
To avoid the issue, make sure to check that the request size does not
|
||||
overflow the maxBigRequestSize limit prior to any conversion.
|
||||
|
||||
The caller Dispatch() function however expects the return value to be in
|
||||
bytes, so we cannot just return the converted value in case of error, as
|
||||
that would also overflow the integer size.
|
||||
|
||||
To preserve the existing API, we use a negative value for the X11 error
|
||||
code BadLength as the function only return positive values, 0 or -1 and
|
||||
update the caller Dispatch() function to take that case into account to
|
||||
return the error code to the offending client.
|
||||
|
||||
CVE-2025-49176
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/03731b326a80b582e48d939fe62cb1e2b10400d9]
|
||||
CVE: CVE-2025-49176
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
dix/dispatch.c | 9 +++++----
|
||||
os/io.c | 4 ++++
|
||||
2 files changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dix/dispatch.c b/dix/dispatch.c
|
||||
index b3e5feacc2..2308cfe6d1 100644
|
||||
--- a/dix/dispatch.c
|
||||
+++ b/dix/dispatch.c
|
||||
@@ -527,9 +527,10 @@ Dispatch(void)
|
||||
|
||||
/* now, finally, deal with client requests */
|
||||
result = ReadRequestFromClient(client);
|
||||
- if (result <= 0) {
|
||||
- if (result < 0)
|
||||
- CloseDownClient(client);
|
||||
+ if (result == 0)
|
||||
+ break;
|
||||
+ else if (result == -1) {
|
||||
+ CloseDownClient(client);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -550,7 +551,7 @@ Dispatch(void)
|
||||
client->index,
|
||||
client->requestBuffer);
|
||||
#endif
|
||||
- if (result > (maxBigRequestSize << 2))
|
||||
+ if (result < 0 || result > (maxBigRequestSize << 2))
|
||||
result = BadLength;
|
||||
else {
|
||||
result = XaceHookDispatch(client, client->majorOp);
|
||||
diff --git a/os/io.c b/os/io.c
|
||||
index 1fffaf62c7..3e39c10e6f 100644
|
||||
--- a/os/io.c
|
||||
+++ b/os/io.c
|
||||
@@ -300,6 +300,10 @@ ReadRequestFromClient(ClientPtr client)
|
||||
needed = get_big_req_len(request, client);
|
||||
}
|
||||
client->req_len = needed;
|
||||
+ if (needed > MAXINT >> 2) {
|
||||
+ /* Check for potential integer overflow */
|
||||
+ return -(BadLength);
|
||||
+ }
|
||||
needed <<= 2; /* needed is in bytes now */
|
||||
}
|
||||
if (gotnow < needed) {
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 4fc4d76b2c7aaed61ed2653f997783a3714c4fe1 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Wed, 18 Jun 2025 08:39:02 +0200
|
||||
Subject: [PATCH] os: Check for integer overflow on BigRequest length
|
||||
|
||||
Check for another possible integer overflow once we get a complete xReq
|
||||
with BigRequest.
|
||||
|
||||
Related to CVE-2025-49176
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Suggested-by: Peter Harris <pharris2@rocketsoftware.com>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2028>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/4fc4d76b2c7aaed61ed2653f997783a3714c4fe1]
|
||||
CVE: CVE-2025-49176 #Follow-up Patch
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
os/io.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/os/io.c b/os/io.c
|
||||
index e7b76b9cea..167b40a720 100644
|
||||
--- a/os/io.c
|
||||
+++ b/os/io.c
|
||||
@@ -394,6 +394,8 @@ ReadRequestFromClient(ClientPtr client)
|
||||
needed = get_big_req_len(request, client);
|
||||
}
|
||||
client->req_len = needed;
|
||||
+ if (needed > MAXINT >> 2)
|
||||
+ return -(BadLength);
|
||||
needed <<= 2;
|
||||
}
|
||||
if (gotnow < needed) {
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From ab02fb96b1c701c3bb47617d965522c34befa6af Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 10:05:36 +0200
|
||||
Subject: [PATCH] xfixes: Check request length for SetClientDisconnectMode
|
||||
|
||||
The handler of XFixesSetClientDisconnectMode does not check the client
|
||||
request length.
|
||||
|
||||
A client could send a shorter request and read data from a former
|
||||
request.
|
||||
|
||||
Fix the issue by checking the request size matches.
|
||||
|
||||
CVE-2025-49177
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Fixes: e167299f6 - xfixes: Add ClientDisconnectMode
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/ab02fb96b1c701c3bb47617d965522c34befa6af]
|
||||
CVE: CVE-2025-49177
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
xfixes/disconnect.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xfixes/disconnect.c b/xfixes/disconnect.c
|
||||
index 7793272..209e3d8 100644
|
||||
--- a/xfixes/disconnect.c
|
||||
+++ b/xfixes/disconnect.c
|
||||
@@ -67,6 +67,7 @@ ProcXFixesSetClientDisconnectMode(ClientPtr client)
|
||||
ClientDisconnectPtr pDisconnect = GetClientDisconnect(client);
|
||||
|
||||
REQUEST(xXFixesSetClientDisconnectModeReq);
|
||||
+ REQUEST_SIZE_MATCH(xXFixesSetClientDisconnectModeReq);
|
||||
|
||||
pDisconnect->disconnect_mode = stuff->disconnect_mode;
|
||||
|
||||
@@ -80,7 +81,7 @@ SProcXFixesSetClientDisconnectMode(ClientPtr client)
|
||||
|
||||
swaps(&stuff->length);
|
||||
|
||||
- REQUEST_AT_LEAST_SIZE(xXFixesSetClientDisconnectModeReq);
|
||||
+ REQUEST_SIZE_MATCH(xXFixesSetClientDisconnectModeReq);
|
||||
|
||||
swapl(&stuff->disconnect_mode);
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From d55c54cecb5e83eaa2d56bed5cc4461f9ba318c2 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 10:46:03 +0200
|
||||
Subject: [PATCH] os: Account for bytes to ignore when sharing input buffer
|
||||
|
||||
When reading requests from the clients, the input buffer might be shared
|
||||
and used between different clients.
|
||||
|
||||
If a given client sends a full request with non-zero bytes to ignore,
|
||||
the bytes to ignore may still be non-zero even though the request is
|
||||
full, in which case the buffer could be shared with another client who's
|
||||
request will not be processed because of those bytes to ignore, leading
|
||||
to a possible hang of the other client request.
|
||||
|
||||
To avoid the issue, make sure we have zero bytes to ignore left in the
|
||||
input request when sharing the input buffer with another client.
|
||||
|
||||
CVE-2025-49178
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/d55c54cecb5e83eaa2d56bed5cc4461f9ba318c2]
|
||||
CVE: CVE-2025-49178
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
os/io.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/os/io.c b/os/io.c
|
||||
index 3e39c10e6f..e7b76b9cea 100644
|
||||
--- a/os/io.c
|
||||
+++ b/os/io.c
|
||||
@@ -441,7 +441,7 @@ ReadRequestFromClient(ClientPtr client)
|
||||
*/
|
||||
|
||||
gotnow -= needed;
|
||||
- if (!gotnow)
|
||||
+ if (!gotnow && !oci->ignoreBytes)
|
||||
AvailableInput = oc;
|
||||
if (move_header) {
|
||||
if (client->req_len < bytes_to_int32(sizeof(xBigReq) - sizeof(xReq))) {
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
From 2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 11:47:15 +0200
|
||||
Subject: [PATCH] record: Check for overflow in
|
||||
RecordSanityCheckRegisterClients()
|
||||
|
||||
The RecordSanityCheckRegisterClients() checks for the request length,
|
||||
but does not check for integer overflow.
|
||||
|
||||
A client might send a very large value for either the number of clients
|
||||
or the number of protocol ranges that will cause an integer overflow in
|
||||
the request length computation, defeating the check for request length.
|
||||
|
||||
To avoid the issue, explicitly check the number of clients against the
|
||||
limit of clients (which is much lower than an maximum integer value) and
|
||||
the number of protocol ranges (multiplied by the record length) do not
|
||||
exceed the maximum integer value.
|
||||
|
||||
This way, we ensure that the final computation for the request length
|
||||
will not overflow the maximum integer limit.
|
||||
|
||||
CVE-2025-49179
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
Upstream-Status: Backport [import from debian xorg-server_21.1.7-3+deb12u10.diff.gz
|
||||
Upstream commit https://gitlab.freedesktop.org/xorg/xserver/-/commit/2bde9ca49a8fd9a1e6697d5e7ef837870d66f5d4]
|
||||
CVE: CVE-2025-49179
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
record/record.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/record/record.c b/record/record.c
|
||||
index e123867..d57be5b 100644
|
||||
--- a/record/record.c
|
||||
+++ b/record/record.c
|
||||
@@ -45,6 +45,7 @@ and Jim Haggerty of Metheus.
|
||||
#include "inputstr.h"
|
||||
#include "eventconvert.h"
|
||||
#include "scrnintstr.h"
|
||||
+#include "opaque.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
@@ -1298,6 +1299,13 @@ RecordSanityCheckRegisterClients(RecordContextPtr pContext, ClientPtr client,
|
||||
int i;
|
||||
XID recordingClient;
|
||||
|
||||
+ /* LimitClients is 2048 at max, way less that MAXINT */
|
||||
+ if (stuff->nClients > LimitClients)
|
||||
+ return BadValue;
|
||||
+
|
||||
+ if (stuff->nRanges > (MAXINT - 4 * stuff->nClients) / SIZEOF(xRecordRange))
|
||||
+ return BadValue;
|
||||
+
|
||||
if (((client->req_len << 2) - SIZEOF(xRecordRegisterClientsReq)) !=
|
||||
4 * stuff->nClients + SIZEOF(xRecordRange) * stuff->nRanges)
|
||||
return BadLength;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 3c3a4b767b16174d3213055947ea7f4f88e10ec6 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Tue, 20 May 2025 15:18:19 +0200
|
||||
Subject: [PATCH] randr: Check for overflow in RRChangeProviderProperty()
|
||||
|
||||
A client might send a request causing an integer overflow when computing
|
||||
the total size to allocate in RRChangeProviderProperty().
|
||||
|
||||
To avoid the issue, check that total length in bytes won't exceed the
|
||||
maximum integer value.
|
||||
|
||||
CVE-2025-49180
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/3c3a4b767b16174d3213055947ea7f4f88e10ec6]
|
||||
CVE: CVE-2025-49180
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
randr/rrproviderproperty.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c
|
||||
index 69f66ed278..0c3dcd1bc5 100644
|
||||
--- a/randr/rrproviderproperty.c
|
||||
+++ b/randr/rrproviderproperty.c
|
||||
@@ -182,7 +182,8 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
|
||||
|
||||
if (mode == PropModeReplace || len > 0) {
|
||||
void *new_data = NULL, *old_data = NULL;
|
||||
-
|
||||
+ if (total_len > MAXINT / size_in_bytes)
|
||||
+ return BadValue;
|
||||
total_size = total_len * size_in_bytes;
|
||||
new_value.data = (void *) malloc(total_size);
|
||||
if (!new_value.data && total_size) {
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From 0235121c6a7a6eb247e2addb3b41ed6ef566853d Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Mon, 28 Apr 2025 14:59:46 +0200
|
||||
Subject: [PATCH] xfree86: Check for RandR provider functions
|
||||
|
||||
Changing XRandR provider properties if the driver has set no provider
|
||||
function such as the modesetting driver will cause a NULL pointer
|
||||
dereference and a crash of the Xorg server.
|
||||
|
||||
Related to CVE-2025-49180
|
||||
|
||||
This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
|
||||
reported by Julian Suleder via ERNW Vulnerability Disclosure.
|
||||
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/xserver/-/commit/0235121c6a7a6eb247e2addb3b41ed6ef566853d]
|
||||
CVE: CVE-2025-49180
|
||||
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
||||
---
|
||||
hw/xfree86/modes/xf86RandR12.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
|
||||
index ddcf5e748a..bf33da377a 100644
|
||||
--- a/hw/xfree86/modes/xf86RandR12.c
|
||||
+++ b/hw/xfree86/modes/xf86RandR12.c
|
||||
@@ -2146,7 +2146,8 @@ xf86RandR14ProviderSetProperty(ScreenPtr pScreen,
|
||||
/* If we don't have any property handler, then we don't care what the
|
||||
* user is setting properties to.
|
||||
*/
|
||||
- if (config->provider_funcs->set_property == NULL)
|
||||
+ if (config->provider_funcs == NULL ||
|
||||
+ config->provider_funcs->set_property == NULL)
|
||||
return TRUE;
|
||||
|
||||
/*
|
||||
@@ -2164,7 +2165,8 @@ xf86RandR14ProviderGetProperty(ScreenPtr pScreen,
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
|
||||
- if (config->provider_funcs->get_property == NULL)
|
||||
+ if (config->provider_funcs == NULL ||
|
||||
+ config->provider_funcs->get_property == NULL)
|
||||
return TRUE;
|
||||
|
||||
/* Should be safe even w/o vtSema */
|
||||
--
|
||||
GitLab
|
||||
|
||||
@@ -36,6 +36,14 @@ SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.pat
|
||||
file://CVE-2025-26601-3.patch \
|
||||
file://CVE-2025-26601-4.patch \
|
||||
file://CVE-2022-49737.patch \
|
||||
file://CVE-2025-49175.patch \
|
||||
file://CVE-2025-49176-1.patch \
|
||||
file://CVE-2025-49176-2.patch \
|
||||
file://CVE-2025-49177.patch \
|
||||
file://CVE-2025-49178.patch \
|
||||
file://CVE-2025-49179.patch \
|
||||
file://CVE-2025-49180-1.patch \
|
||||
file://CVE-2025-49180-2.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "38aadb735650c8024ee25211c190bf8aad844c5f59632761ab1ef4c4d5aeb152"
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
From 3ef588940eef62742d28171bf212a474206f8e03 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Niedermayer <michael@niedermayer.cc>
|
||||
Date: Mon, 15 May 2023 00:54:50 +0200
|
||||
Subject: [PATCH] avformat: add ff_match_url_ext()
|
||||
|
||||
Match url against a list of extensions similar to av_match_ext()
|
||||
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
(cherry picked from commit a7b06bfc5d20b12ff0122702c09517cf359fbb66)
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
|
||||
CVE: CVE-2023-6604 CVE-2023-6602 CVE-2023-6605
|
||||
|
||||
Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/3ef588940ee]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
libavformat/format.c | 25 +++++++++++++++++++++++++
|
||||
libavformat/internal.h | 9 +++++++++
|
||||
2 files changed, 34 insertions(+)
|
||||
|
||||
diff --git a/libavformat/format.c b/libavformat/format.c
|
||||
index 52b85c1..5e057d7 100644
|
||||
--- a/libavformat/format.c
|
||||
+++ b/libavformat/format.c
|
||||
@@ -48,6 +48,31 @@ int av_match_ext(const char *filename, const char *extensions)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int ff_match_url_ext(const char *url, const char *extensions)
|
||||
+{
|
||||
+ const char *ext;
|
||||
+ URLComponents uc;
|
||||
+ int ret;
|
||||
+ char scratchpad[128];
|
||||
+
|
||||
+ if (!url)
|
||||
+ return 0;
|
||||
+
|
||||
+ ret = ff_url_decompose(&uc, url, NULL);
|
||||
+ if (ret < 0 || !URL_COMPONENT_HAVE(uc, scheme))
|
||||
+ return ret;
|
||||
+ for (ext = uc.query; *ext != '.' && ext > uc.path; ext--)
|
||||
+ ;
|
||||
+
|
||||
+ if (*ext != '.')
|
||||
+ return 0;
|
||||
+ if (uc.query - ext > sizeof(scratchpad))
|
||||
+ return AVERROR(ENOMEM); //not enough memory in our scratchpad
|
||||
+ av_strlcpy(scratchpad, ext + 1, FFMIN(sizeof(scratchpad), uc.query - ext));
|
||||
+
|
||||
+ return av_match_name(scratchpad, extensions);
|
||||
+}
|
||||
+
|
||||
const AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
|
||||
const char *mime_type)
|
||||
{
|
||||
diff --git a/libavformat/internal.h b/libavformat/internal.h
|
||||
index bffb8e6..584b979 100644
|
||||
--- a/libavformat/internal.h
|
||||
+++ b/libavformat/internal.h
|
||||
@@ -1015,6 +1015,15 @@ int ff_unlock_avformat(void);
|
||||
*/
|
||||
void ff_format_set_url(AVFormatContext *s, char *url);
|
||||
|
||||
+/**
|
||||
+ * Return a positive value if the given url has one of the given
|
||||
+ * extensions, negative AVERROR on error, 0 otherwise.
|
||||
+ *
|
||||
+ * @param url url to check against the given extensions
|
||||
+ * @param extensions a comma-separated list of filename extensions
|
||||
+ */
|
||||
+int ff_match_url_ext(const char *url, const char *extensions);
|
||||
+
|
||||
void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]);
|
||||
|
||||
/**
|
||||
--
|
||||
2.40.0
|
||||
@@ -0,0 +1,142 @@
|
||||
From 9803800e0e8cd8e1e7695f77cfbf4e0db0abfe57 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Niedermayer <michael@niedermayer.cc>
|
||||
Date: Thu, 16 Jan 2025 01:28:46 +0100
|
||||
Subject: [PATCH] avformat/hls: Be more picky on extensions
|
||||
|
||||
This blocks disallowed extensions from probing
|
||||
It also requires all available segments to have matching extensions to the format
|
||||
mpegts is treated independent of the extension
|
||||
|
||||
It is recommended to set the whitelists correctly
|
||||
instead of depending on extensions, but this should help a bit,
|
||||
and this is easier to backport
|
||||
|
||||
Fixes: CVE-2023-6602 II. HLS Force TTY Demuxer
|
||||
Fixes: CVE-2023-6602 IV. HLS XBIN Demuxer DoS Amplification
|
||||
|
||||
The other parts of CVE-2023-6602 have been fixed by prior commits
|
||||
|
||||
Found-by: Harvey Phillips of Amazon Element55 (element55)
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
(cherry picked from commit 91d96dc8ddaebe0b6cb393f672085e6bfaf15a31)
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
|
||||
CVE: CVE-2023-6602 CVE-2023-6604 CVE-2023-6605
|
||||
|
||||
Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/9803800e0e8cd8e1e7695f77cfbf4e0db0abfe57]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
doc/demuxers.texi | 7 +++++++
|
||||
libavformat/hls.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 57 insertions(+)
|
||||
|
||||
diff --git a/doc/demuxers.texi b/doc/demuxers.texi
|
||||
index 26ae768..6e0b25e 100644
|
||||
--- a/doc/demuxers.texi
|
||||
+++ b/doc/demuxers.texi
|
||||
@@ -365,6 +365,13 @@ segment index to start live streams at (negative values are from the end).
|
||||
@item allowed_extensions
|
||||
',' separated list of file extensions that hls is allowed to access.
|
||||
|
||||
+@item extension_picky
|
||||
+This blocks disallowed extensions from probing
|
||||
+It also requires all available segments to have matching extensions to the format
|
||||
+except mpegts, which is always allowed.
|
||||
+It is recommended to set the whitelists correctly instead of depending on extensions
|
||||
+Enabled by default.
|
||||
+
|
||||
@item max_reload
|
||||
Maximum number of times a insufficient list is attempted to be reloaded.
|
||||
Default value is 1000.
|
||||
diff --git a/libavformat/hls.c b/libavformat/hls.c
|
||||
index d5e9b21..e1bb677 100644
|
||||
--- a/libavformat/hls.c
|
||||
+++ b/libavformat/hls.c
|
||||
@@ -214,6 +214,7 @@ typedef struct HLSContext {
|
||||
AVDictionary *avio_opts;
|
||||
AVDictionary *seg_format_opts;
|
||||
char *allowed_extensions;
|
||||
+ int extension_picky;
|
||||
int max_reload;
|
||||
int http_persistent;
|
||||
int http_multiple;
|
||||
@@ -716,6 +717,40 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int test_segment(AVFormatContext *s, const AVInputFormat *in_fmt, struct playlist *pls, struct segment *seg)
|
||||
+{
|
||||
+ HLSContext *c = s->priv_data;
|
||||
+ int matchA = 3;
|
||||
+ int matchF = 0;
|
||||
+
|
||||
+ if (!c->extension_picky)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (strcmp(c->allowed_extensions, "ALL"))
|
||||
+ matchA = av_match_ext (seg->url, c->allowed_extensions)
|
||||
+ + 2*(ff_match_url_ext(seg->url, c->allowed_extensions) > 0);
|
||||
+
|
||||
+ if (!matchA) {
|
||||
+ av_log(s, AV_LOG_ERROR, "URL %s is not in allowed_extensions\n", seg->url);
|
||||
+ return AVERROR_INVALIDDATA;
|
||||
+ }
|
||||
+
|
||||
+ if (in_fmt) {
|
||||
+ if (in_fmt->extensions) {
|
||||
+ matchF = av_match_ext( seg->url, in_fmt->extensions)
|
||||
+ + 2*(ff_match_url_ext(seg->url, in_fmt->extensions) > 0);
|
||||
+ } else if (!strcmp(in_fmt->name, "mpegts"))
|
||||
+ matchF = 3;
|
||||
+
|
||||
+ if (!(matchA & matchF)) {
|
||||
+ av_log(s, AV_LOG_ERROR, "detected format extension %s mismatches allowed extensions in url %s\n", in_fmt->extensions ? in_fmt->extensions : "none", seg->url);
|
||||
+ return AVERROR_INVALIDDATA;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int parse_playlist(HLSContext *c, const char *url,
|
||||
struct playlist *pls, AVIOContext *in)
|
||||
{
|
||||
@@ -959,6 +994,14 @@ static int parse_playlist(HLSContext *c, const char *url,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ ret = test_segment(c->ctx, pls->ctx ? pls->ctx->iformat : NULL, pls, seg);
|
||||
+ if (ret < 0) {
|
||||
+ av_free(seg->url);
|
||||
+ av_free(seg->key);
|
||||
+ av_free(seg);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
if (duration < 0.001 * AV_TIME_BASE) {
|
||||
av_log(c->ctx, AV_LOG_WARNING, "Cannot get correct #EXTINF value of segment %s,"
|
||||
" set to default value to 1ms.\n", seg->url);
|
||||
@@ -2040,6 +2083,11 @@ static int hls_read_header(AVFormatContext *s)
|
||||
pls->ctx->interrupt_callback = s->interrupt_callback;
|
||||
url = av_strdup(pls->segments[0]->url);
|
||||
ret = av_probe_input_buffer(&pls->pb.pub, &in_fmt, url, NULL, 0, 0);
|
||||
+
|
||||
+ for (int n = 0; n < pls->n_segments; n++)
|
||||
+ if (ret >= 0)
|
||||
+ ret = test_segment(s, in_fmt, pls, pls->segments[n]);
|
||||
+
|
||||
if (ret < 0) {
|
||||
/* Free the ctx - it isn't initialized properly at this point,
|
||||
* so avformat_close_input shouldn't be called. If
|
||||
@@ -2467,6 +2515,8 @@ static const AVOption hls_options[] = {
|
||||
OFFSET(allowed_extensions), AV_OPT_TYPE_STRING,
|
||||
{.str = "3gp,aac,avi,ac3,eac3,flac,mkv,m3u8,m4a,m4s,m4v,mpg,mov,mp2,mp3,mp4,mpeg,mpegts,ogg,ogv,oga,ts,vob,wav"},
|
||||
INT_MIN, INT_MAX, FLAGS},
|
||||
+ {"extension_picky", "Be picky with all extensions matching",
|
||||
+ OFFSET(extension_picky), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS},
|
||||
{"max_reload", "Maximum number of times a insufficient list is attempted to be reloaded",
|
||||
OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, FLAGS},
|
||||
{"m3u8_hold_counters", "The maximum number of times to load m3u8 when it refreshes without new segments",
|
||||
--
|
||||
2.40.0
|
||||
@@ -0,0 +1,45 @@
|
||||
From 800f5f818e858c864db86c174114d13f44d59044 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Niedermayer <michael@niedermayer.cc>
|
||||
Date: Thu, 16 Jan 2025 00:22:05 +0100
|
||||
Subject: [PATCH] avformat/dashdec: Check whitelist
|
||||
|
||||
Fixes: CVE-2023-6602, V. DASH Playlist SSRF
|
||||
|
||||
Found-by: Harvey Phillips of Amazon Element55 (element55)
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
(cherry picked from commit 4c96d6bf75357ab13808efc9f08c1b41b1bf5bdf)
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
|
||||
CVE: CVE-2023-6602 CVE-2023-6604 CVE-2023-6604
|
||||
|
||||
Upstream-Status: Backport [https://github.com/FFmpeg/FFmpeg/commit/097131a6474bd6294ff337fa92025df60dff907a]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
libavformat/dashdec.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
|
||||
index 797fe74..78118de 100644
|
||||
--- a/libavformat/dashdec.c
|
||||
+++ b/libavformat/dashdec.c
|
||||
@@ -442,7 +442,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
|
||||
av_freep(pb);
|
||||
av_dict_copy(&tmp, *opts, 0);
|
||||
av_dict_copy(&tmp, opts2, 0);
|
||||
- ret = avio_open2(pb, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp);
|
||||
+ ret = ffio_open_whitelist(pb, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp, s->protocol_whitelist, s->protocol_blacklist);
|
||||
if (ret >= 0) {
|
||||
// update cookies on http response with setcookies.
|
||||
char *new_cookies = NULL;
|
||||
@@ -1217,7 +1217,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
|
||||
close_in = 1;
|
||||
|
||||
av_dict_copy(&opts, c->avio_opts, 0);
|
||||
- ret = avio_open2(&in, url, AVIO_FLAG_READ, c->interrupt_callback, &opts);
|
||||
+ ret = ffio_open_whitelist(&in, url, AVIO_FLAG_READ, c->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist);
|
||||
av_dict_free(&opts);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
--
|
||||
2.40.0
|
||||
104
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2025-1594.patch
Normal file
104
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2025-1594.patch
Normal file
@@ -0,0 +1,104 @@
|
||||
From bedfb6eca402037f5cbb115fa767d106b8c14f1c Mon Sep 17 00:00:00 2001
|
||||
From: Lynne <dev@lynne.ee>
|
||||
Date: Sat, 8 Feb 2025 04:35:31 +0100
|
||||
Subject: [PATCH] aacenc_tns: clamp filter direction energy measurement
|
||||
|
||||
The issue is that:
|
||||
|
||||
float en[2];
|
||||
...
|
||||
tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
|
||||
for (g = 0; g < tns->n_filt[w]; g++) {
|
||||
tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];
|
||||
|
||||
When using the AAC Main profile, n_filt = 3, and slant is by
|
||||
default 2 (normal long frames), g can go above 1.
|
||||
|
||||
en is the evolution of energy in the frequency domain for every
|
||||
band at the given window. E.g. whether the energy is concentrated
|
||||
at the top of each band, or the bottom.
|
||||
|
||||
For 2-pole filters, its straightforward.
|
||||
For 3-pole filters, we need more than 2 measurements.
|
||||
|
||||
This commit properly implements support for 3-pole filters, by measuring
|
||||
the band energy across three areas.
|
||||
|
||||
Do note that even xHE-AAC caps n_filt to 2, and only AAC Main allows
|
||||
n_filt == 3.
|
||||
|
||||
Fixes https://trac.ffmpeg.org/ticket/11418
|
||||
|
||||
CVE: CVE-2025-1594
|
||||
|
||||
Upstream-Status: Backport [https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/bedfb6eca402037f5cbb115fa767d106b8c14f1c]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
libavcodec/aacenc_tns.c | 33 ++++++++++++++++++++++++---------
|
||||
1 file changed, 24 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c
|
||||
index 8dc6dfc..9ea3506 100644
|
||||
--- a/libavcodec/aacenc_tns.c
|
||||
+++ b/libavcodec/aacenc_tns.c
|
||||
@@ -172,6 +172,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
|
||||
sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2;
|
||||
const int sfb_len = sfb_end - sfb_start;
|
||||
const int coef_len = sce->ics.swb_offset[sfb_end] - sce->ics.swb_offset[sfb_start];
|
||||
+ const int n_filt = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
|
||||
|
||||
if (coef_len <= 0 || sfb_len <= 0) {
|
||||
sce->tns.present = 0;
|
||||
@@ -179,16 +180,30 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
|
||||
}
|
||||
|
||||
for (w = 0; w < sce->ics.num_windows; w++) {
|
||||
- float en[2] = {0.0f, 0.0f};
|
||||
+ float en[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
int oc_start = 0, os_start = 0;
|
||||
int coef_start = sce->ics.swb_offset[sfb_start];
|
||||
|
||||
- for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {
|
||||
- FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[w*16+g];
|
||||
- if (g > sfb_start + (sfb_len/2))
|
||||
- en[1] += band->energy;
|
||||
- else
|
||||
- en[0] += band->energy;
|
||||
+ if (n_filt == 2) {
|
||||
+ for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {
|
||||
+ FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[w*16+g];
|
||||
+ if (g > sfb_start + (sfb_len/2))
|
||||
+ en[1] += band->energy; /* End */
|
||||
+ else
|
||||
+ en[0] += band->energy; /* Start */
|
||||
+ }
|
||||
+ en[2] = en[0];
|
||||
+ } else {
|
||||
+ for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {
|
||||
+ FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[w*16+g];
|
||||
+ if (g > sfb_start + (sfb_len/2) + (sfb_len/4))
|
||||
+ en[2] += band->energy; /* End */
|
||||
+ else if (g > sfb_start + (sfb_len/2) - (sfb_len/4))
|
||||
+ en[1] += band->energy; /* Middle */
|
||||
+ else
|
||||
+ en[0] += band->energy; /* Start */
|
||||
+ }
|
||||
+ en[3] = en[0];
|
||||
}
|
||||
|
||||
/* LPC */
|
||||
@@ -198,9 +213,9 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
|
||||
if (!order || !isfinite(gain) || gain < TNS_GAIN_THRESHOLD_LOW || gain > TNS_GAIN_THRESHOLD_HIGH)
|
||||
continue;
|
||||
|
||||
- tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
|
||||
+ tns->n_filt[w] = n_filt;
|
||||
for (g = 0; g < tns->n_filt[w]; g++) {
|
||||
- tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];
|
||||
+ tns->direction[w][g] = slant != 2 ? slant : en[g] < en[g + 1];
|
||||
tns->order[w][g] = g < tns->n_filt[w] ? order/tns->n_filt[w] : order - oc_start;
|
||||
tns->length[w][g] = g < tns->n_filt[w] ? sfb_len/tns->n_filt[w] : sfb_len - os_start;
|
||||
quantize_coefs(&coefs[oc_start], tns->coef_idx[w][g], tns->coef[w][g],
|
||||
--
|
||||
2.40.0
|
||||
52
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2025-7700.patch
Normal file
52
meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2025-7700.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From aad4b59cfee1f0a3cf02f5e2b1f291ce013bf27e Mon Sep 17 00:00:00 2001
|
||||
From: Jiasheng Jiang <jiashengjiangcool@gmail.com>
|
||||
Date: Thu, 10 Jul 2025 16:26:39 +0000
|
||||
Subject: [PATCH] libavcodec/alsdec.c: Add check for av_malloc_array() and
|
||||
av_calloc()
|
||||
|
||||
Add check for the return value of av_malloc_array() and av_calloc()
|
||||
to avoid potential NULL pointer dereference.
|
||||
|
||||
Fixes: dcfd24b10c ("avcodec/alsdec: Implement floating point sample data decoding")
|
||||
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
(cherry picked from commit 35a6de137a39f274d5e01ed0e0e6c4f04d0aaf07)
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
|
||||
CVE: CVE-2025-7700
|
||||
|
||||
Upstream-Status: Backport [https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/aad4b59cfee1f0a3cf02f5e2b1f291ce013bf27e]
|
||||
|
||||
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
|
||||
---
|
||||
libavcodec/alsdec.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
|
||||
index 9c3be4e..ba85973 100644
|
||||
--- a/libavcodec/alsdec.c
|
||||
+++ b/libavcodec/alsdec.c
|
||||
@@ -2115,8 +2115,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
ctx->nbits = av_malloc_array(ctx->cur_frame_length, sizeof(*ctx->nbits));
|
||||
ctx->mlz = av_mallocz(sizeof(*ctx->mlz));
|
||||
|
||||
- if (!ctx->mlz || !ctx->acf || !ctx->shift_value || !ctx->last_shift_value
|
||||
- || !ctx->last_acf_mantissa || !ctx->raw_mantissa) {
|
||||
+ if (!ctx->larray || !ctx->nbits || !ctx->mlz || !ctx->acf || !ctx->shift_value
|
||||
+ || !ctx->last_shift_value || !ctx->last_acf_mantissa || !ctx->raw_mantissa) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
@@ -2127,6 +2127,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
|
||||
for (c = 0; c < avctx->channels; ++c) {
|
||||
ctx->raw_mantissa[c] = av_calloc(ctx->cur_frame_length, sizeof(**ctx->raw_mantissa));
|
||||
+ if (!ctx->raw_mantissa[c]) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
|
||||
+ return AVERROR(ENOMEM);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.40.0
|
||||
@@ -48,6 +48,11 @@ SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
|
||||
file://CVE-2025-25473.patch \
|
||||
file://CVE-2025-22919.patch \
|
||||
file://CVE-2025-22921.patch \
|
||||
file://CVE-2025-7700.patch \
|
||||
file://CVE-2023-6602-CVE-2023-6604-CVE-2023-6605-0001.patch \
|
||||
file://CVE-2023-6602-CVE-2023-6604-CVE-2023-6605-0002.patch \
|
||||
file://CVE-2023-6602-CVE-2023-6604-CVE-2023-6605-0003.patch \
|
||||
file://CVE-2025-1594.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "04c70c377de233a4b217c2fdf76b19aeb225a287daeb2348bccd978c47b1a1db"
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
From da4380c4df0e00f8d0bad569927bfc7ea35ec37d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Thu, 8 May 2025 12:46:40 +0300
|
||||
Subject: [PATCH] subparse: Make sure that subrip time string is not too long
|
||||
before zero-padding
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4419
|
||||
Fixes CVE-2025-47806
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9135>
|
||||
|
||||
CVE: CVE-2025-47806
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/da4380c4df0e00f8d0bad569927bfc7ea35ec37d]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/subparse/gstsubparse.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
|
||||
index 1d8fa51..81a7f65 100644
|
||||
--- a/gst/subparse/gstsubparse.c
|
||||
+++ b/gst/subparse/gstsubparse.c
|
||||
@@ -850,7 +850,7 @@ parse_subrip_time (const gchar * ts_string, GstClockTime * t)
|
||||
g_strdelimit (s, " ", '0');
|
||||
g_strdelimit (s, ".", ',');
|
||||
|
||||
- /* make sure we have exactly three digits after he comma */
|
||||
+ /* make sure we have exactly three digits after the comma */
|
||||
p = strchr (s, ',');
|
||||
if (p == NULL) {
|
||||
/* If there isn't a ',' the timestamp is broken */
|
||||
@@ -859,6 +859,15 @@ parse_subrip_time (const gchar * ts_string, GstClockTime * t)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ /* Check if the comma is too far into the string to avoid
|
||||
+ * stack overflow when zero-padding the sub-second part.
|
||||
+ *
|
||||
+ * Allow for 3 digits of hours just in case. */
|
||||
+ if ((p - s) > sizeof ("hhh:mm:ss,")) {
|
||||
+ GST_WARNING ("failed to parse subrip timestamp string '%s'", s);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
++p;
|
||||
len = strlen (p);
|
||||
if (len > 3) {
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From 9e2238adc1cad1fba5aad23bc8c2a6c2a65794d2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Thu, 8 May 2025 09:14:15 +0300
|
||||
Subject: [PATCH] subparse: Check for valid UTF-8 before cleaning up lines and
|
||||
check for regex replace errors
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4418
|
||||
Fixes CVE-2025-47807
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9132>
|
||||
|
||||
CVE: CVE-2025-47807
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/9e2238adc1cad1fba5aad23bc8c2a6c2a65794d2]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/subparse/gstsubparse.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
|
||||
index 81a7f65..5e8769c 100644
|
||||
--- a/gst/subparse/gstsubparse.c
|
||||
+++ b/gst/subparse/gstsubparse.c
|
||||
@@ -666,6 +666,12 @@ subrip_unescape_formatting (gchar * txt, gconstpointer allowed_tags_ptr,
|
||||
res = g_regex_replace (tag_regex, txt, strlen (txt), 0,
|
||||
replace_pattern, 0, NULL);
|
||||
|
||||
+ /* Replacing can fail. Return an empty string in that case. */
|
||||
+ if (!res) {
|
||||
+ strcpy (txt, "");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* res will always be shorter than the input or identical, so this
|
||||
* copy is OK */
|
||||
strcpy (txt, res);
|
||||
@@ -1046,6 +1052,10 @@ parse_subrip (ParserState * state, const gchar * line)
|
||||
g_string_append_c (state->buf, '\n');
|
||||
g_string_append (state->buf, line);
|
||||
if (strlen (line) == 0) {
|
||||
+ if (!g_utf8_validate (state->buf->str, state->buf->len, NULL)) {
|
||||
+ g_string_truncate (state->buf, 0);
|
||||
+ return NULL;
|
||||
+ }
|
||||
ret = g_markup_escape_text (state->buf->str, state->buf->len);
|
||||
g_string_truncate (state->buf, 0);
|
||||
state->state = 0;
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 6b19f117518a765a25c99d1c4b09f2838a8ed0c9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Thu, 8 May 2025 09:04:52 +0300
|
||||
Subject: [PATCH] tmplayer: Don't append NULL + 1 to the string buffer when
|
||||
parsing lines without text
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4417
|
||||
Fixes CVE-2025-47808
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9132>
|
||||
|
||||
CVE: CVE-2025-47808
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/6b19f117518a765a25c99d1c4b09f2838a8ed0c9]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/subparse/tmplayerparse.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gst/subparse/tmplayerparse.c b/gst/subparse/tmplayerparse.c
|
||||
index 807e332..a9225d3 100644
|
||||
--- a/gst/subparse/tmplayerparse.c
|
||||
+++ b/gst/subparse/tmplayerparse.c
|
||||
@@ -125,7 +125,9 @@ tmplayer_parse_line (ParserState * state, const gchar * line, guint line_num)
|
||||
* durations from the start times anyway, so as long as the parser just
|
||||
* forwards state->start_time by duration after it pushes the line we
|
||||
* are about to return it will all be good. */
|
||||
- g_string_append (state->buf, text_start + 1);
|
||||
+ if (text_start) {
|
||||
+ g_string_append (state->buf, text_start + 1);
|
||||
+ }
|
||||
} else if (line_num > 0) {
|
||||
GST_WARNING ("end of subtitle unit but no valid start time?!");
|
||||
}
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -20,6 +20,9 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-ba
|
||||
file://CVE-2024-47615-1.patch \
|
||||
file://CVE-2024-47615-2.patch \
|
||||
file://CVE-2024-47835.patch \
|
||||
file://CVE-2025-47806.patch \
|
||||
file://CVE-2025-47808.patch \
|
||||
file://CVE-2025-47807.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "fde6696a91875095d82c1012b5777c28ba926047ffce08508e12c1d2c66f0057"
|
||||
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
From c4d0f4bbd9a8e97f119a4528b9f4662a6b80922c Mon Sep 17 00:00:00 2001
|
||||
From: Jochen Henneberg <jochen@centricular.com>
|
||||
Date: Tue, 10 Dec 2024 21:34:48 +0100
|
||||
Subject: [PATCH] qtdemux: Use mvhd transform matrix and support for flipping
|
||||
|
||||
The mvhd matrix is now combined with the tkhd matrix. The combined
|
||||
matrix is then checked if it matches one of the standard values for
|
||||
GST_TAG_IMAGE_ORIENTATION.
|
||||
This check now includes matrices with flipping.
|
||||
|
||||
Fixes #4064
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8127.
|
||||
|
||||
CVE: CVE-2025-47183
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/c4d0f4bbd9a8e97f119a4528b9f4662a6b80922c]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/isomp4/qtdemux.c | 53 ++++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 49 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
|
||||
index bacf7d5..a5b28f5 100644
|
||||
--- a/gst/isomp4/qtdemux.c
|
||||
+++ b/gst/isomp4/qtdemux.c
|
||||
@@ -10555,6 +10555,23 @@ qtdemux_parse_transformation_matrix (GstQTDemux * qtdemux,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+static void
|
||||
+qtdemux_mul_transformation_matrix (GstQTDemux * qtdemux,
|
||||
+ guint32 * a, guint32 * b, guint32 * c)
|
||||
+{
|
||||
+#define QTMUL_MATRIX(_a,_b) (((_a) == 0 || (_b) == 0) ? 0 : \
|
||||
+ ((_a) == (_b) ? 1 : -1))
|
||||
+#define QTADD_MATRIX(_a,_b) ((_a) + (_b) > 0 ? (1U << 16) : \
|
||||
+ ((_a) + (_b) < 0) ? (G_MAXUINT16 << 16) : 0u)
|
||||
+
|
||||
+ c[2] = c[5] = c[6] = c[7] = 0;
|
||||
+ c[0] = QTADD_MATRIX (QTMUL_MATRIX (a[0], b[0]), QTMUL_MATRIX (a[1], b[3]));
|
||||
+ c[1] = QTADD_MATRIX (QTMUL_MATRIX (a[0], b[1]), QTMUL_MATRIX (a[1], b[4]));
|
||||
+ c[3] = QTADD_MATRIX (QTMUL_MATRIX (a[3], b[0]), QTMUL_MATRIX (a[4], b[3]));
|
||||
+ c[4] = QTADD_MATRIX (QTMUL_MATRIX (a[3], b[1]), QTMUL_MATRIX (a[4], b[4]));
|
||||
+ c[8] = a[8];
|
||||
+}
|
||||
+
|
||||
static void
|
||||
qtdemux_inspect_transformation_matrix (GstQTDemux * qtdemux,
|
||||
QtDemuxStream * stream, guint32 * matrix, GstTagList ** taglist)
|
||||
@@ -10583,6 +10600,14 @@ qtdemux_inspect_transformation_matrix (GstQTDemux * qtdemux,
|
||||
rotation_tag = "rotate-180";
|
||||
} else if (QTCHECK_MATRIX (matrix, 0, G_MAXUINT16, 1, 0)) {
|
||||
rotation_tag = "rotate-270";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, G_MAXUINT16, 0, 0, 1)) {
|
||||
+ rotation_tag = "flip-rotate-0";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, 0, G_MAXUINT16, 1, 0)) {
|
||||
+ rotation_tag = "flip-rotate-90";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, 1, 0, 0, G_MAXUINT16)) {
|
||||
+ rotation_tag = "flip-rotate-180";
|
||||
+ } else if (QTCHECK_MATRIX (matrix, 0, 1, 1, 0)) {
|
||||
+ rotation_tag = "flip-rotate-270";
|
||||
} else {
|
||||
GST_FIXME_OBJECT (qtdemux, "Unhandled transformation matrix values");
|
||||
}
|
||||
@@ -10869,7 +10894,7 @@ qtdemux_parse_stereo_svmi_atom (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
||||
* traks that do not decode to something (like strm traks) will not have a pad.
|
||||
*/
|
||||
static gboolean
|
||||
-qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||
+qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
||||
{
|
||||
GstByteReader tkhd;
|
||||
int offset;
|
||||
@@ -11041,15 +11066,21 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
|
||||
|
||||
/* parse rest of tkhd */
|
||||
if (stream->subtype == FOURCC_vide) {
|
||||
+ guint32 tkhd_matrix[9];
|
||||
guint32 matrix[9];
|
||||
|
||||
/* version 1 uses some 64-bit ints */
|
||||
if (!gst_byte_reader_skip (&tkhd, 20 + value_size))
|
||||
goto corrupt_file;
|
||||
|
||||
- if (!qtdemux_parse_transformation_matrix (qtdemux, &tkhd, matrix, "tkhd"))
|
||||
+ if (!qtdemux_parse_transformation_matrix (qtdemux, &tkhd, tkhd_matrix,
|
||||
+ "tkhd"))
|
||||
goto corrupt_file;
|
||||
|
||||
+ /* calculate the final matrix from the mvhd_matrix and the tkhd matrix */
|
||||
+ qtdemux_mul_transformation_matrix (qtdemux, mvhd_matrix, tkhd_matrix,
|
||||
+ matrix);
|
||||
+
|
||||
if (!gst_byte_reader_get_uint32_be (&tkhd, &w)
|
||||
|| !gst_byte_reader_get_uint32_be (&tkhd, &h))
|
||||
goto corrupt_file;
|
||||
@@ -13800,11 +13831,14 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
guint64 creation_time;
|
||||
GstDateTime *datetime = NULL;
|
||||
gint version;
|
||||
+ GstByteReader mvhd_reader;
|
||||
+ guint32 matrix[9];
|
||||
|
||||
/* make sure we have a usable taglist */
|
||||
qtdemux->tag_list = gst_tag_list_make_writable (qtdemux->tag_list);
|
||||
|
||||
- mvhd = qtdemux_tree_get_child_by_type (qtdemux->moov_node, FOURCC_mvhd);
|
||||
+ mvhd = qtdemux_tree_get_child_by_type_full (qtdemux->moov_node,
|
||||
+ FOURCC_mvhd, &mvhd_reader);
|
||||
if (mvhd == NULL) {
|
||||
GST_LOG_OBJECT (qtdemux, "No mvhd node found, looking for redirects.");
|
||||
return qtdemux_parse_redirects (qtdemux);
|
||||
@@ -13815,15 +13849,26 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
creation_time = QT_UINT64 ((guint8 *) mvhd->data + 12);
|
||||
qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 28);
|
||||
qtdemux->duration = QT_UINT64 ((guint8 *) mvhd->data + 32);
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4 + 8 + 8 + 4 + 8))
|
||||
+ return FALSE;
|
||||
} else if (version == 0) {
|
||||
creation_time = QT_UINT32 ((guint8 *) mvhd->data + 12);
|
||||
qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 20);
|
||||
qtdemux->duration = QT_UINT32 ((guint8 *) mvhd->data + 24);
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4 + 4 + 4 + 4 + 4))
|
||||
+ return FALSE;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (qtdemux, "Unhandled mvhd version %d", version);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4 + 2 + 2 + 2 * 4))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ if (!qtdemux_parse_transformation_matrix (qtdemux, &mvhd_reader, matrix,
|
||||
+ "mvhd"))
|
||||
+ return FALSE;
|
||||
+
|
||||
/* Moving qt creation time (secs since 1904) to unix time */
|
||||
if (creation_time != 0) {
|
||||
/* Try to use epoch first as it should be faster and more commonly found */
|
||||
@@ -13892,7 +13937,7 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
/* parse all traks */
|
||||
trak = qtdemux_tree_get_child_by_type (qtdemux->moov_node, FOURCC_trak);
|
||||
while (trak) {
|
||||
- qtdemux_parse_trak (qtdemux, trak);
|
||||
+ qtdemux_parse_trak (qtdemux, trak, matrix);
|
||||
/* iterate all siblings */
|
||||
trak = qtdemux_tree_get_sibling_by_type (trak, FOURCC_trak);
|
||||
}
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From d76cae74dad89994bfcdad83da6ef1ad69074332 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Tue, 29 Apr 2025 09:43:58 +0300
|
||||
Subject: [PATCH] qtdemux: Use byte reader to parse mvhd box
|
||||
|
||||
This avoids OOB reads.
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4394
|
||||
Fixes CVE-2025-47183
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9133>
|
||||
|
||||
CVE: CVE-2025-47183
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/d76cae74dad89994bfcdad83da6ef1ad69074332]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/isomp4/qtdemux.c | 36 ++++++++++++++++++++++++++----------
|
||||
1 file changed, 26 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
|
||||
index a5b28f5..9844ac2 100644
|
||||
--- a/gst/isomp4/qtdemux.c
|
||||
+++ b/gst/isomp4/qtdemux.c
|
||||
@@ -13830,7 +13830,7 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
GNode *pssh;
|
||||
guint64 creation_time;
|
||||
GstDateTime *datetime = NULL;
|
||||
- gint version;
|
||||
+ guint8 version;
|
||||
GstByteReader mvhd_reader;
|
||||
guint32 matrix[9];
|
||||
|
||||
@@ -13844,19 +13844,35 @@ qtdemux_parse_tree (GstQTDemux * qtdemux)
|
||||
return qtdemux_parse_redirects (qtdemux);
|
||||
}
|
||||
|
||||
- version = QT_UINT8 ((guint8 *) mvhd->data + 8);
|
||||
+ if (!gst_byte_reader_get_uint8 (&mvhd_reader, &version))
|
||||
+ return FALSE;
|
||||
+ /* flags */
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 3))
|
||||
+ return FALSE;
|
||||
if (version == 1) {
|
||||
- creation_time = QT_UINT64 ((guint8 *) mvhd->data + 12);
|
||||
- qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 28);
|
||||
- qtdemux->duration = QT_UINT64 ((guint8 *) mvhd->data + 32);
|
||||
- if (!gst_byte_reader_skip (&mvhd_reader, 4 + 8 + 8 + 4 + 8))
|
||||
+ if (!gst_byte_reader_get_uint64_be (&mvhd_reader, &creation_time))
|
||||
+ return FALSE;
|
||||
+ /* modification time */
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 8))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &qtdemux->timescale))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint64_be (&mvhd_reader, &qtdemux->duration))
|
||||
return FALSE;
|
||||
} else if (version == 0) {
|
||||
- creation_time = QT_UINT32 ((guint8 *) mvhd->data + 12);
|
||||
- qtdemux->timescale = QT_UINT32 ((guint8 *) mvhd->data + 20);
|
||||
- qtdemux->duration = QT_UINT32 ((guint8 *) mvhd->data + 24);
|
||||
- if (!gst_byte_reader_skip (&mvhd_reader, 4 + 4 + 4 + 4 + 4))
|
||||
+ guint32 tmp;
|
||||
+
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &tmp))
|
||||
+ return FALSE;
|
||||
+ creation_time = tmp;
|
||||
+ /* modification time */
|
||||
+ if (!gst_byte_reader_skip (&mvhd_reader, 4))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &qtdemux->timescale))
|
||||
+ return FALSE;
|
||||
+ if (!gst_byte_reader_get_uint32_be (&mvhd_reader, &tmp))
|
||||
return FALSE;
|
||||
+ qtdemux->duration = tmp;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (qtdemux, "Unhandled mvhd version %d", version);
|
||||
return FALSE;
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From b80803943388050cb870c95934fc52feeffb94ac Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||||
Date: Sat, 3 May 2025 09:43:32 +0300
|
||||
Subject: [PATCH] qtdemux: Check if enough bytes are available for each stsd
|
||||
entry
|
||||
|
||||
There must be at least 8 bytes for the length / fourcc of each entry. After
|
||||
reading those, the length is already validated against the remaining available
|
||||
bytes.
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4407
|
||||
Fixes CVE-2025-47219
|
||||
|
||||
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9137>
|
||||
|
||||
CVE: CVE-2025-47219
|
||||
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/b80803943388050cb870c95934fc52feeffb94ac]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
---
|
||||
gst/isomp4/qtdemux.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
|
||||
index 9844ac2..0a88fb9 100644
|
||||
--- a/gst/isomp4/qtdemux.c
|
||||
+++ b/gst/isomp4/qtdemux.c
|
||||
@@ -11124,6 +11124,10 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
||||
gchar *codec = NULL;
|
||||
QtDemuxStreamStsdEntry *entry = &stream->stsd_entries[stsd_index];
|
||||
|
||||
+ /* needs at least length and fourcc */
|
||||
+ if (remaining_stsd_len < 8)
|
||||
+ goto corrupt_file;
|
||||
+
|
||||
/* and that entry should fit within stsd */
|
||||
len = QT_UINT32 (stsd_entry_data);
|
||||
if (len > remaining_stsd_len)
|
||||
--
|
||||
2.50.1
|
||||
|
||||
@@ -37,6 +37,9 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-go
|
||||
file://CVE-2024-47775_47776_47777_47778-5.patch \
|
||||
file://CVE-2024-47775_47776_47777_47778-6.patch \
|
||||
file://CVE-2024-47775_47776_47777_47778-7.patch \
|
||||
file://CVE-2025-47183-001.patch \
|
||||
file://CVE-2025-47183-002.patch \
|
||||
file://CVE-2025-47219.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "599f093cc833a1e346939ab6e78a3f8046855b6da13520aae80dd385434f4ab2"
|
||||
|
||||
47
meta/recipes-multimedia/libtiff/tiff/CVE-2024-13978.patch
Normal file
47
meta/recipes-multimedia/libtiff/tiff/CVE-2024-13978.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
From 2ebfffb0e8836bfb1cd7d85c059cd285c59761a4 Mon Sep 17 00:00:00 2001
|
||||
From: Lee Howard <faxguy@howardsilvan.com>
|
||||
Date: Sat, 5 Oct 2024 09:45:30 -0700
|
||||
Subject: [PATCH] Check TIFFTAG_TILELENGTH and TIFFTAGTILEWIDTH for valid
|
||||
input, addresses issue #650
|
||||
|
||||
CVE: CVE-2024-13978
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/2ebfffb0e8836bfb1cd7d85c059cd285c59761a4]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
tools/tiff2pdf.c | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
|
||||
index 63751f1..fef28d1 100644
|
||||
--- a/tools/tiff2pdf.c
|
||||
+++ b/tools/tiff2pdf.c
|
||||
@@ -1255,9 +1255,25 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
|
||||
TIFFGetField(input,
|
||||
TIFFTAG_TILEWIDTH,
|
||||
&( t2p->tiff_tiles[i].tiles_tilewidth) );
|
||||
+ if (t2p->tiff_tiles[i].tiles_tilewidth < 1)
|
||||
+ {
|
||||
+ TIFFError(TIFF2PDF_MODULE, "Invalid tile width (%d), %s",
|
||||
+ t2p->tiff_tiles[i].tiles_tilewidth,
|
||||
+ TIFFFileName(input));
|
||||
+ t2p->t2p_error = T2P_ERR_ERROR;
|
||||
+ return;
|
||||
+ }
|
||||
TIFFGetField(input,
|
||||
TIFFTAG_TILELENGTH,
|
||||
&( t2p->tiff_tiles[i].tiles_tilelength) );
|
||||
+ if (t2p->tiff_tiles[i].tiles_tilelength < 1)
|
||||
+ {
|
||||
+ TIFFError(TIFF2PDF_MODULE, "Invalid tile length (%d), %s",
|
||||
+ t2p->tiff_tiles[i].tiles_tilelength,
|
||||
+ TIFFFileName(input));
|
||||
+ t2p->t2p_error = T2P_ERR_ERROR;
|
||||
+ return;
|
||||
+ }
|
||||
t2p->tiff_tiles[i].tiles_tiles =
|
||||
(T2P_TILE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->tiff_tiles[i].tiles_tilecount,
|
||||
sizeof(T2P_TILE)) );
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 3994cf3b3bc6b54c32f240ca5a412cffa11633fa Mon Sep 17 00:00:00 2001
|
||||
From: Lee Howard <faxguy@howardsilvan.com>
|
||||
Date: Mon, 19 May 2025 10:53:30 -0700
|
||||
Subject: [PATCH] Don't skip the first line of the input image. Addresses
|
||||
issue #703
|
||||
|
||||
CVE: CVE-2025-8176
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/3994cf3b3bc6b54c32f240ca5a412cffa11633fa]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
tools/tiffdither.c | 4 ++--
|
||||
tools/tiffmedian.c | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tools/tiffdither.c b/tools/tiffdither.c
|
||||
index 062fd60..d352554 100644
|
||||
--- a/tools/tiffdither.c
|
||||
+++ b/tools/tiffdither.c
|
||||
@@ -95,7 +95,7 @@ fsdither(TIFF* in, TIFF* out)
|
||||
nextptr = nextline;
|
||||
for (j = 0; j < imagewidth; ++j)
|
||||
*nextptr++ = *inptr++;
|
||||
- for (i = 1; i < imagelength; ++i) {
|
||||
+ for (i = 0; i < imagelength; ++i) {
|
||||
tmpptr = thisline;
|
||||
thisline = nextline;
|
||||
nextline = tmpptr;
|
||||
@@ -138,7 +138,7 @@ fsdither(TIFF* in, TIFF* out)
|
||||
nextptr[0] += v / 16;
|
||||
}
|
||||
}
|
||||
- if (TIFFWriteScanline(out, outline, i-1, 0) < 0)
|
||||
+ if (TIFFWriteScanline(out, outline, i, 0) < 0)
|
||||
goto skip_on_error;
|
||||
}
|
||||
goto exit_label;
|
||||
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c
|
||||
index 93a1741..93e57cf 100644
|
||||
--- a/tools/tiffmedian.c
|
||||
+++ b/tools/tiffmedian.c
|
||||
@@ -844,7 +844,7 @@ quant_fsdither(TIFF* in, TIFF* out)
|
||||
outline = (unsigned char *) _TIFFmalloc(TIFFScanlineSize(out));
|
||||
|
||||
GetInputLine(in, 0, goto bad); /* get first line */
|
||||
- for (i = 1; i <= imagelength; ++i) {
|
||||
+ for (i = 0; i <= imagelength; ++i) {
|
||||
SWAP(short *, thisline, nextline);
|
||||
lastline = (i >= imax);
|
||||
if (i <= imax)
|
||||
@@ -915,7 +915,7 @@ quant_fsdither(TIFF* in, TIFF* out)
|
||||
nextptr += 3;
|
||||
}
|
||||
}
|
||||
- if (TIFFWriteScanline(out, outline, i-1, 0) < 0)
|
||||
+ if (TIFFWriteScanline(out, outline, i, 0) < 0)
|
||||
break;
|
||||
}
|
||||
bad:
|
||||
--
|
||||
2.40.0
|
||||
@@ -0,0 +1,31 @@
|
||||
From ce46f002eca4148497363f80fab33f9396bcbeda Mon Sep 17 00:00:00 2001
|
||||
From: Lee Howard <faxguy@howardsilvan.com>
|
||||
Date: Sat, 24 May 2025 21:25:16 -0700
|
||||
Subject: [PATCH] Fix tiffmedian bug #707
|
||||
|
||||
CVE: CVE-2025-8176
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/ce46f002eca4148497363f80fab33f9396bcbeda]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
tools/tiffmedian.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c
|
||||
index 93e57cf..a0b4b5d 100644
|
||||
--- a/tools/tiffmedian.c
|
||||
+++ b/tools/tiffmedian.c
|
||||
@@ -385,7 +385,10 @@ get_histogram(TIFF* in, Colorbox* box)
|
||||
}
|
||||
for (i = 0; i < imagelength; i++) {
|
||||
if (TIFFReadScanline(in, inputline, i, 0) <= 0)
|
||||
- break;
|
||||
+ {
|
||||
+ fprintf(stderr, "Error reading scanline\n");
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
inptr = inputline;
|
||||
for (j = imagewidth; j-- > 0;) {
|
||||
red = (*inptr++) & 0xff >> COLOR_SHIFT;
|
||||
--
|
||||
2.40.0
|
||||
@@ -0,0 +1,28 @@
|
||||
From ecc4ddbf1f0fed7957d1e20361e37f01907898e0 Mon Sep 17 00:00:00 2001
|
||||
From: Lee Howard <faxguy@howardsilvan.com>
|
||||
Date: Sat, 24 May 2025 21:38:09 -0700
|
||||
Subject: [PATCH] conflict resolution
|
||||
|
||||
CVE: CVE-2025-8176
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/ecc4ddbf1f0fed7957d1e20361e37f01907898e0]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
tools/tiffmedian.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/tiffmedian.c b/tools/tiffmedian.c
|
||||
index a0b4b5d..ca1c51f 100644
|
||||
--- a/tools/tiffmedian.c
|
||||
+++ b/tools/tiffmedian.c
|
||||
@@ -847,7 +847,7 @@ quant_fsdither(TIFF* in, TIFF* out)
|
||||
outline = (unsigned char *) _TIFFmalloc(TIFFScanlineSize(out));
|
||||
|
||||
GetInputLine(in, 0, goto bad); /* get first line */
|
||||
- for (i = 0; i <= imagelength; ++i) {
|
||||
+ for (i = 0; i < imagelength; ++i) {
|
||||
SWAP(short *, thisline, nextline);
|
||||
lastline = (i >= imax);
|
||||
if (i <= imax)
|
||||
--
|
||||
2.40.0
|
||||
35
meta/recipes-multimedia/libtiff/tiff/CVE-2025-8177.patch
Normal file
35
meta/recipes-multimedia/libtiff/tiff/CVE-2025-8177.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From e8de4dc1f923576dce9d625caeebd93f9db697e1 Mon Sep 17 00:00:00 2001
|
||||
From: Lee Howard <faxguy@howardsilvan.com>
|
||||
Date: Wed, 25 Jun 2025 17:14:18 +0000
|
||||
Subject: [PATCH] Fix for thumbnail issue #715
|
||||
|
||||
CVE: CVE-2025-8177
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/e8de4dc1f923576dce9d625caeebd93f9db697e1]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
tools/thumbnail.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/tools/thumbnail.c b/tools/thumbnail.c
|
||||
index 274705d..8960d36 100644
|
||||
--- a/tools/thumbnail.c
|
||||
+++ b/tools/thumbnail.c
|
||||
@@ -538,7 +538,15 @@ setrow(uint8_t* row, uint32_t nrows, const uint8_t* rows[])
|
||||
}
|
||||
acc += bits[*src & mask1];
|
||||
}
|
||||
+ if (255 * acc / area < 256)
|
||||
+ {
|
||||
*row++ = cmap[(255*acc)/area];
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ fprintf(stderr, "acc=%d, area=%d\n", acc, area);
|
||||
+ *row++ = cmap[0];
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.40.0
|
||||
60
meta/recipes-multimedia/libtiff/tiff/CVE-2025-8534.patch
Normal file
60
meta/recipes-multimedia/libtiff/tiff/CVE-2025-8534.patch
Normal file
@@ -0,0 +1,60 @@
|
||||
From 6ba36f159fd396ad11bf6b7874554197736ecc8b Mon Sep 17 00:00:00 2001
|
||||
From: Su_Laus <sulau@freenet.de>
|
||||
Date: Sat, 2 Aug 2025 18:55:54 +0200
|
||||
Subject: [PATCH] tiff2ps: check return of TIFFGetFiled() for
|
||||
TIFFTAG_STRIPBYTECOUNTS and TIFFTAG_TILEBYTECOUNTS to avoid NULL pointer
|
||||
dereference.
|
||||
|
||||
Closes #718
|
||||
|
||||
CVE: CVE-2025-8534
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/6ba36f159fd396ad11bf6b7874554197736ecc8b]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
tools/tiff2ps.c | 20 +++++++++++++++++---
|
||||
1 file changed, 17 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c
|
||||
index a598ede..05a346a 100644
|
||||
--- a/tools/tiff2ps.c
|
||||
+++ b/tools/tiff2ps.c
|
||||
@@ -2193,10 +2193,20 @@ PS_Lvl2page(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
|
||||
tiled_image = TIFFIsTiled(tif);
|
||||
if (tiled_image) {
|
||||
num_chunks = TIFFNumberOfTiles(tif);
|
||||
- TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc);
|
||||
+ if (!TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc))
|
||||
+ {
|
||||
+ TIFFError(filename,
|
||||
+ "Can't read bytecounts of tiles at PS_Lvl2page()");
|
||||
+ return (FALSE);
|
||||
+ }
|
||||
} else {
|
||||
num_chunks = TIFFNumberOfStrips(tif);
|
||||
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
|
||||
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
|
||||
+ {
|
||||
+ TIFFError(filename,
|
||||
+ "Can't read bytecounts of strips at PS_Lvl2page()");
|
||||
+ return (FALSE);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (use_rawdata) {
|
||||
@@ -2791,7 +2801,11 @@ PSRawDataBW(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
|
||||
|
||||
(void) w; (void) h;
|
||||
TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder);
|
||||
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
|
||||
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
|
||||
+ {
|
||||
+ TIFFError(filename, "Can't read bytecounts of strips at PSRawDataBW()");
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
/*
|
||||
* Find largest strip:
|
||||
--
|
||||
2.40.0
|
||||
|
||||
71
meta/recipes-multimedia/libtiff/tiff/CVE-2025-8851.patch
Normal file
71
meta/recipes-multimedia/libtiff/tiff/CVE-2025-8851.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
From 8a7a48d7a645992ca83062b3a1873c951661e2b3 Mon Sep 17 00:00:00 2001
|
||||
From: Lee Howard <faxguy@howardsilvan.com>
|
||||
Date: Sun, 11 Aug 2024 16:01:07 +0000
|
||||
Subject: [PATCH] Attempt to address tiffcrop Coverity scan issues 1605444,
|
||||
1605445, and 1605449.
|
||||
|
||||
CVE: CVE-2025-8851
|
||||
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/8a7a48d7a645992ca83062b3a1873c951661e2b3]
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
tools/tiffcrop.c | 17 ++++++++++++-----
|
||||
1 file changed, 12 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
|
||||
index 1b072d4..e16bc2d 100644
|
||||
--- a/tools/tiffcrop.c
|
||||
+++ b/tools/tiffcrop.c
|
||||
@@ -5024,7 +5024,14 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8_t *obuf, uint32_t lengt
|
||||
buff = srcbuffs[s];
|
||||
strip = (s * strips_per_sample) + j;
|
||||
bytes_read = TIFFReadEncodedStrip (in, strip, buff, stripsize);
|
||||
- rows_this_strip = (uint32_t)(bytes_read / src_rowsize);
|
||||
+ if (bytes_read < 0)
|
||||
+ {
|
||||
+ rows_this_strip = 0;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ rows_this_strip = (uint32_t)(bytes_read / src_rowsize);
|
||||
+ }
|
||||
if (bytes_read < 0 && !ignore)
|
||||
{
|
||||
TIFFError(TIFFFileName(in),
|
||||
@@ -5434,14 +5441,14 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
|
||||
rmargin = _TIFFClampDoubleToUInt32(crop->margins[3] * scale * xres);
|
||||
}
|
||||
|
||||
- if ((lmargin + rmargin) > image->width)
|
||||
+ if (lmargin == 0xFFFFFFFFU || rmargin == 0xFFFFFFFFU || (lmargin + rmargin) > image->width)
|
||||
{
|
||||
TIFFError("computeInputPixelOffsets", "Combined left and right margins exceed image width");
|
||||
lmargin = (uint32_t) 0;
|
||||
rmargin = (uint32_t) 0;
|
||||
return (-1);
|
||||
}
|
||||
- if ((tmargin + bmargin) > image->length)
|
||||
+ if (tmargin == 0xFFFFFFFFU || bmargin == 0xFFFFFFFFU || (tmargin + bmargin) > image->length)
|
||||
{
|
||||
TIFFError("computeInputPixelOffsets", "Combined top and bottom margins exceed image length");
|
||||
tmargin = (uint32_t) 0;
|
||||
@@ -5977,14 +5984,14 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
|
||||
vmargin = _TIFFClampDoubleToUInt32(page->vmargin * scale * ((image->bps + 7) / 8));
|
||||
}
|
||||
|
||||
- if ((hmargin * 2.0) > (pwidth * page->hres))
|
||||
+ if (hmargin == 0xFFFFFFFFU || (hmargin * 2.0) > (pwidth * page->hres))
|
||||
{
|
||||
TIFFError("computeOutputPixelOffsets",
|
||||
"Combined left and right margins exceed page width");
|
||||
hmargin = (uint32_t) 0;
|
||||
return (-1);
|
||||
}
|
||||
- if ((vmargin * 2.0) > (plength * page->vres))
|
||||
+ if (vmargin == 0xFFFFFFFFU || (vmargin * 2.0) > (plength * page->vres))
|
||||
{
|
||||
TIFFError("computeOutputPixelOffsets",
|
||||
"Combined top and bottom margins exceed page length");
|
||||
--
|
||||
2.40.0
|
||||
|
||||
@@ -55,6 +55,13 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
|
||||
file://CVE-2023-6277-4.patch \
|
||||
file://CVE-2024-7006.patch \
|
||||
file://CVE-2023-3164.patch \
|
||||
file://CVE-2025-8176-0001.patch \
|
||||
file://CVE-2025-8176-0002.patch \
|
||||
file://CVE-2025-8176-0003.patch \
|
||||
file://CVE-2025-8177.patch \
|
||||
file://CVE-2024-13978.patch \
|
||||
file://CVE-2025-8534.patch \
|
||||
file://CVE-2025-8851.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8"
|
||||
|
||||
@@ -147,7 +147,7 @@ do_install:append() {
|
||||
}
|
||||
|
||||
USERADD_PACKAGES = "pulseaudio-server"
|
||||
GROUPADD_PARAM:pulseaudio-server = "--system pulse"
|
||||
GROUPADD_PARAM:pulseaudio-server = "--system audio; --system pulse"
|
||||
USERADD_PARAM:pulseaudio-server = "--system --home /var/run/pulse \
|
||||
--no-create-home --shell /bin/false \
|
||||
--groups audio,pulse --gid pulse pulse"
|
||||
|
||||
@@ -37,6 +37,7 @@ EXTRA_OECONF = "--disable-ldap \
|
||||
--with-readline=${STAGING_LIBDIR}/.. \
|
||||
--with-mailprog=${sbindir}/sendmail \
|
||||
--enable-gpg-is-gpg2 \
|
||||
--disable-tests \
|
||||
"
|
||||
|
||||
# A minimal package containing just enough to run gpg+gpgagent (E.g. use gpgme in opkg)
|
||||
|
||||
257
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-001.patch
Normal file
257
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-001.patch
Normal file
@@ -0,0 +1,257 @@
|
||||
From 4f26166f9e253aa62f8c121a6a25c76df5aa8142 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Wed, 31 Aug 2022 15:29:57 +0200
|
||||
Subject: [PATCH] Infrastructure to store extra data in source nodes
|
||||
|
||||
Provide a mechanism to store bit flags in nodes from the source
|
||||
document. This will later be used to store key and id status.
|
||||
|
||||
Provide a function to find the psvi member of a node.
|
||||
|
||||
Revert any changes to the source document after the transformation.
|
||||
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/commit/adebe45f6ef9f9d036acacd8aec7411d4ea84e25]
|
||||
CVE: CVE-2023-40403
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
---
|
||||
libxslt/transform.c | 34 ++++++++++
|
||||
libxslt/xsltInternals.h | 1 +
|
||||
libxslt/xsltutils.c | 135 ++++++++++++++++++++++++++++++++++++++++
|
||||
libxslt/xsltutils.h | 13 ++++
|
||||
4 files changed, 183 insertions(+)
|
||||
|
||||
diff --git a/libxslt/transform.c b/libxslt/transform.c
|
||||
index 57f05bf..40ab810 100644
|
||||
--- a/libxslt/transform.c
|
||||
+++ b/libxslt/transform.c
|
||||
@@ -5747,6 +5747,37 @@ xsltCountKeys(xsltTransformContextPtr ctxt)
|
||||
return(ctxt->nbKeys);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * xsltCleanupSourceDoc:
|
||||
+ * @doc: Document
|
||||
+ *
|
||||
+ * Resets source node flags and ids stored in 'psvi' member.
|
||||
+ */
|
||||
+static void
|
||||
+xsltCleanupSourceDoc(xmlDocPtr doc) {
|
||||
+ xmlNodePtr cur = (xmlNodePtr) doc;
|
||||
+ void **psviPtr;
|
||||
+
|
||||
+ while (1) {
|
||||
+ xsltClearSourceNodeFlags(cur, XSLT_SOURCE_NODE_MASK);
|
||||
+ psviPtr = xsltGetPSVIPtr(cur);
|
||||
+ if (psviPtr)
|
||||
+ *psviPtr = NULL;
|
||||
+
|
||||
+ if (cur->children != NULL && cur->type != XML_ENTITY_REF_NODE) {
|
||||
+ cur = cur->children;
|
||||
+ } else {
|
||||
+ while (cur->next == NULL) {
|
||||
+ cur = cur->parent;
|
||||
+ if (cur == (xmlNodePtr) doc)
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ cur = cur->next;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* xsltApplyStylesheetInternal:
|
||||
* @style: a parsed XSLT stylesheet
|
||||
@@ -6145,6 +6176,9 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc,
|
||||
printf("# Reused variables : %d\n", ctxt->cache->dbgReusedVars);
|
||||
#endif
|
||||
|
||||
+ if (ctxt->sourceDocDirty)
|
||||
+ xsltCleanupSourceDoc(doc);
|
||||
+
|
||||
if ((ctxt != NULL) && (userCtxt == NULL))
|
||||
xsltFreeTransformContext(ctxt);
|
||||
|
||||
diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
|
||||
index 14343d2..b0125c2 100644
|
||||
--- a/libxslt/xsltInternals.h
|
||||
+++ b/libxslt/xsltInternals.h
|
||||
@@ -1786,6 +1786,7 @@ struct _xsltTransformContext {
|
||||
int maxTemplateVars;
|
||||
unsigned long opLimit;
|
||||
unsigned long opCount;
|
||||
+ int sourceDocDirty;
|
||||
};
|
||||
|
||||
/**
|
||||
diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c
|
||||
index 9faa6b2..a879aa8 100644
|
||||
--- a/libxslt/xsltutils.c
|
||||
+++ b/libxslt/xsltutils.c
|
||||
@@ -1835,6 +1835,141 @@ xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * xsltGetSourceNodeFlags:
|
||||
+ * @node: Node from source document
|
||||
+ *
|
||||
+ * Returns the flags for a source node.
|
||||
+ */
|
||||
+int
|
||||
+xsltGetSourceNodeFlags(xmlNodePtr node) {
|
||||
+ /*
|
||||
+ * Squeeze the bit flags into the upper bits of
|
||||
+ *
|
||||
+ * - 'int properties' member in struct _xmlDoc
|
||||
+ * - 'xmlAttributeType atype' member in struct _xmlAttr
|
||||
+ * - 'unsigned short extra' member in struct _xmlNode
|
||||
+ */
|
||||
+ switch (node->type) {
|
||||
+ case XML_DOCUMENT_NODE:
|
||||
+ case XML_HTML_DOCUMENT_NODE:
|
||||
+ return ((xmlDocPtr) node)->properties >> 27;
|
||||
+
|
||||
+ case XML_ATTRIBUTE_NODE:
|
||||
+ return ((xmlAttrPtr) node)->atype >> 27;
|
||||
+
|
||||
+ case XML_ELEMENT_NODE:
|
||||
+ case XML_TEXT_NODE:
|
||||
+ case XML_CDATA_SECTION_NODE:
|
||||
+ case XML_PI_NODE:
|
||||
+ case XML_COMMENT_NODE:
|
||||
+ return node->extra >> 12;
|
||||
+
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * xsltSetSourceNodeFlags:
|
||||
+ * @node: Node from source document
|
||||
+ * @flags: Flags
|
||||
+ *
|
||||
+ * Sets the specified flags to 1.
|
||||
+ *
|
||||
+ * Returns 0 on success, -1 on error.
|
||||
+ */
|
||||
+int
|
||||
+xsltSetSourceNodeFlags(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
+ int flags) {
|
||||
+ if (node->doc == ctxt->initialContextDoc)
|
||||
+ ctxt->sourceDocDirty = 1;
|
||||
+
|
||||
+ switch (node->type) {
|
||||
+ case XML_DOCUMENT_NODE:
|
||||
+ case XML_HTML_DOCUMENT_NODE:
|
||||
+ ((xmlDocPtr) node)->properties |= flags << 27;
|
||||
+ return 0;
|
||||
+
|
||||
+ case XML_ATTRIBUTE_NODE:
|
||||
+ ((xmlAttrPtr) node)->atype |= flags << 27;
|
||||
+ return 0;
|
||||
+
|
||||
+ case XML_ELEMENT_NODE:
|
||||
+ case XML_TEXT_NODE:
|
||||
+ case XML_CDATA_SECTION_NODE:
|
||||
+ case XML_PI_NODE:
|
||||
+ case XML_COMMENT_NODE:
|
||||
+ node->extra |= flags << 12;
|
||||
+ return 0;
|
||||
+
|
||||
+ default:
|
||||
+ return -1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * xsltClearSourceNodeFlags:
|
||||
+ * @node: Node from source document
|
||||
+ * @flags: Flags
|
||||
+ *
|
||||
+ * Sets the specified flags to 0.
|
||||
+ *
|
||||
+ * Returns 0 on success, -1 on error.
|
||||
+ */
|
||||
+int
|
||||
+xsltClearSourceNodeFlags(xmlNodePtr node, int flags) {
|
||||
+ switch (node->type) {
|
||||
+ case XML_DOCUMENT_NODE:
|
||||
+ case XML_HTML_DOCUMENT_NODE:
|
||||
+ ((xmlDocPtr) node)->properties &= ~(flags << 27);
|
||||
+ return 0;
|
||||
+
|
||||
+ case XML_ATTRIBUTE_NODE:
|
||||
+ ((xmlAttrPtr) node)->atype &= ~(flags << 27);
|
||||
+ return 0;
|
||||
+
|
||||
+ case XML_ELEMENT_NODE:
|
||||
+ case XML_TEXT_NODE:
|
||||
+ case XML_CDATA_SECTION_NODE:
|
||||
+ case XML_PI_NODE:
|
||||
+ case XML_COMMENT_NODE:
|
||||
+ node->extra &= ~(flags << 12);
|
||||
+ return 0;
|
||||
+
|
||||
+ default:
|
||||
+ return -1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * xsltGetPSVIPtr:
|
||||
+ * @cur: Node
|
||||
+ *
|
||||
+ * Returns a pointer to the psvi member of a node or NULL on error.
|
||||
+ */
|
||||
+void **
|
||||
+xsltGetPSVIPtr(xmlNodePtr cur) {
|
||||
+ switch (cur->type) {
|
||||
+ case XML_DOCUMENT_NODE:
|
||||
+ case XML_HTML_DOCUMENT_NODE:
|
||||
+ return &((xmlDocPtr) cur)->psvi;
|
||||
+
|
||||
+ case XML_ATTRIBUTE_NODE:
|
||||
+ return &((xmlAttrPtr) cur)->psvi;
|
||||
+
|
||||
+ case XML_ELEMENT_NODE:
|
||||
+ case XML_TEXT_NODE:
|
||||
+ case XML_CDATA_SECTION_NODE:
|
||||
+ case XML_PI_NODE:
|
||||
+ case XML_COMMENT_NODE:
|
||||
+ return &cur->psvi;
|
||||
+
|
||||
+ default:
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#ifdef WITH_PROFILER
|
||||
|
||||
/************************************************************************
|
||||
diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h
|
||||
index ea6c374..202694f 100644
|
||||
--- a/libxslt/xsltutils.h
|
||||
+++ b/libxslt/xsltutils.h
|
||||
@@ -247,6 +247,19 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
||||
const xmlChar *str,
|
||||
int flags);
|
||||
|
||||
+#ifdef IN_LIBXSLT
|
||||
+#define XSLT_SOURCE_NODE_MASK 15
|
||||
+int
|
||||
+xsltGetSourceNodeFlags(xmlNodePtr node);
|
||||
+int
|
||||
+xsltSetSourceNodeFlags(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
+ int flags);
|
||||
+int
|
||||
+xsltClearSourceNodeFlags(xmlNodePtr node, int flags);
|
||||
+void **
|
||||
+xsltGetPSVIPtr(xmlNodePtr cur);
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Profiling.
|
||||
*/
|
||||
147
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-002.patch
Normal file
147
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-002.patch
Normal file
@@ -0,0 +1,147 @@
|
||||
From b392a3d0265f190d86cc122d86769a23ddb1fe66 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Wed, 31 Aug 2022 15:34:47 +0200
|
||||
Subject: [PATCH] Store key status of source nodes as bit flag
|
||||
|
||||
This frees up the psvi member.
|
||||
|
||||
CVE: CVE-2023-40403
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/commit/1d9820635c271b35f88431f33ea78dc8be349e5b]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
---
|
||||
libxslt/keys.c | 19 +------------------
|
||||
libxslt/pattern.c | 37 ++-----------------------------------
|
||||
libxslt/xsltutils.h | 1 +
|
||||
3 files changed, 4 insertions(+), 53 deletions(-)
|
||||
|
||||
diff --git a/libxslt/keys.c b/libxslt/keys.c
|
||||
index ecef538..3a134ab 100644
|
||||
--- a/libxslt/keys.c
|
||||
+++ b/libxslt/keys.c
|
||||
@@ -834,24 +834,7 @@ fprintf(stderr, "xsltInitCtxtKey %s : %d\n", keyDef->name, ctxt->keyInitLevel);
|
||||
*/
|
||||
xmlXPathNodeSetAdd(keylist, cur);
|
||||
}
|
||||
- switch (cur->type) {
|
||||
- case XML_ELEMENT_NODE:
|
||||
- case XML_TEXT_NODE:
|
||||
- case XML_CDATA_SECTION_NODE:
|
||||
- case XML_PI_NODE:
|
||||
- case XML_COMMENT_NODE:
|
||||
- cur->psvi = keyDef;
|
||||
- break;
|
||||
- case XML_ATTRIBUTE_NODE:
|
||||
- ((xmlAttrPtr) cur)->psvi = keyDef;
|
||||
- break;
|
||||
- case XML_DOCUMENT_NODE:
|
||||
- case XML_HTML_DOCUMENT_NODE:
|
||||
- ((xmlDocPtr) cur)->psvi = keyDef;
|
||||
- break;
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
+ xsltSetSourceNodeFlags(ctxt, cur, XSLT_SOURCE_NODE_HAS_KEY);
|
||||
xmlFree(str);
|
||||
str = NULL;
|
||||
|
||||
diff --git a/libxslt/pattern.c b/libxslt/pattern.c
|
||||
index 1944661..9372bc3 100644
|
||||
--- a/libxslt/pattern.c
|
||||
+++ b/libxslt/pattern.c
|
||||
@@ -2283,7 +2283,6 @@ xsltGetTemplate(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
const xmlChar *name = NULL;
|
||||
xsltCompMatchPtr list = NULL;
|
||||
float priority;
|
||||
- int keyed = 0;
|
||||
|
||||
if ((ctxt == NULL) || (node == NULL))
|
||||
return(NULL);
|
||||
@@ -2361,37 +2360,25 @@ xsltGetTemplate(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
list = curstyle->rootMatch;
|
||||
else
|
||||
list = curstyle->elemMatch;
|
||||
- if (node->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
case XML_ATTRIBUTE_NODE: {
|
||||
- xmlAttrPtr attr;
|
||||
-
|
||||
list = curstyle->attrMatch;
|
||||
- attr = (xmlAttrPtr) node;
|
||||
- if (attr->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
}
|
||||
case XML_PI_NODE:
|
||||
list = curstyle->piMatch;
|
||||
- if (node->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
case XML_DOCUMENT_NODE:
|
||||
case XML_HTML_DOCUMENT_NODE: {
|
||||
- xmlDocPtr doc;
|
||||
-
|
||||
list = curstyle->rootMatch;
|
||||
- doc = (xmlDocPtr) node;
|
||||
- if (doc->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
}
|
||||
case XML_TEXT_NODE:
|
||||
case XML_CDATA_SECTION_NODE:
|
||||
list = curstyle->textMatch;
|
||||
- if (node->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
case XML_COMMENT_NODE:
|
||||
list = curstyle->commentMatch;
|
||||
- if (node->psvi != NULL) keyed = 1;
|
||||
break;
|
||||
case XML_ENTITY_REF_NODE:
|
||||
case XML_ENTITY_NODE:
|
||||
@@ -2461,7 +2448,7 @@ xsltGetTemplate(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
}
|
||||
|
||||
keyed_match:
|
||||
- if (keyed) {
|
||||
+ if (xsltGetSourceNodeFlags(node) & XSLT_SOURCE_NODE_HAS_KEY) {
|
||||
list = curstyle->keyMatch;
|
||||
while ((list != NULL) &&
|
||||
((ret == NULL) ||
|
||||
@@ -2489,27 +2476,7 @@ keyed_match:
|
||||
if (xsltComputeAllKeys(ctxt, node) == -1)
|
||||
goto error;
|
||||
|
||||
- switch (node->type) {
|
||||
- case XML_ELEMENT_NODE:
|
||||
- if (node->psvi != NULL) keyed = 1;
|
||||
- break;
|
||||
- case XML_ATTRIBUTE_NODE:
|
||||
- if (((xmlAttrPtr) node)->psvi != NULL) keyed = 1;
|
||||
- break;
|
||||
- case XML_TEXT_NODE:
|
||||
- case XML_CDATA_SECTION_NODE:
|
||||
- case XML_COMMENT_NODE:
|
||||
- case XML_PI_NODE:
|
||||
- if (node->psvi != NULL) keyed = 1;
|
||||
- break;
|
||||
- case XML_DOCUMENT_NODE:
|
||||
- case XML_HTML_DOCUMENT_NODE:
|
||||
- if (((xmlDocPtr) node)->psvi != NULL) keyed = 1;
|
||||
- break;
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
- if (keyed)
|
||||
+ if (xsltGetSourceNodeFlags(node) & XSLT_SOURCE_NODE_HAS_KEY)
|
||||
goto keyed_match;
|
||||
}
|
||||
if (ret != NULL)
|
||||
diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h
|
||||
index 202694f..dcfd139 100644
|
||||
--- a/libxslt/xsltutils.h
|
||||
+++ b/libxslt/xsltutils.h
|
||||
@@ -249,6 +249,7 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
||||
|
||||
#ifdef IN_LIBXSLT
|
||||
#define XSLT_SOURCE_NODE_MASK 15
|
||||
+#define XSLT_SOURCE_NODE_HAS_KEY 1
|
||||
int
|
||||
xsltGetSourceNodeFlags(xmlNodePtr node);
|
||||
int
|
||||
231
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-003.patch
Normal file
231
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-003.patch
Normal file
@@ -0,0 +1,231 @@
|
||||
From 8986995b07126852762e8a59eaee83be0b8de9a3 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Wed, 31 Aug 2022 15:35:37 +0200
|
||||
Subject: [PATCH] Store RVT ownership in 'compression' member
|
||||
|
||||
'compression' is another unused member in struct _xmlDoc which is even
|
||||
better suited to store ownership status. More importantly, this frees up
|
||||
the 'psvi' member.
|
||||
|
||||
This changes the public API but this feature is only required to
|
||||
implement EXSLT functions.
|
||||
|
||||
CVE: CVE-2023-40403
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/commit/ccec6fa31d11ab0a5299f15ea184c7a457e92940]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
---
|
||||
libexslt/functions.c | 2 +-
|
||||
libxslt/transform.c | 8 ++++----
|
||||
libxslt/variables.c | 44 ++++++++++++++++++++---------------------
|
||||
libxslt/variables.h | 6 +++---
|
||||
libxslt/xsltInternals.h | 2 +-
|
||||
5 files changed, 31 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/libexslt/functions.c b/libexslt/functions.c
|
||||
index 958bf60..859a992 100644
|
||||
--- a/libexslt/functions.c
|
||||
+++ b/libexslt/functions.c
|
||||
@@ -775,7 +775,7 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
|
||||
}
|
||||
/* Mark as function result. */
|
||||
xsltRegisterLocalRVT(ctxt, container);
|
||||
- container->psvi = XSLT_RVT_FUNC_RESULT;
|
||||
+ container->compression = XSLT_RVT_FUNC_RESULT;
|
||||
|
||||
oldInsert = ctxt->insert;
|
||||
ctxt->insert = (xmlNodePtr) container;
|
||||
diff --git a/libxslt/transform.c b/libxslt/transform.c
|
||||
index 40ab810..19d7326 100644
|
||||
--- a/libxslt/transform.c
|
||||
+++ b/libxslt/transform.c
|
||||
@@ -2276,17 +2276,17 @@ xsltReleaseLocalRVTs(xsltTransformContextPtr ctxt, xmlDocPtr base)
|
||||
do {
|
||||
tmp = cur;
|
||||
cur = (xmlDocPtr) cur->next;
|
||||
- if (tmp->psvi == XSLT_RVT_LOCAL) {
|
||||
+ if (tmp->compression == XSLT_RVT_LOCAL) {
|
||||
xsltReleaseRVT(ctxt, tmp);
|
||||
- } else if (tmp->psvi == XSLT_RVT_GLOBAL) {
|
||||
+ } else if (tmp->compression == XSLT_RVT_GLOBAL) {
|
||||
xsltRegisterPersistRVT(ctxt, tmp);
|
||||
- } else if (tmp->psvi == XSLT_RVT_FUNC_RESULT) {
|
||||
+ } else if (tmp->compression == XSLT_RVT_FUNC_RESULT) {
|
||||
/*
|
||||
* This will either register the RVT again or move it to the
|
||||
* context variable.
|
||||
*/
|
||||
xsltRegisterLocalRVT(ctxt, tmp);
|
||||
- tmp->psvi = XSLT_RVT_FUNC_RESULT;
|
||||
+ tmp->compression = XSLT_RVT_FUNC_RESULT;
|
||||
} else {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xsltReleaseLocalRVTs: Unexpected RVT flag %p\n",
|
||||
diff --git a/libxslt/variables.c b/libxslt/variables.c
|
||||
index 4c972a4..dab0bab 100644
|
||||
--- a/libxslt/variables.c
|
||||
+++ b/libxslt/variables.c
|
||||
@@ -123,7 +123,7 @@ xsltRegisterTmpRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
|
||||
return(-1);
|
||||
|
||||
RVT->prev = NULL;
|
||||
- RVT->psvi = XSLT_RVT_LOCAL;
|
||||
+ RVT->compression = XSLT_RVT_LOCAL;
|
||||
|
||||
/*
|
||||
* We'll restrict the lifetime of user-created fragments
|
||||
@@ -163,7 +163,7 @@ xsltRegisterLocalRVT(xsltTransformContextPtr ctxt,
|
||||
return(-1);
|
||||
|
||||
RVT->prev = NULL;
|
||||
- RVT->psvi = XSLT_RVT_LOCAL;
|
||||
+ RVT->compression = XSLT_RVT_LOCAL;
|
||||
|
||||
/*
|
||||
* When evaluating "select" expressions of xsl:variable
|
||||
@@ -255,7 +255,7 @@ xsltExtensionInstructionResultRegister(
|
||||
* Returns 0 in case of success and -1 in case of error.
|
||||
*/
|
||||
int
|
||||
-xsltFlagRVTs(xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj, void *val) {
|
||||
+xsltFlagRVTs(xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj, int val) {
|
||||
int i;
|
||||
xmlNodePtr cur;
|
||||
xmlDocPtr doc;
|
||||
@@ -302,34 +302,34 @@ xsltFlagRVTs(xsltTransformContextPtr ctxt, xmlXPathObjectPtr obj, void *val) {
|
||||
return(-1);
|
||||
}
|
||||
if (doc->name && (doc->name[0] == ' ') &&
|
||||
- doc->psvi != XSLT_RVT_GLOBAL) {
|
||||
+ doc->compression != XSLT_RVT_GLOBAL) {
|
||||
/*
|
||||
* This is a result tree fragment.
|
||||
- * We store ownership information in the @psvi field.
|
||||
+ * We store ownership information in the @compression field.
|
||||
* TODO: How do we know if this is a doc acquired via the
|
||||
* document() function?
|
||||
*/
|
||||
#ifdef WITH_XSLT_DEBUG_VARIABLE
|
||||
XSLT_TRACE(ctxt,XSLT_TRACE_VARIABLES,xsltGenericDebug(xsltGenericDebugContext,
|
||||
- "Flagging RVT %p: %p -> %p\n", doc, doc->psvi, val));
|
||||
+ "Flagging RVT %p: %d -> %d\n", doc, doc->compression, val));
|
||||
#endif
|
||||
|
||||
if (val == XSLT_RVT_LOCAL) {
|
||||
- if (doc->psvi == XSLT_RVT_FUNC_RESULT)
|
||||
- doc->psvi = XSLT_RVT_LOCAL;
|
||||
+ if (doc->compression == XSLT_RVT_FUNC_RESULT)
|
||||
+ doc->compression = XSLT_RVT_LOCAL;
|
||||
} else if (val == XSLT_RVT_GLOBAL) {
|
||||
- if (doc->psvi != XSLT_RVT_LOCAL) {
|
||||
+ if (doc->compression != XSLT_RVT_LOCAL) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
- "xsltFlagRVTs: Invalid transition %p => GLOBAL\n",
|
||||
- doc->psvi);
|
||||
- doc->psvi = XSLT_RVT_GLOBAL;
|
||||
+ "xsltFlagRVTs: Invalid transition %d => GLOBAL\n",
|
||||
+ doc->compression);
|
||||
+ doc->compression = XSLT_RVT_GLOBAL;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Will be registered as persistant in xsltReleaseLocalRVTs. */
|
||||
- doc->psvi = XSLT_RVT_GLOBAL;
|
||||
+ doc->compression = XSLT_RVT_GLOBAL;
|
||||
} else if (val == XSLT_RVT_FUNC_RESULT) {
|
||||
- doc->psvi = val;
|
||||
+ doc->compression = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -382,7 +382,7 @@ xsltReleaseRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
|
||||
/*
|
||||
* Reset the ownership information.
|
||||
*/
|
||||
- RVT->psvi = NULL;
|
||||
+ RVT->compression = 0;
|
||||
|
||||
RVT->next = (xmlNodePtr) ctxt->cache->RVT;
|
||||
ctxt->cache->RVT = RVT;
|
||||
@@ -421,7 +421,7 @@ xsltRegisterPersistRVT(xsltTransformContextPtr ctxt, xmlDocPtr RVT)
|
||||
{
|
||||
if ((ctxt == NULL) || (RVT == NULL)) return(-1);
|
||||
|
||||
- RVT->psvi = XSLT_RVT_GLOBAL;
|
||||
+ RVT->compression = XSLT_RVT_GLOBAL;
|
||||
RVT->prev = NULL;
|
||||
RVT->next = (xmlNodePtr) ctxt->persistRVT;
|
||||
if (ctxt->persistRVT != NULL)
|
||||
@@ -580,15 +580,15 @@ xsltFreeStackElem(xsltStackElemPtr elem) {
|
||||
cur = elem->fragment;
|
||||
elem->fragment = (xmlDocPtr) cur->next;
|
||||
|
||||
- if (cur->psvi == XSLT_RVT_LOCAL) {
|
||||
+ if (cur->compression == XSLT_RVT_LOCAL) {
|
||||
xsltReleaseRVT(elem->context, cur);
|
||||
- } else if (cur->psvi == XSLT_RVT_FUNC_RESULT) {
|
||||
+ } else if (cur->compression == XSLT_RVT_FUNC_RESULT) {
|
||||
xsltRegisterLocalRVT(elem->context, cur);
|
||||
- cur->psvi = XSLT_RVT_FUNC_RESULT;
|
||||
+ cur->compression = XSLT_RVT_FUNC_RESULT;
|
||||
} else {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
- "xsltFreeStackElem: Unexpected RVT flag %p\n",
|
||||
- cur->psvi);
|
||||
+ "xsltFreeStackElem: Unexpected RVT flag %d\n",
|
||||
+ cur->compression);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -989,7 +989,7 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
|
||||
* the Result Tree Fragment.
|
||||
*/
|
||||
variable->fragment = container;
|
||||
- container->psvi = XSLT_RVT_LOCAL;
|
||||
+ container->compression = XSLT_RVT_LOCAL;
|
||||
|
||||
oldOutput = ctxt->output;
|
||||
oldInsert = ctxt->insert;
|
||||
diff --git a/libxslt/variables.h b/libxslt/variables.h
|
||||
index 039288f..e2adee0 100644
|
||||
--- a/libxslt/variables.h
|
||||
+++ b/libxslt/variables.h
|
||||
@@ -43,7 +43,7 @@ extern "C" {
|
||||
*
|
||||
* RVT is destroyed after the current instructions ends.
|
||||
*/
|
||||
-#define XSLT_RVT_LOCAL ((void *)1)
|
||||
+#define XSLT_RVT_LOCAL 1
|
||||
|
||||
/**
|
||||
* XSLT_RVT_FUNC_RESULT:
|
||||
@@ -52,14 +52,14 @@ extern "C" {
|
||||
* destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or
|
||||
* XSLT_RVT_VARIABLE in the template that receives the return value.
|
||||
*/
|
||||
-#define XSLT_RVT_FUNC_RESULT ((void *)2)
|
||||
+#define XSLT_RVT_FUNC_RESULT 2
|
||||
|
||||
/**
|
||||
* XSLT_RVT_GLOBAL:
|
||||
*
|
||||
* RVT is part of a global variable.
|
||||
*/
|
||||
-#define XSLT_RVT_GLOBAL ((void *)3)
|
||||
+#define XSLT_RVT_GLOBAL 3
|
||||
|
||||
/*
|
||||
* Interfaces for the variable module.
|
||||
diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
|
||||
index b0125c2..74a2b64 100644
|
||||
--- a/libxslt/xsltInternals.h
|
||||
+++ b/libxslt/xsltInternals.h
|
||||
@@ -1916,7 +1916,7 @@ XSLTPUBFUN int XSLTCALL
|
||||
xsltFlagRVTs(
|
||||
xsltTransformContextPtr ctxt,
|
||||
xmlXPathObjectPtr obj,
|
||||
- void *val);
|
||||
+ int val);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeRVTs (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
349
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-004.patch
Normal file
349
meta/recipes-support/libxslt/libxslt/CVE-2023-40403-004.patch
Normal file
@@ -0,0 +1,349 @@
|
||||
From 91c9c56dcca01bfe3f9dae74fb75dcf792ebe58b Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Wed, 31 Aug 2022 13:35:23 +0200
|
||||
Subject: [PATCH] Make generate-id() deterministic
|
||||
|
||||
Rework the generate-id() function to return deterministic values. We use
|
||||
a simple incrementing counter and store ids in the 'psvi' member of
|
||||
nodes which was freed up by previous commits. The presence of an id is
|
||||
indicated by a new "source node" flag.
|
||||
|
||||
This fixes long-standing problems with reproducible builds, see
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=751621
|
||||
|
||||
This also hardens security, as the old implementation leaked the
|
||||
difference between a heap and a global pointer, see
|
||||
https://bugs.chromium.org/p/chromium/issues/detail?id=1356211
|
||||
|
||||
The old implementation could also generate the same id for dynamically
|
||||
created nodes which happened to reuse the same memory. Ids for namespace
|
||||
nodes were completely broken. They now use the id of the parent element
|
||||
together with the hex-encoded namespace prefix.
|
||||
|
||||
CVE: CVE-2023-40403
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/commit/82f6cbf8ca61b1f9e00dc04aa3b15d563e7bbc6d]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
---
|
||||
libxslt/functions.c | 107 +++++++++++++++++++++++++-----
|
||||
libxslt/xsltInternals.h | 1 +
|
||||
libxslt/xsltutils.h | 1 +
|
||||
tests/REC/test-12.4-1.out | 11 +++
|
||||
tests/REC/test-12.4-1.xml | 6 ++
|
||||
tests/REC/test-12.4-1.xsl | 38 +++++++++++
|
||||
tests/exslt/common/dynamic-id.out | 13 ++++
|
||||
tests/exslt/common/dynamic-id.xml | 1 +
|
||||
tests/exslt/common/dynamic-id.xsl | 29 ++++++++
|
||||
9 files changed, 191 insertions(+), 16 deletions(-)
|
||||
create mode 100644 tests/REC/test-12.4-1.out
|
||||
create mode 100644 tests/REC/test-12.4-1.xml
|
||||
create mode 100644 tests/REC/test-12.4-1.xsl
|
||||
create mode 100644 tests/exslt/common/dynamic-id.out
|
||||
create mode 100644 tests/exslt/common/dynamic-id.xml
|
||||
create mode 100644 tests/exslt/common/dynamic-id.xsl
|
||||
|
||||
diff --git a/libxslt/functions.c b/libxslt/functions.c
|
||||
index 7887dda..da25c24 100644
|
||||
--- a/libxslt/functions.c
|
||||
+++ b/libxslt/functions.c
|
||||
@@ -693,11 +693,16 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
*/
|
||||
void
|
||||
xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
- static char base_address;
|
||||
+ xsltTransformContextPtr tctxt;
|
||||
xmlNodePtr cur = NULL;
|
||||
xmlXPathObjectPtr obj = NULL;
|
||||
- long val;
|
||||
- xmlChar str[30];
|
||||
+ char *str;
|
||||
+ const xmlChar *nsPrefix = NULL;
|
||||
+ void **psviPtr;
|
||||
+ unsigned long id;
|
||||
+ size_t size, nsPrefixSize;
|
||||
+
|
||||
+ tctxt = xsltXPathGetTransformContext(ctxt);
|
||||
|
||||
if (nargs == 0) {
|
||||
cur = ctxt->context->node;
|
||||
@@ -707,16 +712,15 @@ xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
|
||||
if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NODESET)) {
|
||||
ctxt->error = XPATH_INVALID_TYPE;
|
||||
- xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
|
||||
+ xsltTransformError(tctxt, NULL, NULL,
|
||||
"generate-id() : invalid arg expecting a node-set\n");
|
||||
- return;
|
||||
+ goto out;
|
||||
}
|
||||
obj = valuePop(ctxt);
|
||||
nodelist = obj->nodesetval;
|
||||
if ((nodelist == NULL) || (nodelist->nodeNr <= 0)) {
|
||||
- xmlXPathFreeObject(obj);
|
||||
valuePush(ctxt, xmlXPathNewCString(""));
|
||||
- return;
|
||||
+ goto out;
|
||||
}
|
||||
cur = nodelist->nodeTab[0];
|
||||
for (i = 1;i < nodelist->nodeNr;i++) {
|
||||
@@ -725,22 +729,93 @@ xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
cur = nodelist->nodeTab[i];
|
||||
}
|
||||
} else {
|
||||
- xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
|
||||
+ xsltTransformError(tctxt, NULL, NULL,
|
||||
"generate-id() : invalid number of args %d\n", nargs);
|
||||
ctxt->error = XPATH_INVALID_ARITY;
|
||||
- return;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ size = 30; /* for "id%lu" */
|
||||
+
|
||||
+ if (cur->type == XML_NAMESPACE_DECL) {
|
||||
+ xmlNsPtr ns = (xmlNsPtr) cur;
|
||||
+
|
||||
+ nsPrefix = ns->prefix;
|
||||
+ if (nsPrefix == NULL)
|
||||
+ nsPrefix = BAD_CAST "";
|
||||
+ nsPrefixSize = xmlStrlen(nsPrefix);
|
||||
+ /* For "ns" and hex-encoded string */
|
||||
+ size += nsPrefixSize * 2 + 2;
|
||||
+
|
||||
+ /* Parent is stored in 'next'. */
|
||||
+ cur = (xmlNodePtr) ns->next;
|
||||
+ }
|
||||
+
|
||||
+ psviPtr = xsltGetPSVIPtr(cur);
|
||||
+ if (psviPtr == NULL) {
|
||||
+ xsltTransformError(tctxt, NULL, NULL,
|
||||
+ "generate-id(): invalid node type %d\n", cur->type);
|
||||
+ ctxt->error = XPATH_INVALID_TYPE;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
- if (obj)
|
||||
- xmlXPathFreeObject(obj);
|
||||
+ if (xsltGetSourceNodeFlags(cur) & XSLT_SOURCE_NODE_HAS_ID) {
|
||||
+ id = (unsigned long) *psviPtr;
|
||||
+ } else {
|
||||
+ if (cur->type == XML_TEXT_NODE && cur->line == USHRT_MAX) {
|
||||
+ /* Text nodes store big line numbers in psvi. */
|
||||
+ cur->line = 0;
|
||||
+ } else if (*psviPtr != NULL) {
|
||||
+ xsltTransformError(tctxt, NULL, NULL,
|
||||
+ "generate-id(): psvi already set\n");
|
||||
+ ctxt->error = XPATH_MEMORY_ERROR;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (tctxt->currentId == ULONG_MAX) {
|
||||
+ xsltTransformError(tctxt, NULL, NULL,
|
||||
+ "generate-id(): id overflow\n");
|
||||
+ ctxt->error = XPATH_MEMORY_ERROR;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ id = ++tctxt->currentId;
|
||||
+ *psviPtr = (void *) id;
|
||||
+ xsltSetSourceNodeFlags(tctxt, cur, XSLT_SOURCE_NODE_HAS_ID);
|
||||
+ }
|
||||
|
||||
- val = (long)((char *)cur - (char *)&base_address);
|
||||
- if (val >= 0) {
|
||||
- snprintf((char *)str, sizeof(str), "idp%ld", val);
|
||||
+ str = xmlMalloc(size);
|
||||
+ if (str == NULL) {
|
||||
+ xsltTransformError(tctxt, NULL, NULL,
|
||||
+ "generate-id(): out of memory\n");
|
||||
+ ctxt->error = XPATH_MEMORY_ERROR;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ if (nsPrefix == NULL) {
|
||||
+ snprintf(str, size, "id%lu", id);
|
||||
} else {
|
||||
- snprintf((char *)str, sizeof(str), "idm%ld", -val);
|
||||
+ size_t i, j;
|
||||
+
|
||||
+ snprintf(str, size, "id%luns", id);
|
||||
+
|
||||
+ /*
|
||||
+ * Only ASCII alphanumerics are allowed, so we hex-encode the prefix.
|
||||
+ */
|
||||
+ j = strlen(str);
|
||||
+ for (i = 0; i < nsPrefixSize; i++) {
|
||||
+ int v;
|
||||
+
|
||||
+ v = nsPrefix[i] >> 4;
|
||||
+ str[j++] = v < 10 ? '0' + v : 'A' + (v - 10);
|
||||
+ v = nsPrefix[i] & 15;
|
||||
+ str[j++] = v < 10 ? '0' + v : 'A' + (v - 10);
|
||||
+ }
|
||||
+ str[j] = '\0';
|
||||
}
|
||||
- valuePush(ctxt, xmlXPathNewString(str));
|
||||
+ valuePush(ctxt, xmlXPathWrapString(BAD_CAST str));
|
||||
+
|
||||
+out:
|
||||
+ xmlXPathFreeObject(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
|
||||
index 74a2b64..2fd1f68 100644
|
||||
--- a/libxslt/xsltInternals.h
|
||||
+++ b/libxslt/xsltInternals.h
|
||||
@@ -1787,6 +1787,7 @@ struct _xsltTransformContext {
|
||||
unsigned long opLimit;
|
||||
unsigned long opCount;
|
||||
int sourceDocDirty;
|
||||
+ unsigned long currentId; /* For generate-id() */
|
||||
};
|
||||
|
||||
/**
|
||||
diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h
|
||||
index dcfd139..6c14ecf 100644
|
||||
--- a/libxslt/xsltutils.h
|
||||
+++ b/libxslt/xsltutils.h
|
||||
@@ -250,6 +250,7 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
||||
#ifdef IN_LIBXSLT
|
||||
#define XSLT_SOURCE_NODE_MASK 15
|
||||
#define XSLT_SOURCE_NODE_HAS_KEY 1
|
||||
+#define XSLT_SOURCE_NODE_HAS_ID 2
|
||||
int
|
||||
xsltGetSourceNodeFlags(xmlNodePtr node);
|
||||
int
|
||||
diff --git a/tests/REC/test-12.4-1.out b/tests/REC/test-12.4-1.out
|
||||
new file mode 100644
|
||||
index 0000000..237a9f2
|
||||
--- /dev/null
|
||||
+++ b/tests/REC/test-12.4-1.out
|
||||
@@ -0,0 +1,11 @@
|
||||
+<?xml version="1.0"?>
|
||||
+<result>
|
||||
+ <document>id1</document>
|
||||
+ <element>id2</element>
|
||||
+ <attribute>id3</attribute>
|
||||
+ <namespace>id2ns</namespace>
|
||||
+ <namespace>id2nsC3A4C3B6C3BC</namespace>
|
||||
+ <text>id4</text>
|
||||
+ <comment>id5</comment>
|
||||
+ <processing-instruction>id6</processing-instruction>
|
||||
+</result>
|
||||
diff --git a/tests/REC/test-12.4-1.xml b/tests/REC/test-12.4-1.xml
|
||||
new file mode 100644
|
||||
index 0000000..84484f6
|
||||
--- /dev/null
|
||||
+++ b/tests/REC/test-12.4-1.xml
|
||||
@@ -0,0 +1,6 @@
|
||||
+<doc xmlns="s:def">
|
||||
+ <elem attr="value" xmlns:äöü="uri"/>
|
||||
+ <text>text</text>
|
||||
+ <!-- comment -->
|
||||
+ <?pi content?>
|
||||
+</doc>
|
||||
diff --git a/tests/REC/test-12.4-1.xsl b/tests/REC/test-12.4-1.xsl
|
||||
new file mode 100644
|
||||
index 0000000..5cf5dd3
|
||||
--- /dev/null
|
||||
+++ b/tests/REC/test-12.4-1.xsl
|
||||
@@ -0,0 +1,38 @@
|
||||
+<xsl:stylesheet
|
||||
+ version="1.0"
|
||||
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
+ xmlns:d="s:def"
|
||||
+ exclude-result-prefixes="d">
|
||||
+
|
||||
+<xsl:output indent="yes"/>
|
||||
+
|
||||
+<xsl:template match="/">
|
||||
+ <result>
|
||||
+ <document>
|
||||
+ <xsl:value-of select="generate-id(/)"/>
|
||||
+ </document>
|
||||
+ <element>
|
||||
+ <xsl:value-of select="generate-id(/d:doc/d:elem)"/>
|
||||
+ </element>
|
||||
+ <attribute>
|
||||
+ <xsl:value-of select="generate-id(d:doc/d:elem/@attr)"/>
|
||||
+ </attribute>
|
||||
+ <namespace>
|
||||
+ <xsl:value-of select="generate-id(d:doc/d:elem/namespace::*[local-name()=''])"/>
|
||||
+ </namespace>
|
||||
+ <namespace>
|
||||
+ <xsl:value-of select="generate-id(d:doc/d:elem/namespace::äöü)"/>
|
||||
+ </namespace>
|
||||
+ <text>
|
||||
+ <xsl:value-of select="generate-id(d:doc/d:text/text())"/>
|
||||
+ </text>
|
||||
+ <comment>
|
||||
+ <xsl:value-of select="generate-id(d:doc/comment())"/>
|
||||
+ </comment>
|
||||
+ <processing-instruction>
|
||||
+ <xsl:value-of select="generate-id(d:doc/processing-instruction())"/>
|
||||
+ </processing-instruction>
|
||||
+ </result>
|
||||
+</xsl:template>
|
||||
+
|
||||
+</xsl:stylesheet>
|
||||
diff --git a/tests/exslt/common/dynamic-id.out b/tests/exslt/common/dynamic-id.out
|
||||
new file mode 100644
|
||||
index 0000000..1b7b7ba
|
||||
--- /dev/null
|
||||
+++ b/tests/exslt/common/dynamic-id.out
|
||||
@@ -0,0 +1,13 @@
|
||||
+<?xml version="1.0"?>
|
||||
+<result xmlns:exsl="http://exslt.org/common">
|
||||
+ <id>id1</id>
|
||||
+ <id>id2</id>
|
||||
+ <id>id3</id>
|
||||
+ <id>id4</id>
|
||||
+ <id>id5</id>
|
||||
+ <id>id6</id>
|
||||
+ <id>id7</id>
|
||||
+ <id>id8</id>
|
||||
+ <id>id9</id>
|
||||
+ <id>id10</id>
|
||||
+</result>
|
||||
diff --git a/tests/exslt/common/dynamic-id.xml b/tests/exslt/common/dynamic-id.xml
|
||||
new file mode 100644
|
||||
index 0000000..69d62f2
|
||||
--- /dev/null
|
||||
+++ b/tests/exslt/common/dynamic-id.xml
|
||||
@@ -0,0 +1 @@
|
||||
+<doc/>
|
||||
diff --git a/tests/exslt/common/dynamic-id.xsl b/tests/exslt/common/dynamic-id.xsl
|
||||
new file mode 100644
|
||||
index 0000000..8478f6a
|
||||
--- /dev/null
|
||||
+++ b/tests/exslt/common/dynamic-id.xsl
|
||||
@@ -0,0 +1,29 @@
|
||||
+<xsl:stylesheet
|
||||
+ version="1.0"
|
||||
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
+ xmlns:exsl="http://exslt.org/common">
|
||||
+
|
||||
+<xsl:output indent="yes"/>
|
||||
+
|
||||
+<xsl:template name="dynamic-id">
|
||||
+ <id>
|
||||
+ <xsl:value-of select="generate-id(exsl:node-set('string'))"/>
|
||||
+ </id>
|
||||
+</xsl:template>
|
||||
+
|
||||
+<xsl:template match="/">
|
||||
+ <result>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ <xsl:call-template name="dynamic-id"/>
|
||||
+ </result>
|
||||
+</xsl:template>
|
||||
+
|
||||
+</xsl:stylesheet>
|
||||
@@ -0,0 +1,55 @@
|
||||
From 3014af50b22f1be89b5514faea284de7b63fa5dc Mon Sep 17 00:00:00 2001
|
||||
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||
Date: Wed, 31 Aug 2022 21:37:44 +0200
|
||||
Subject: [PATCH] Clean up attributes in source doc
|
||||
|
||||
Also make bit flag constants unsigned to avoid implicit-conversion
|
||||
warnings.
|
||||
|
||||
CVE: CVE-2023-40403
|
||||
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/commit/452fb4ca9b9803448826008b9573987c615912a1]
|
||||
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
|
||||
|
||||
---
|
||||
libxslt/transform.c | 10 ++++++++++
|
||||
libxslt/xsltutils.h | 6 +++---
|
||||
2 files changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libxslt/transform.c b/libxslt/transform.c
|
||||
index 19d7326..7299eb5 100644
|
||||
--- a/libxslt/transform.c
|
||||
+++ b/libxslt/transform.c
|
||||
@@ -5764,6 +5764,16 @@ xsltCleanupSourceDoc(xmlDocPtr doc) {
|
||||
if (psviPtr)
|
||||
*psviPtr = NULL;
|
||||
|
||||
+ if (cur->type == XML_ELEMENT_NODE) {
|
||||
+ xmlAttrPtr prop = cur->properties;
|
||||
+
|
||||
+ while (prop) {
|
||||
+ prop->atype &= ~(XSLT_SOURCE_NODE_MASK << 27);
|
||||
+ prop->psvi = NULL;
|
||||
+ prop = prop->next;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (cur->children != NULL && cur->type != XML_ENTITY_REF_NODE) {
|
||||
cur = cur->children;
|
||||
} else {
|
||||
diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h
|
||||
index 6c14ecf..2af4282 100644
|
||||
--- a/libxslt/xsltutils.h
|
||||
+++ b/libxslt/xsltutils.h
|
||||
@@ -248,9 +248,9 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
||||
int flags);
|
||||
|
||||
#ifdef IN_LIBXSLT
|
||||
-#define XSLT_SOURCE_NODE_MASK 15
|
||||
-#define XSLT_SOURCE_NODE_HAS_KEY 1
|
||||
-#define XSLT_SOURCE_NODE_HAS_ID 2
|
||||
+#define XSLT_SOURCE_NODE_MASK 15u
|
||||
+#define XSLT_SOURCE_NODE_HAS_KEY 1u
|
||||
+#define XSLT_SOURCE_NODE_HAS_ID 2u
|
||||
int
|
||||
xsltGetSourceNodeFlags(xmlNodePtr node);
|
||||
int
|
||||
@@ -16,6 +16,11 @@ DEPENDS = "libxml2"
|
||||
SRC_URI = "https://download.gnome.org/sources/libxslt/1.1/libxslt-${PV}.tar.xz \
|
||||
file://CVE-2024-55549.patch \
|
||||
file://CVE-2025-24855.patch \
|
||||
file://CVE-2023-40403-001.patch \
|
||||
file://CVE-2023-40403-002.patch \
|
||||
file://CVE-2023-40403-003.patch \
|
||||
file://CVE-2023-40403-004.patch \
|
||||
file://CVE-2023-40403-005.patch \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79"
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
From f55a7dad195994f2bb24db7df0a0515502386fe2 Mon Sep 17 00:00:00 2001
|
||||
From: drh <>
|
||||
Date: Sat, 22 Oct 2022 14:16:02 +0000
|
||||
Subject: [PATCH] This branch attempts to improve the detection of covering
|
||||
indexes. This first check-in merely improves a parameter name to
|
||||
sqlite3WhereBegin() to be more descriptive of what it contains, and ensures
|
||||
that a subroutine is not inlines so that sqlite3WhereBegin() runs slightly
|
||||
faster.
|
||||
|
||||
FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244
|
||||
|
||||
Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/f55a7dad195994f2bb24db7df0a0515502386fe2]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
sqlite3.c | 28 +++++++++++++---------------
|
||||
1 file changed, 13 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/sqlite3.c b/sqlite3.c
|
||||
index 4cbc2d0..b7ed991 100644
|
||||
--- a/sqlite3.c
|
||||
+++ b/sqlite3.c
|
||||
@@ -147371,9 +147371,7 @@ struct WhereInfo {
|
||||
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
|
||||
ExprList *pResultSet; /* Result set of the query */
|
||||
Expr *pWhere; /* The complete WHERE clause */
|
||||
-#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
- Select *pLimit; /* Used to access LIMIT expr/registers for vtabs */
|
||||
-#endif
|
||||
+ Select *pSelect; /* The entire SELECT statement containing WHERE */
|
||||
int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
|
||||
int iContinue; /* Jump here to continue with next record */
|
||||
int iBreak; /* Jump here to break out of the loop */
|
||||
@@ -149070,9 +149068,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
&& pLoop->u.vtab.bOmitOffset
|
||||
){
|
||||
assert( pTerm->eOperator==WO_AUX );
|
||||
- assert( pWInfo->pLimit!=0 );
|
||||
- assert( pWInfo->pLimit->iOffset>0 );
|
||||
- sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pLimit->iOffset);
|
||||
+ assert( pWInfo->pSelect!=0 );
|
||||
+ assert( pWInfo->pSelect->iOffset>0 );
|
||||
+ sqlite3VdbeAddOp2(v, OP_Integer, 0, pWInfo->pSelect->iOffset);
|
||||
VdbeComment((v,"Zero OFFSET counter"));
|
||||
}
|
||||
}
|
||||
@@ -151830,10 +151828,10 @@ static void whereAddLimitExpr(
|
||||
** exist only so that they may be passed to the xBestIndex method of the
|
||||
** single virtual table in the FROM clause of the SELECT.
|
||||
*/
|
||||
-SQLITE_PRIVATE void sqlite3WhereAddLimit(WhereClause *pWC, Select *p){
|
||||
- assert( p==0 || (p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0) );
|
||||
- if( (p && p->pLimit) /* 1 */
|
||||
- && (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */
|
||||
+SQLITE_PRIVATE void SQLITE_NOINLINE sqlite3WhereAddLimit(WhereClause *pWC, Select *p){
|
||||
+ assert( p!=0 && p->pLimit!=0 ); /* 1 -- checked by caller */
|
||||
+ assert( p->pGroupBy==0 && (p->selFlags & SF_Aggregate)==0 );
|
||||
+ if( (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */
|
||||
&& (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */
|
||||
){
|
||||
ExprList *pOrderBy = p->pOrderBy;
|
||||
@@ -157427,7 +157425,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
|
||||
Expr *pWhere, /* The WHERE clause */
|
||||
ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */
|
||||
ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */
|
||||
- Select *pLimit, /* Use this LIMIT/OFFSET clause, if any */
|
||||
+ Select *pSelect, /* The entire SELECT statement */
|
||||
u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */
|
||||
int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, index cursor number
|
||||
** If WHERE_USE_LIMIT, then the limit amount */
|
||||
@@ -157504,9 +157502,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
|
||||
pWInfo->wctrlFlags = wctrlFlags;
|
||||
pWInfo->iLimit = iAuxArg;
|
||||
pWInfo->savedNQueryLoop = pParse->nQueryLoop;
|
||||
-#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
- pWInfo->pLimit = pLimit;
|
||||
-#endif
|
||||
+ pWInfo->pSelect = pSelect;
|
||||
memset(&pWInfo->nOBSat, 0,
|
||||
offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat));
|
||||
memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel));
|
||||
@@ -157575,7 +157571,9 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
|
||||
|
||||
/* Analyze all of the subexpressions. */
|
||||
sqlite3WhereExprAnalyze(pTabList, &pWInfo->sWC);
|
||||
- sqlite3WhereAddLimit(&pWInfo->sWC, pLimit);
|
||||
+ if( pSelect && pSelect->pLimit ){
|
||||
+ sqlite3WhereAddLimit(&pWInfo->sWC, pSelect);
|
||||
+ }
|
||||
if( db->mallocFailed ) goto whereBeginError;
|
||||
|
||||
/* Special case: WHERE terms that do not refer to any tables in the join
|
||||
@@ -1,32 +0,0 @@
|
||||
From b816ca9994e03a8bc829b49452b8158a731e81a9 Mon Sep 17 00:00:00 2001
|
||||
From: drh <>
|
||||
Date: Thu, 16 Mar 2023 20:54:29 +0000
|
||||
Subject: [PATCH] Correctly handle SELECT DISTINCT ... ORDER BY when all of the
|
||||
result set terms are constant and there are more result set terms than ORDER
|
||||
BY terms. Fix for these tickets: [c36cdb4afd504dc1], [4051a7f931d9ba24],
|
||||
[d6fd512f50513ab7].
|
||||
|
||||
FossilOrigin-Name: 12ad822d9b827777526ca5ed5bf3e678d600294fc9b5c25482dfff2a021328a4
|
||||
|
||||
CVE: CVE-2025-7458
|
||||
Upstream-Status: Backport [github.com/sqlite/sqlite/commit/b816ca9994e03a8bc829b49452b8158a731e81a9]
|
||||
Signed-off-by: Peter Marko <peter.marko@siemens.com>
|
||||
---
|
||||
sqlite3.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/sqlite3.c b/sqlite3.c
|
||||
index 19d0438..6d92184 100644
|
||||
--- a/sqlite3.c
|
||||
+++ b/sqlite3.c
|
||||
@@ -156989,6 +156989,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){
|
||||
pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
|
||||
}
|
||||
+ if( pWInfo->pSelect->pOrderBy
|
||||
+ && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){
|
||||
+ pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr;
|
||||
+ }
|
||||
}else{
|
||||
pWInfo->nOBSat = pFrom->isOrdered;
|
||||
pWInfo->revMask = pFrom->revLoop;
|
||||
@@ -10,8 +10,6 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
|
||||
file://CVE-2023-7104.patch \
|
||||
file://CVE-2025-29088.patch \
|
||||
file://CVE-2025-6965.patch \
|
||||
file://0001-This-branch-attempts-to-improve-the-detection-of-cov.patch \
|
||||
file://CVE-2025-7458.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@ Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
|
||||
src/Makefile | 14 ++++----------
|
||||
1 file changed, 4 insertions(+), 10 deletions(-)
|
||||
|
||||
Index: git/src/Makefile
|
||||
===================================================================
|
||||
--- git.orig/src/Makefile
|
||||
+++ git/src/Makefile
|
||||
@@ -3101,16 +3101,10 @@ auto/pathdef.c: Makefile auto/config.mk
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 32c0d97d1..97c754673 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -3138,16 +3138,10 @@ auto/pathdef.c: Makefile auto/config.mk
|
||||
-@echo '#include "vim.h"' >> $@
|
||||
-@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' | $(QUOTESED) >> $@
|
||||
-@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' | $(QUOTESED) >> $@
|
||||
|
||||
@@ -13,11 +13,11 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
src/configure.ac | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: git/src/configure.ac
|
||||
===================================================================
|
||||
--- git.orig/src/configure.ac
|
||||
+++ git/src/configure.ac
|
||||
@@ -3292,7 +3292,7 @@ AC_CHECK_HEADERS(stdint.h stdlib.h strin
|
||||
diff --git a/src/configure.ac b/src/configure.ac
|
||||
index cdb818519..dafb7d6ce 100644
|
||||
--- a/src/configure.ac
|
||||
+++ b/src/configure.ac
|
||||
@@ -3400,7 +3400,7 @@ AC_CHECK_HEADERS(stdint.h stdlib.h string.h \
|
||||
sys/systeminfo.h locale.h sys/stream.h termios.h \
|
||||
libc.h sys/statfs.h poll.h sys/poll.h pwd.h \
|
||||
utime.h sys/param.h sys/ptms.h libintl.h libgen.h \
|
||||
@@ -26,7 +26,7 @@ Index: git/src/configure.ac
|
||||
sys/access.h sys/sysinfo.h wchar.h wctype.h)
|
||||
|
||||
dnl sys/ptem.h depends on sys/stream.h on Solaris
|
||||
@@ -3974,6 +3974,7 @@ AC_ARG_ENABLE(acl,
|
||||
@@ -4137,6 +4137,7 @@ AC_ARG_ENABLE(acl,
|
||||
, [enable_acl="yes"])
|
||||
if test "$enable_acl" = "yes"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
vim: do not adjust script pathnames
|
||||
From 4125a1ccb82fd53d003acdc34e462f238f0c4f0d Mon Sep 17 00:00:00 2001
|
||||
From: Joe Slater <joe.slater@windriver.com>
|
||||
Date: Fri, 8 Jul 2022 11:03:22 +0800
|
||||
Subject: [PATCH] vim: do not adjust script pathnames
|
||||
|
||||
When cross-compiling, we do not want to reference the host versions of
|
||||
things like perl and awk.
|
||||
@@ -6,24 +9,28 @@ things like perl and awk.
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Joe Slater <joe.slater@windriver.com>
|
||||
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
|
||||
---
|
||||
src/Makefile | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
Index: git/src/Makefile
|
||||
===================================================================
|
||||
--- git.orig/src/Makefile
|
||||
+++ git/src/Makefile
|
||||
@@ -2565,11 +2565,14 @@ installtools: $(TOOLS) $(DESTDIR)$(exec_
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index c9513a632..7a7cbdc43 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -2552,11 +2552,7 @@ installtools: $(TOOLS) $(DESTDIR)$(exec_prefix) $(DEST_BIN) \
|
||||
rm -rf $$cvs; \
|
||||
fi
|
||||
-chmod $(FILEMOD) $(DEST_TOOLS)/*
|
||||
-# replace the path in some tools
|
||||
+
|
||||
+# replace the path in some tools, but not when cross-compiling
|
||||
+ifneq ($(CROSS_COMPILING),1)
|
||||
perlpath=`./which.sh perl` && sed -e "s+/usr/bin/perl+$$perlpath+" $(TOOLSSOURCE)/efm_perl.pl >$(DEST_TOOLS)/efm_perl.pl
|
||||
awkpath=`./which.sh nawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \
|
||||
awkpath=`./which.sh gawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \
|
||||
awkpath=`./which.sh awk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; fi; fi
|
||||
+endif
|
||||
- perlpath=`./which.sh perl` && sed -e "s+/usr/bin/perl+$$perlpath+" $(TOOLSSOURCE)/efm_perl.pl >$(DEST_TOOLS)/efm_perl.pl
|
||||
- awkpath=`./which.sh nawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \
|
||||
- awkpath=`./which.sh gawk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; if test -z "$$awkpath"; then \
|
||||
- awkpath=`./which.sh awk` && sed -e "s+/usr/bin/nawk+$$awkpath+" $(TOOLSSOURCE)/mve.awk >$(DEST_TOOLS)/mve.awk; fi; fi
|
||||
+# not replace the path in some tools
|
||||
-chmod $(SCRIPTMOD) `grep -l "^#!" $(DEST_TOOLS)/*`
|
||||
|
||||
# install the language specific files for tools, if they were unpacked
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
|
||||
file://no-path-adjust.patch \
|
||||
"
|
||||
|
||||
PV .= ".1198"
|
||||
SRCREV = "f209dcd3defb95bae21b2740910e6aa7bb940531"
|
||||
PV .= ".1652"
|
||||
SRCREV = "3e152c76adb9542af86760786d42a0beffe5354b"
|
||||
|
||||
# Do not consider .z in x.y.z, as that is updated with every commit
|
||||
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+)\.0"
|
||||
@@ -37,7 +37,7 @@ CLEANBROKEN = "1"
|
||||
# vim configure.in contains functions which got 'dropped' by autotools.bbclass
|
||||
do_configure () {
|
||||
cd src
|
||||
rm -f auto/*
|
||||
rm -rf auto/*
|
||||
touch auto/config.mk
|
||||
# git timestamps aren't reliable, so touch the shipped .po files so they aren't regenerated
|
||||
touch -c po/cs.cp1250.po po/ja.euc-jp.po po/ja.sjis.po po/ko.po po/pl.UTF-8.po po/pl.cp1250.po po/ru.cp1251.po po/sk.cp1250.po po/uk.cp1251.po po/zh_CN.po po/zh_CN.cp936.po po/zh_TW.po
|
||||
@@ -76,6 +76,7 @@ EXTRA_OECONF = " \
|
||||
--disable-desktop-database-update \
|
||||
--with-tlib=ncurses \
|
||||
--with-modified-by='${MAINTAINER}' \
|
||||
--with-wayland=no \
|
||||
ac_cv_small_wchar_t=no \
|
||||
ac_cv_path_GLIB_COMPILE_RESOURCES=no \
|
||||
vim_cv_getcwd_broken=no \
|
||||
|
||||
Reference in New Issue
Block a user