]> code.ossystems Code Review - openembedded-core.git/commit
meta/lib/oe/package_manager.py: Enable sha256 checksums in opkg indexer
authorHaris Okanovic <haris.okanovic@ni.com>
Thu, 7 Nov 2019 22:07:36 +0000 (16:07 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 10 Nov 2019 14:04:55 +0000 (14:04 +0000)
commite462f47489f35902b6972f9837d9adfa542fc796
treed7afcca377327c5fe6ae71b32e7535ba177c34c1
parente935cba0122a93df611c9a846c16b7841b715fd8
meta/lib/oe/package_manager.py: Enable sha256 checksums in opkg indexer

Pass `--checksum md5` and `--checksum sha256` to opkg-make-index.

Sha256 checksum enables more reliable install-time validation of IPKs.
This is particularly useful when installing from signed feeds --
I.e. feeds using signed Packages index files that deliver otherwise
unsigned IPKs. Such feeds rely on hash validation of enclosed IPKs to
thwart tampering. After download, opkg verifies IPK's checksum against
the (signed) Packages index file. Weak hashes like md5 are prone to
collision and therefore tampering.

The md5 checksum is purely for backward compatibility. Sha256 validation
was recently added to opkg. Newer builds of opkg will use it. Older
builds still look for an md5 checksum. Md5 is deprecated and should be
removed once old build are phased out.

Testing: I ran `bitbake package-index` after building a few IPKs and
verified MD5Sum and SHA256sum attributes are present in Packages.
Using opkg-utils 0.4.0.

Performance Impact: It takes about 40 seconds to cleanly re-index 8000
IPKs on an Intel Xeon E5-1620 machine. This was previously about
20 seconds.

NOTE: It's recommended to delete all Packages* files after applying this
patch. Otherwise, some IPKs won't have sha256.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package_manager.py