Hello community,
here is the log from the commit of package python-libnacl for openSUSE:Factory checked in at 2014-09-03 08:30:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-libnacl (Old)
and /work/SRC/openSUSE:Factory/.python-libnacl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-libnacl"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-libnacl/python-libnacl.changes 2014-08-15 09:56:19.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-libnacl.new/python-libnacl.changes 2014-09-03 08:30:38.000000000 +0200
@@ -1,0 +2,9 @@
+Tue Sep 2 17:28:35 UTC 2014 - aboe76@gmail.com
+
+- Updated to 1.3.4
+ + Fixed issue and add tests for bug where saving and loading a signing key caused a stack trace, se issue #18
+ + Change the default ctype values to be more accurate and efficient
+ + Update soname detection on Linux for libsodium 0.7.0
+ + Make soname detection a little more future proof
+
+-------------------------------------------------------------------
Old:
----
libnacl-1.3.2.tar.gz
New:
----
libnacl-1.3.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-libnacl.spec ++++++
--- /var/tmp/diff_new_pack.dPoHso/_old 2014-09-03 08:30:42.000000000 +0200
+++ /var/tmp/diff_new_pack.dPoHso/_new 2014-09-03 08:30:42.000000000 +0200
@@ -16,7 +16,7 @@
#
Name: python-libnacl
-Version: 1.3.2
+Version: 1.3.4
Release: 0
License: Apache-2.0
Summary: Python bindings for libsodium/tweetnacl based on ctypes
++++++ libnacl-1.3.2.tar.gz -> libnacl-1.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/PKG-INFO new/libnacl-1.3.4/PKG-INFO
--- old/libnacl-1.3.2/PKG-INFO 2014-08-13 04:50:56.000000000 +0200
+++ new/libnacl-1.3.4/PKG-INFO 2014-09-01 01:46:16.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: libnacl
-Version: 1.3.2
+Version: 1.3.4
Summary: Python bindings for libsodium/tweetnacl based on ctypes
Home-page: https://libnacl.readthedocs.org/
Author: Thomas S Hatch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/conf.py new/libnacl-1.3.4/doc/conf.py
--- old/libnacl-1.3.2/doc/conf.py 2014-08-13 04:25:43.000000000 +0200
+++ new/libnacl-1.3.4/doc/conf.py 2014-09-01 01:37:44.000000000 +0200
@@ -15,7 +15,6 @@
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
-from libnacl.version import __version__
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -54,9 +53,9 @@
# built documents.
#
# The short X.Y version.
-version = __version__
+version = '1.3.4'
# The full version, including alpha/beta/rc tags.
-release = __version__
+release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/index.rst new/libnacl-1.3.4/doc/index.rst
--- old/libnacl-1.3.2/doc/index.rst 2014-08-13 04:25:43.000000000 +0200
+++ new/libnacl-1.3.4/doc/index.rst 2014-08-15 07:39:06.000000000 +0200
@@ -10,6 +10,7 @@
topics/secret
topics/sign
topics/dual
+ topics/utils
topics/raw_public
topics/raw_secret
topics/raw_sign
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/topics/dual.rst new/libnacl-1.3.4/doc/topics/dual.rst
--- old/libnacl-1.3.2/doc/topics/dual.rst 2014-08-13 04:25:43.000000000 +0200
+++ new/libnacl-1.3.4/doc/topics/dual.rst 2014-08-15 07:19:46.000000000 +0200
@@ -38,8 +38,7 @@
Every encryption routine requires a nonce. The nonce is a 24 char string
that must never be used twice with the same keypair. If no nonce is passed
- in then a nonce is generated based on the time of the encryption plus
- random data.
+ in then a nonce is generated based on random data.
If it is desired to generate a nonce manually this can be done by passing
it into the encrypt method.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/topics/public.rst new/libnacl-1.3.4/doc/topics/public.rst
--- old/libnacl-1.3.2/doc/topics/public.rst 2014-08-13 04:25:43.000000000 +0200
+++ new/libnacl-1.3.4/doc/topics/public.rst 2014-08-15 07:21:09.000000000 +0200
@@ -38,8 +38,7 @@
Every encryption routine requires a nonce. The nonce is a 24 char string
that must never be used twice with the same keypair. If no nonce is passed
- in then a nonce is generated based on the time of the encryption plus
- random data.
+ in then a nonce is generated based on random data.
If it is desired to generate a nonce manually this can be done by passing
it into the encrypt method.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/topics/releases/1.3.2.rst new/libnacl-1.3.4/doc/topics/releases/1.3.2.rst
--- old/libnacl-1.3.2/doc/topics/releases/1.3.2.rst 2014-08-13 04:48:49.000000000 +0200
+++ new/libnacl-1.3.4/doc/topics/releases/1.3.2.rst 2014-08-15 07:10:52.000000000 +0200
@@ -1,5 +1,5 @@
===========================
-libnacl 1.3.1 Release Notes
+libnacl 1.3.2 Release Notes
===========================
Add detection of the libsodium.so.10 lib created by libsodium 0.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/topics/releases/1.3.3.rst new/libnacl-1.3.4/doc/topics/releases/1.3.3.rst
--- old/libnacl-1.3.2/doc/topics/releases/1.3.3.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/libnacl-1.3.4/doc/topics/releases/1.3.3.rst 2014-08-15 07:11:51.000000000 +0200
@@ -0,0 +1,6 @@
+===========================
+libnacl 1.3.3 Release Notes
+===========================
+
+Fix issue and add tests for bug where saving and loading a signing key caused
+a stack trace, se issue #18
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/topics/releases/1.3.4.rst new/libnacl-1.3.4/doc/topics/releases/1.3.4.rst
--- old/libnacl-1.3.2/doc/topics/releases/1.3.4.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/libnacl-1.3.4/doc/topics/releases/1.3.4.rst 2014-09-01 01:41:17.000000000 +0200
@@ -0,0 +1,7 @@
+===========================
+libnacl 1.3.4 Release Notes
+===========================
+
+* Change the default ctype values to be more accurate and efficient
+* Update soname detection on Linux for libsodium 0.7.0
+* Make soname detection a little more future proof
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/topics/secret.rst new/libnacl-1.3.4/doc/topics/secret.rst
--- old/libnacl-1.3.2/doc/topics/secret.rst 2014-08-13 04:25:43.000000000 +0200
+++ new/libnacl-1.3.4/doc/topics/secret.rst 2014-08-15 07:21:22.000000000 +0200
@@ -29,7 +29,6 @@
Every encryption routine requires a nonce. The nonce is a 24 char string
that must never be used twice with the same keypair. If no nonce is passed
- in then a nonce is generated based on the time of the encryption plus
- random data.
+ in then a nonce is generated based on random data.
If it is desired to generate a nonce manually this can be done by passing
it into the encrypt method.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/doc/topics/utils.rst new/libnacl-1.3.4/doc/topics/utils.rst
--- old/libnacl-1.3.2/doc/topics/utils.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/libnacl-1.3.4/doc/topics/utils.rst 2014-08-15 07:38:34.000000000 +0200
@@ -0,0 +1,50 @@
+=================
+Utility Functions
+=================
+
+The libnacl system comes with a number of utility functions, these functions
+are made available to make some of the aspects of encryption and key management
+easier. These range from nonce generation to loading saved keys.
+
+Loading Saved Keys
+==================
+
+After keys are saved using the key save method reloading the keys is easy. The
+`libnacl.utils.load_key` function will detect what type of key object saved
+said key and then create the object from the key and return it.
+
+.. code-block:: python
+
+ import libnacl.utils
+
+ key_obj = libnacl.utils.load_key('/etc/keys/bob.key')
+
+The load_key and save routines also support inline key serialization. The
+default is json but msgpack is also supported.
+
+Salsa Key
+=========
+
+A simple function that will return a random byte string suitable for use in
+SecretKey encryption.
+
+.. code-block:: python
+
+ import libnacl.utils
+
+ key = libnacl.utils.salsa_key
+
+This routine is only required with the raw encryption functions, as the
+`libnacl.secret.SecretBox` will generate the key automatically.
+
+Nonce Routines
+==============
+
+A few functions are available to help with creating nonce values, these
+routines are available because there is some debate about what the best approach
+is.
+
+We recommend a pure random string for the nonce which is returned from
+`rand_nonce`, but some have expressed a desire to create nonces which are
+designed to avoid re-use by more than simply random data and therefore
+the `time_nonce` function is also available.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/libnacl/__init__.py new/libnacl-1.3.4/libnacl/__init__.py
--- old/libnacl-1.3.2/libnacl/__init__.py 2014-08-13 04:40:25.000000000 +0200
+++ new/libnacl-1.3.4/libnacl/__init__.py 2014-09-01 01:34:16.000000000 +0200
@@ -9,6 +9,10 @@
import ctypes
import sys
+# libsodium likes to change the soname frequently, this should work for the
+# forseeable future but we'll need to keep an eye on this.
+__MAX_SONAME_VER = 100
+
def _get_nacl():
'''
@@ -42,23 +46,19 @@
return ctypes.cdll.LoadLibrary('libsodium.so')
except OSError:
pass
- try:
- return ctypes.cdll.LoadLibrary('libsodium.so.10')
- except OSError:
- pass
- try:
- return ctypes.cdll.LoadLibrary('libsodium.so.5')
- except OSError:
- pass
- try:
- return ctypes.cdll.LoadLibrary('libsodium.so.4')
- except OSError:
- pass
+ for soname_ver in xrange(4, __MAX_SONAME_VER + 1):
+ try:
+ return ctypes.cdll.LoadLibrary(
+ 'libsodium.so.{0}'.format(soname_ver)
+ )
+ except OSError:
+ pass
try:
return ctypes.cdll.LoadLibrary('tweetnacl.so')
except OSError:
msg = ('Could not locate nacl lib, searched for libsodium.so, '
- 'libsodium.so.5, libsodium.so.4, tweetnacl.so')
+ 'libsodium.so.X (for X <= {0}), and tweetnacl.so'
+ .format(__MAX_SONAME_VER))
raise OSError(msg)
nacl = _get_nacl()
@@ -352,7 +352,7 @@
using a given secret key
'''
tok = ctypes.create_string_buffer(crypto_auth_BYTES)
- ret = nacl.crypto_auth(tok, msg, len(msg), key)
+ ret = nacl.crypto_auth(tok, msg, ctypes.c_ulonglong(len(msg)), key)
if ret:
raise ValueError('Failed to auth msg')
return tok.raw[:crypto_auth_BYTES]
@@ -364,7 +364,7 @@
message and key
'''
tok = ctypes.create_string_buffer(crypto_auth_BYTES)
- ret = nacl.crypto_auth_verify(tok, msg, len(msg), key)
+ ret = nacl.crypto_auth_verify(tok, msg, ctypes.c_ulonglong(len(msg)), key)
if ret:
raise ValueError('Failed to auth msg')
return tok.raw[:crypto_auth_BYTES]
@@ -378,7 +378,7 @@
a given secret key
'''
tok = ctypes.create_string_buffer(crypto_onetimeauth_BYTES)
- ret = nacl.crypto_onetimeauth(tok, msg, len(msg), key)
+ ret = nacl.crypto_onetimeauth(tok, msg, ctypes.c_ulonglong(len(msg)), key)
if ret:
raise ValueError('Failed to auth msg')
return tok.raw[:crypto_onetimeauth_BYTES]
@@ -390,7 +390,7 @@
message and key
'''
tok = ctypes.create_string_buffer(crypto_onetimeauth_BYTES)
- ret = nacl.crypto_onetimeauth(tok, msg, len(msg), key)
+ ret = nacl.crypto_onetimeauth(tok, msg, ctypes.c_ulonglong(len(msg)), key)
if ret:
raise ValueError('Failed to auth msg')
return tok.raw[:crypto_onetimeauth_BYTES]
@@ -403,7 +403,7 @@
Compute a hash of the given message
'''
hbuf = ctypes.create_string_buffer(crypto_hash_BYTES)
- nacl.crypto_hash(hbuf, msg, len(msg))
+ nacl.crypto_hash(hbuf, msg, ctypes.c_ulonglong(len(msg)))
return hbuf.raw
@@ -412,7 +412,7 @@
Compute the sha256 hash of the given message
'''
hbuf = ctypes.create_string_buffer(crypto_hash_sha256_BYTES)
- nacl.crypto_hash_sha256(hbuf, msg, len(msg))
+ nacl.crypto_hash_sha256(hbuf, msg, ctypes.c_ulonglong(len(msg)))
return hbuf.raw
@@ -421,7 +421,7 @@
Compute the sha512 hash of the given message
'''
hbuf = ctypes.create_string_buffer(crypto_hash_sha512_BYTES)
- nacl.crypto_hash_sha512(hbuf, msg, len(msg))
+ nacl.crypto_hash_sha512(hbuf, msg, ctypes.c_ulonglong(len(msg)))
return hbuf.raw
@@ -473,9 +473,8 @@
'''
Return a string of random bytes of the given size
'''
- size = int(size)
buf = ctypes.create_string_buffer(size)
- nacl.randombytes(buf, size)
+ nacl.randombytes(buf, ctypes.c_ulonglong(size))
return buf.raw
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/libnacl/base.py new/libnacl-1.3.4/libnacl/base.py
--- old/libnacl-1.3.2/libnacl/base.py 2014-08-13 04:25:43.000000000 +0200
+++ new/libnacl-1.3.4/libnacl/base.py 2014-08-15 06:35:36.000000000 +0200
@@ -40,7 +40,7 @@
pk = self.hex_pk()
vk = self.hex_vk()
seed = self.hex_seed()
- if sk:
+ if sk and pk:
pre['priv'] = sk.decode(encoding='UTF-8')
if pk:
pre['pub'] = pk.decode(encoding='UTF-8')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/libnacl/utils.py new/libnacl-1.3.4/libnacl/utils.py
--- old/libnacl-1.3.2/libnacl/utils.py 2014-08-13 04:40:25.000000000 +0200
+++ new/libnacl-1.3.4/libnacl/utils.py 2014-08-15 06:41:21.000000000 +0200
@@ -24,7 +24,7 @@
elif serial == 'json':
import json
key_data = json.loads(packaged.decode(encoding='UTF-8'))
- if 'priv' and 'sign' in key_data:
+ if 'priv' in key_data and 'sign' in key_data:
return libnacl.dual.DualSecret(
libnacl.encode.hex_decode(key_data['priv']),
libnacl.encode.hex_decode(key_data['sign']))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/libnacl/version.py new/libnacl-1.3.4/libnacl/version.py
--- old/libnacl-1.3.2/libnacl/version.py 2014-08-13 04:46:51.000000000 +0200
+++ new/libnacl-1.3.4/libnacl/version.py 2014-09-01 01:37:23.000000000 +0200
@@ -1 +1 @@
-__version__ = '1.3.2'
+__version__ = '1.3.4'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libnacl-1.3.2/pkg/rpm/python-libnacl.spec new/libnacl-1.3.4/pkg/rpm/python-libnacl.spec
--- old/libnacl-1.3.2/pkg/rpm/python-libnacl.spec 2014-08-13 04:25:43.000000000 +0200
+++ new/libnacl-1.3.4/pkg/rpm/python-libnacl.spec 2014-08-15 06:15:44.000000000 +0200
@@ -1,21 +1,19 @@
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
%global with_python3 1
-%else
+%endif
%if 0%{?rhel} == 5
-%global with_python26 1
%global pybasever 2.6
%endif
%{!?__python2: %global __python2 /usr/bin/python%{?pybasever}}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
-%endif
%global srcname libnacl
Name: python-%{srcname}
-Version: 1.1.0
+Version: 1.3.2
Release: 1%{?dist}
Summary: Python bindings for libsodium/tweetnacl based on ctypes
@@ -30,10 +28,8 @@
BuildRequires: libsodium
Requires: libsodium
-%if 0%{?with_python26}
-BuildRequires: python26-devel
-BuildRequires: python26-setuptools
-%else
+%if ! (0%{?rhel} == 5)
+BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-setuptools
%endif
@@ -50,6 +46,8 @@
completely portable. The file in libnacl/__init__.py can be pulled out and
placed directly in any project to give a single file binding to all of nacl.
+This is the Python 2 build of the module.
+
%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary: Python bindings for libsodium/tweetnacl based on ctypes
@@ -62,8 +60,29 @@
to maintain extensive documentation on how to use nacl as well as being
completely portable. The file in libnacl/__init__.py can be pulled out and
placed directly in any project to give a single file binding to all of nacl.
+
+This is the Python 3 build of the module.
%endif
+%if 0%{?rhel} == 5
+%package -n python26-%{srcname}
+Summary: Python bindings for libsodium/tweetnacl based on ctypes
+Group: Development/Libraries
+BuildRequires: python26
+BuildRequires: libsodium
+BuildRequires: python26-devel
+Requires: python26
+Requires: libsodium
+
+%description -n python26-%{srcname}
+This library is used to gain direct access to the functions exposed by Daniel
+J. Bernstein's nacl library via libsodium or tweetnacl. It has been constructed
+to maintain extensive documentation on how to use nacl as well as being
+completely portable. The file in libnacl/__init__.py can be pulled out and
+placed directly in any project to give a single file binding to all of nacl.
+
+This is the Python 2 build of the module.
+%endif
%prep
%setup -q -n %{srcname}-%{version}
@@ -74,7 +93,7 @@
%endif
%build
-%{__python} setup.py build
+%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
@@ -84,7 +103,7 @@
%install
rm -rf %{buildroot}
-python setup.py install --skip-build --root %{buildroot}
+%{__python2} setup.py install --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
@@ -95,9 +114,15 @@
%clean
rm -rf %{buildroot}
+%if 0%{?rhel} == 5
+%files -n python26-%{srcname}
+%defattr(-,root,root,-)
+%{python2_sitelib}/*
+%else
%files
%defattr(-,root,root,-)
%{python2_sitelib}/*
+%endif
%if 0%{?with_python3}
%files -n python3-%{srcname}
@@ -106,6 +131,15 @@
%endif
%changelog
+* Fri Aug 8 2014 Erik Johnson