* [gentoo-commits] proj/portage:master commit in: lib/portage/, /, lib/portage/tests/util/
@ 2023-03-21 2:30 Sam James
0 siblings, 0 replies; only message in thread
From: Sam James @ 2023-03-21 2:30 UTC (permalink / raw
To: gentoo-commits
commit: 377a31434ae51b6e6465ba48b5132eb200a8cf40
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 20 03:16:37 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 02:30:23 2023 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=377a3143
checksum: drop STREEBOG{256,512} & pygost support
For STREEBOG{256,512}, we had three options that we "supported":
1. using pygost;
pygost is unpackaged in Gentoo and appears to, as of March 2023, been yanked
from pypi too.
Hence not only can we test it on the distribution where we do our development
(Gentoo), but we also can't acquire it for CI easily either.
2. using pygcrypt;
No longer in Gentoo and the codepath for this has been disabled since 2017(!)
because of https://bugs.gentoo.org/615620.
3. a slow fallback implementation.
This is not something we can rely on anyway, but this is especially wrong
given the issues we've had recently with WHIRLPOOL. See https://bugs.gentoo.org/885909.
As for whether we should support STREEBOG at all:
- Per above, we don't have a decent implementation for it available.
- We're not testing it very well.
- Jugging obscure hash algorithms has become a pain because some of them have
ended up being marked "legacy" or removed from OpenSSL by default.
- I don't think we should have hash algorithms supported just for the sake of it.
We're not in the business of supporting every single hash algorithm that a
library with Python bindings out there provides.
Bug: https://bugs.gentoo.org/597736
Bug: https://bugs.gentoo.org/615620
Bug: https://bugs.gentoo.org/885909
Bug: https://bugs.gentoo.org/888884
Signed-off-by: Sam James <sam <AT> gentoo.org>
lib/portage/checksum.py | 25 +------------------------
lib/portage/tests/util/test_checksum.py | 26 --------------------------
tox.ini | 1 -
3 files changed, 1 insertion(+), 51 deletions(-)
diff --git a/lib/portage/checksum.py b/lib/portage/checksum.py
index 31c4d1fc7..307dd4429 100644
--- a/lib/portage/checksum.py
+++ b/lib/portage/checksum.py
@@ -151,7 +151,7 @@ if "SHA3_256" not in hashfunc_map or "SHA3_512" not in hashfunc_map:
# Support pygcrypt as fallback using optimized routines from libgcrypt
# (GnuPG).
gcrypt_algos = frozenset(
- ("RMD160", "WHIRLPOOL", "SHA3_256", "SHA3_512", "STREEBOG256", "STREEBOG512")
+ ("RMD160", "WHIRLPOOL", "SHA3_256", "SHA3_512")
)
# Note: currently disabled due to resource exhaustion bugs in pygcrypt.
# Please do not reenable until upstream has a fix.
@@ -177,8 +177,6 @@ if False:
"WHIRLPOOL": "whirlpool",
"SHA3_256": "sha3-256",
"SHA3_512": "sha3-512",
- "STREEBOG256": "stribog256",
- "STREEBOG512": "stribog512",
}
for local_name, gcry_name in name_mapping.items():
@@ -283,27 +281,6 @@ if "RMD160" not in hashfunc_map or "WHIRLPOOL" not in hashfunc_map:
pass
-# Support pygost as fallback streebog provider
-# It's mostly provided as a reference implementation; it's pure Python,
-# slow and reads all data to memory (i.e. doesn't hash on update()...)
-if "STREEBOG256" not in hashfunc_map or "STREEBOG512" not in hashfunc_map:
- try:
- import pygost.gost34112012
-
- _generate_hash_function(
- "STREEBOG256",
- functools.partial(pygost.gost34112012.GOST34112012, digest_size=32),
- origin="pygost",
- )
- _generate_hash_function(
- "STREEBOG512",
- functools.partial(pygost.gost34112012.GOST34112012, digest_size=64),
- origin="pygost",
- )
- except ImportError:
- pass
-
-
_whirlpool_unaccelerated = False
if "WHIRLPOOL" not in hashfunc_map:
# Bundled WHIRLPOOL implementation
diff --git a/lib/portage/tests/util/test_checksum.py b/lib/portage/tests/util/test_checksum.py
index 0e49f882f..4a63e6fdc 100644
--- a/lib/portage/tests/util/test_checksum.py
+++ b/lib/portage/tests/util/test_checksum.py
@@ -121,32 +121,6 @@ class ChecksumTestCase(TestCase):
except DigestException:
self.skipTest("SHA3_512 implementation not available")
- def test_streebog256(self):
- try:
- self.assertEqual(
- checksum_str(b"", "STREEBOG256"),
- "3f539a213e97c802cc229d474c6aa32a825a360b2a933a949fd925208d9ce1bb",
- )
- self.assertEqual(
- checksum_str(self.text, "STREEBOG256"),
- "4992f1239c46f15b89e7b83ded4d83fb5966da3692788a4a1a6d118f78c08444",
- )
- except DigestException:
- self.skipTest("STREEBOG256 implementation not available")
-
- def test_streebog512(self):
- try:
- self.assertEqual(
- checksum_str(b"", "STREEBOG512"),
- "8e945da209aa869f0455928529bcae4679e9873ab707b55315f56ceb98bef0a7362f715528356ee83cda5f2aac4c6ad2ba3a715c1bcd81cb8e9f90bf4c1c1a8a",
- )
- self.assertEqual(
- checksum_str(self.text, "STREEBOG512"),
- "330f5c26437f4e22c0163c72b12e93b8c27202f0750627355bdee43a0e0b253c90fbf0a27adbe5414019ff01ed84b7b240a1da1cbe10fae3adffc39c2d87a51f",
- )
- except DigestException:
- self.skipTest("STREEBOG512 implementation not available")
-
class ApplyHashFilterTestCase(TestCase):
def test_apply_hash_filter(self):
diff --git a/tox.ini b/tox.ini
index 5afcdab12..6760bde03 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,6 @@ python =
[testenv]
deps =
pylint: pylint
- pygost
pyyaml
setenv =
PYTHONPATH={toxinidir}/lib
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-21 2:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-21 2:30 [gentoo-commits] proj/portage:master commit in: lib/portage/, /, lib/portage/tests/util/ Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox