From 290aebdea65a02557706eaeda477fef0437b6a48 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 12 Jun 2026 11:50:53 -0500 Subject: Adding metadata --- dev-python/spake2/Manifest | 2 - .../files/spake2-0.8-do_not_use_hkdf_package.patch | 113 --------------------- dev-python/spake2/metadata.xml | 10 -- dev-python/spake2/spake2-0.8-r1.ebuild | 45 -------- dev-python/spake2/spake2-0.9.ebuild | 41 -------- 5 files changed, 211 deletions(-) delete mode 100644 dev-python/spake2/Manifest delete mode 100644 dev-python/spake2/files/spake2-0.8-do_not_use_hkdf_package.patch delete mode 100644 dev-python/spake2/metadata.xml delete mode 100644 dev-python/spake2/spake2-0.8-r1.ebuild delete mode 100644 dev-python/spake2/spake2-0.9.ebuild (limited to 'dev-python/spake2') diff --git a/dev-python/spake2/Manifest b/dev-python/spake2/Manifest deleted file mode 100644 index a0dbf66952ae..000000000000 --- a/dev-python/spake2/Manifest +++ /dev/null @@ -1,2 +0,0 @@ -DIST python-spake2-0.8.gh.tar.gz 62425 BLAKE2B 64215362af26fff0785fdabf4282f7111a4cc917750827075b616f009cb1fa6373fc2325382c26b43c051aa5b94e414ca2a5223d9ab666289eb2d04723b15cb5 SHA512 908c377c831f4a11551973ca917b113d51a66c533d35fd19b2692fdb7e575ed2a5045d9b632bc55c37b68ad092f01dff5da191e9dfbfb5599b72844788438d68 -DIST python-spake2-0.9.gh.tar.gz 61563 BLAKE2B e8179a90bf71d72f19ae4bdeda2092147f409c8b5bf3b8eb98bb624e413bcbd73306de20ffa0d36fca010a00dea0f16aafa660f08ae5e15425c2756fafeaf24d SHA512 557b17b8e28214b9c2cd0362c991ac0f61996812fd747e66397c48fdbbb314eb4e9acba9670ca41d0924f4b688931f2b32a7e9ba947ee1db3df00e9e9670d497 diff --git a/dev-python/spake2/files/spake2-0.8-do_not_use_hkdf_package.patch b/dev-python/spake2/files/spake2-0.8-do_not_use_hkdf_package.patch deleted file mode 100644 index 40e9e17a6843..000000000000 --- a/dev-python/spake2/files/spake2-0.8-do_not_use_hkdf_package.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 930bfabc17748ea3772e6a40b04e84fc4aafcf04 Mon Sep 17 00:00:00 2001 -From: meejah -Date: Wed, 9 Nov 2022 23:42:33 -0700 -Subject: [PATCH 1/2] use cryptography's HKDF implementation - ---- - setup.py | 2 +- - src/spake2/ed25519_basic.py | 2 +- - src/spake2/groups.py | 21 ++++++++++++++------- - src/spake2/test/test_compat.py | 9 +++++---- - 4 files changed, 21 insertions(+), 13 deletions(-) - -diff --git a/setup.py b/setup.py -index 660f055..ba3cc28 100755 ---- a/setup.py -+++ b/setup.py -@@ -79,5 +79,5 @@ def abbrev(t): - "Programming Language :: Python :: 3.6", - "Topic :: Security :: Cryptography", - ], -- install_requires=["hkdf"], -+ install_requires=["cryptography"], - ) -diff --git a/src/spake2/ed25519_basic.py b/src/spake2/ed25519_basic.py -index 1890be7..dbab56d 100644 ---- a/src/spake2/ed25519_basic.py -+++ b/src/spake2/ed25519_basic.py -@@ -273,7 +273,7 @@ def arbitrary_element(seed): # unknown DL - # oversized string (128 bits more than the field size), then reducing - # down to Q. But it's comforting, and it's the same technique we use for - # converting passwords/seeds to scalars (which *does* need uniformity). -- hseed = expand_arbitrary_element_seed(seed, (256/8)+16) -+ hseed = expand_arbitrary_element_seed(seed, int((256/8)+16)) - y = int(binascii.hexlify(hseed), 16) % Q - - # we try successive Y values until we find a valid point -diff --git a/src/spake2/groups.py b/src/spake2/groups.py -index de4f75d..66b08e7 100644 ---- a/src/spake2/groups.py -+++ b/src/spake2/groups.py -@@ -1,6 +1,7 @@ - from __future__ import division - import hashlib --from hkdf import Hkdf -+from cryptography.hazmat.primitives.kdf import hkdf -+from cryptography.hazmat.primitives import hashes - from .six import integer_types - from .util import (size_bits, size_bytes, unbiased_randrange, - bytes_to_number, number_to_bytes) -@@ -63,9 +64,12 @@ - - - def expand_password(data, num_bytes): -- h = Hkdf(salt=b"", input_key_material=data, hash=hashlib.sha256) -- info = b"SPAKE2 pw" -- return h.expand(info, num_bytes) -+ return hkdf.HKDF( -+ algorithm=hashes.SHA256(), -+ length=num_bytes, -+ salt=b"", -+ info=b"SPAKE2 pw" -+ ).derive(data) - - def password_to_scalar(pw, scalar_size_bytes, q): - assert isinstance(pw, bytes) -@@ -77,9 +81,12 @@ def password_to_scalar(pw, scalar_size_bytes, q): - return i % q - - def expand_arbitrary_element_seed(data, num_bytes): -- h = Hkdf(salt=b"", input_key_material=data, hash=hashlib.sha256) -- info = b"SPAKE2 arbitrary element" -- return h.expand(info, num_bytes) -+ return hkdf.HKDF( -+ algorithm=hashes.SHA256(), -+ length=num_bytes, -+ salt=b"", -+ info=b"SPAKE2 arbitrary element" -+ ).derive(data) - - class _Element: - def __init__(self, group, e): -diff --git a/src/spake2/test/test_compat.py b/src/spake2/test/test_compat.py -index 3c636be..1c1340c 100644 ---- a/src/spake2/test/test_compat.py -+++ b/src/spake2/test/test_compat.py -@@ -1,7 +1,8 @@ - import unittest - from binascii import hexlify, unhexlify - from hashlib import sha256 --from hkdf import Hkdf -+from cryptography.hazmat.primitives.kdf import hkdf -+from cryptography.hazmat.primitives import hashes - from .myhkdf import HKDF as myHKDF - from spake2 import groups, ed25519_group - from spake2.spake2 import (SPAKE2_A, SPAKE2_B, SPAKE2_Symmetric, -@@ -213,14 +214,14 @@ def test_vectors(self): - {"salt": "00", "IKM": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", "info": "", "L": 4, "OKM": "37ad2910"}, - ] - --class HKDF(unittest.TestCase): -+class TestHKDF(unittest.TestCase): - def test_vectors(self): - for vector in HKDF_TEST_VECTORS: - salt = unhexlify(vector["salt"].encode("ascii")) - IKM = unhexlify(vector["IKM"].encode("ascii")) - info = unhexlify(vector["info"].encode("ascii")) -- h = Hkdf(salt=salt, input_key_material=IKM, hash=sha256) -- digest = h.expand(info, vector["L"]) -+ h = hkdf.HKDF(algorithm=hashes.SHA256(), length=vector["L"], salt=salt, info=info) -+ digest = h.derive(IKM) - self.assertEqual(digest, myHKDF(IKM, vector["L"], salt, info)) - #print(hexlify(digest)) - expected = vector["OKM"].encode("ascii") diff --git a/dev-python/spake2/metadata.xml b/dev-python/spake2/metadata.xml deleted file mode 100644 index 5e95859f915a..000000000000 --- a/dev-python/spake2/metadata.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - python@gentoo.org - Python - - - baldeagleos-repo - diff --git a/dev-python/spake2/spake2-0.8-r1.ebuild b/dev-python/spake2/spake2-0.8-r1.ebuild deleted file mode 100644 index 2ceadf9562df..000000000000 --- a/dev-python/spake2/spake2-0.8-r1.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{13..14} ) - -inherit distutils-r1 - -MY_P=python-spake2-${PV} -DESCRIPTION="python implementation of SPAKE2 password-authenticated key exchange algorithm" -HOMEPAGE=" - https://github.com/warner/python-spake2/ - https://pypi.org/project/spake2/ -" -SRC_URI=" - https://github.com/warner/python-spake2/archive/v${PV}.tar.gz - -> ${MY_P}.gh.tar.gz -" -S=${WORKDIR}/${MY_P} - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" - -RDEPEND=" - dev-python/cryptography[${PYTHON_USEDEP}] - dev-python/more-itertools[${PYTHON_USEDEP}] -" -BDEPEND=" - dev-python/versioneer[${PYTHON_USEDEP}] -" - -PATCHES=( - "${FILESDIR}"/${P}-do_not_use_hkdf_package.patch -) - -distutils_enable_tests pytest - -src_prepare() { - # remove outdated bundled versioneer - rm versioneer.py || die - distutils-r1_src_prepare -} diff --git a/dev-python/spake2/spake2-0.9.ebuild b/dev-python/spake2/spake2-0.9.ebuild deleted file mode 100644 index 6a424a6a7bba..000000000000 --- a/dev-python/spake2/spake2-0.9.ebuild +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{13..14} ) - -inherit distutils-r1 - -MY_P=python-spake2-${PV} -DESCRIPTION="python implementation of SPAKE2 password-authenticated key exchange algorithm" -HOMEPAGE=" - https://github.com/warner/python-spake2/ - https://pypi.org/project/spake2/ -" -SRC_URI=" - https://github.com/warner/python-spake2/archive/v${PV}.tar.gz - -> ${MY_P}.gh.tar.gz -" -S=${WORKDIR}/${MY_P} - -LICENSE="MIT" -SLOT="0" -KEYWORDS="amd64 ~arm64 ~x86" - -RDEPEND=" - dev-python/cryptography[${PYTHON_USEDEP}] - dev-python/more-itertools[${PYTHON_USEDEP}] -" -BDEPEND=" - dev-python/versioneer[${PYTHON_USEDEP}] -" - -distutils_enable_tests pytest - -src_prepare() { - # remove outdated bundled versioneer - rm versioneer.py || die - distutils-r1_src_prepare -} -- cgit v1.3