diff --git a/crypto_kdf_derive.patch b/crypto_kdf_derive.patch new file mode 100644 index 0000000..18596b6 --- /dev/null +++ b/crypto_kdf_derive.patch @@ -0,0 +1,12 @@ +diff -rub libnacl-1.7.2/libnacl/__init__.py libnacl-1.7.2-patched/libnacl/__init__.py +--- libnacl-1.7.2/libnacl/__init__.py 2020-11-03 22:34:59.000000000 +0100 ++++ libnacl-1.7.2-patched/libnacl/__init__.py 2021-06-12 00:31:42.133601308 +0200 +@@ -1180,7 +1180,7 @@ + ''' + size = int(subkey_size) + buf = ctypes.create_string_buffer(size) +- nacl.crypto_kdf_derive_from_key(buf, subkey_size, subkey_id, context, master_key) ++ nacl.crypto_kdf_derive_from_key(buf, subkey_size, ctypes.c_ulonglong(subkey_id), context, master_key) + return buf.raw + + # Key Exchange API diff --git a/python-libnacl.changes b/python-libnacl.changes index 960f22d..e7cd6a1 100644 --- a/python-libnacl.changes +++ b/python-libnacl.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 11 22:36:47 UTC 2021 - Niels Abspoel + +- add crypto_kdf_derive.patch to fix crypto_kdf_derive_from_key() on 32-bit platforms + ------------------------------------------------------------------- Thu Feb 18 20:17:07 UTC 2021 - Niels Abspoel diff --git a/python-libnacl.spec b/python-libnacl.spec index 728347a..04cdb74 100644 --- a/python-libnacl.spec +++ b/python-libnacl.spec @@ -24,6 +24,7 @@ Summary: Python bindings for libsodium based on ctypes License: Apache-2.0 URL: https://github.com/saltstack/libnacl Source0: https://github.com/saltstack/libnacl/archive/v%{version}.tar.gz#/libnacl-%{version}.tar.gz +Patch0: crypto_kdf_derive.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -42,6 +43,7 @@ in libnacl/__init__.py can be pulled out and placed directly in any project to g %prep %setup -q -n libnacl-%{version} +%patch0 -p1 %build %python_build