Hello community,

here is the log from the commit of package python-nbxmpp for openSUSE:Factory 
checked in at 2017-12-14 11:02:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-nbxmpp (Old)
 and      /work/SRC/openSUSE:Factory/.python-nbxmpp.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-nbxmpp"

Thu Dec 14 11:02:10 2017 rev:16 rq:556618 version:0.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-nbxmpp/python-nbxmpp.changes      
2017-11-09 14:07:43.781401975 +0100
+++ /work/SRC/openSUSE:Factory/.python-nbxmpp.new/python-nbxmpp.changes 
2017-12-14 11:02:13.589876162 +0100
@@ -1,0 +2,8 @@
+Wed Dec 13 08:14:32 UTC 2017 - [email protected]
+
+- Update to version 0.6.1
+  * Add new getStanzaIDAttrs method
+  * Fix BOSH connexion
+  * stop using PyOpenSSL for random generator
+
+-------------------------------------------------------------------

Old:
----
  nbxmpp-0.6.0.tar.gz

New:
----
  nbxmpp-0.6.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-nbxmpp.spec ++++++
--- /var/tmp/diff_new_pack.lVP7Hg/_old  2017-12-14 11:02:14.165848357 +0100
+++ /var/tmp/diff_new_pack.lVP7Hg/_new  2017-12-14 11:02:14.169848164 +0100
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define _name   nbxmpp
 Name:           python-nbxmpp
-Version:        0.6.0
+Version:        0.6.1
 Release:        0
 Summary:        XMPP library by Gajim team
 License:        GPL-3.0+

++++++ nbxmpp-0.6.0.tar.gz -> nbxmpp-0.6.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/ChangeLog new/nbxmpp-0.6.1/ChangeLog
--- old/nbxmpp-0.6.0/ChangeLog  2017-09-25 22:18:45.000000000 +0200
+++ new/nbxmpp-0.6.1/ChangeLog  2017-11-29 21:25:08.000000000 +0100
@@ -1,3 +1,9 @@
+python-nbxmpp 0.6.1 (29 November 2017)
+
+ * Add new getStanzaIDAttrs method
+ * Fix BOSH connexion
+ * stop using PyOpenSSL for random generator
+
 python-nbxmpp 0.6.0 (25 September 2017)
 
  * Add new getOriginID/SetOriginID method for Messages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/PKG-INFO new/nbxmpp-0.6.1/PKG-INFO
--- old/nbxmpp-0.6.0/PKG-INFO   2017-09-25 22:20:36.000000000 +0200
+++ new/nbxmpp-0.6.1/PKG-INFO   2017-11-29 21:26:28.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: nbxmpp
-Version: 0.6.0
+Version: 0.6.1
 Summary: Non blocking Jabber/XMPP module
 Home-page: http://dev.gajim.org/gajim/python-nbxmpp
 Author: Yann Leboulanger
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/nbxmpp/__init__.py 
new/nbxmpp-0.6.1/nbxmpp/__init__.py
--- old/nbxmpp-0.6.0/nbxmpp/__init__.py 2017-09-25 22:18:45.000000000 +0200
+++ new/nbxmpp-0.6.1/nbxmpp/__init__.py 2017-11-29 21:25:08.000000000 +0100
@@ -17,4 +17,4 @@
 from .plugin import PlugIn
 from .smacks import Smacks
 
-__version__ = "0.6.0"
+__version__ = "0.6.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/nbxmpp/auth_nb.py 
new/nbxmpp-0.6.1/nbxmpp/auth_nb.py
--- old/nbxmpp-0.6.0/nbxmpp/auth_nb.py  2017-06-04 14:17:22.000000000 +0200
+++ new/nbxmpp-0.6.1/nbxmpp/auth_nb.py  2017-11-29 21:25:08.000000000 +0100
@@ -29,6 +29,8 @@
 from .plugin import PlugIn
 import sys
 import re
+import os
+import binascii
 import base64
 from . import dispatcher_nb
 import hmac
@@ -37,8 +39,6 @@
 import logging
 log = logging.getLogger('nbxmpp.auth_nb')
 
-from . import rndg
-
 def HH(some): return hashlib.md5(some).hexdigest()
 def H(some): return hashlib.md5(some).digest()
 def C(some): return b':'.join(some)
@@ -463,7 +463,7 @@
         (isinstance(chal['qop'], list) and 'auth' in chal['qop'])):
             self.resp = {'username': self.username,
                 'nonce': chal['nonce'],
-                'cnonce': '%x' % rndg.getrandbits(196),
+                'cnonce': '%x' % int(binascii.hexlify(os.urandom(24)), 16),
                 'nc': ('00000001'),  # ToDo: Is this a tupel or only a string?
                 'qop': 'auth',
                 'digest-uri': 'xmpp/' + self._owner.Server,
@@ -498,7 +498,7 @@
     def set_password(self, password):
         self.password = '' if password is None else password
         if self.mechanism in ('SCRAM-SHA-1', 'SCRAM-SHA-1-PLUS'):
-            self.client_nonce = '%x' % rndg.getrandbits(196)
+            self.client_nonce = '%x' % int(binascii.hexlify(os.urandom(24)), 
16)
             self.scram_soup = 'n=' + self.username + ',r=' + self.client_nonce
             if self.mechanism == 'SCRAM-SHA-1':
                 if self.channel_binding is None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/nbxmpp/bosh.py 
new/nbxmpp-0.6.1/nbxmpp/bosh.py
--- old/nbxmpp-0.6.0/nbxmpp/bosh.py     2017-01-01 23:13:23.000000000 +0100
+++ new/nbxmpp-0.6.1/nbxmpp/bosh.py     2017-11-29 21:25:08.000000000 +0100
@@ -17,7 +17,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with Gajim.  If not, see <http://www.gnu.org/licenses/>.
 
-
+import os
+import binascii
 import locale
 from hashlib import sha1
 from .transports_nb import NonBlockingTransport, NonBlockingHTTPBOSH,\
@@ -29,8 +30,6 @@
 import logging
 log = logging.getLogger('nbxmpp.bosh')
 
-from . import rndg
-
 KEY_COUNT = 10
 
 # Fake file descriptor - it's used for setting read_timeout in idlequeue for
@@ -486,11 +485,9 @@
 
 
 def get_rand_number():
-    # with 50-bit random initial rid, session would have to go up
-    # to 7881299347898368 messages to raise rid over 2**53
     # (see http://www.xmpp.org/extensions/xep-0124.html#rids)
     # it's also used for sequence key initialization
-    return rndg.getrandbits(50)
+    return int(binascii.hexlify(os.urandom(6)), 16)
 
 
 class AckChecker(object):
@@ -547,10 +544,10 @@
         self.first_call = True
 
     def reset(self):
-        seed = str(get_rand_number())
+        seed = str(get_rand_number()).encode('utf-8')
         self.keys = [sha1(seed).hexdigest()]
         for i in range(self.count-1):
-            curr_seed = self.keys[i]
+            curr_seed = self.keys[i].encode('utf-8')
             self.keys.append(sha1(curr_seed).hexdigest())
 
     def get(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/nbxmpp/protocol.py 
new/nbxmpp-0.6.1/nbxmpp/protocol.py
--- old/nbxmpp-0.6.0/nbxmpp/protocol.py 2017-08-05 21:17:49.000000000 +0200
+++ new/nbxmpp-0.6.1/nbxmpp/protocol.py 2017-11-29 21:25:08.000000000 +0100
@@ -1043,6 +1043,16 @@
         """
         return self.getTagAttr('origin-id', namespace=NS_SID, attr='id')
 
+    def getStanzaIDAttrs(self):
+        """
+        Return the stanza-id attributes of the message
+        """
+        try:
+            attrs = self.getTag('stanza-id', namespace=NS_SID).getAttrs()
+        except Exception:
+            return None, None
+        return attrs['id'], attrs['by']
+
     def setBody(self, val):
         """
         Set the text of the message"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/nbxmpp/rndg.py 
new/nbxmpp-0.6.1/nbxmpp/rndg.py
--- old/nbxmpp-0.6.0/nbxmpp/rndg.py     2017-01-01 23:13:23.000000000 +0100
+++ new/nbxmpp-0.6.1/nbxmpp/rndg.py     1970-01-01 01:00:00.000000000 +0100
@@ -1,49 +0,0 @@
-## rndg.py
-##
-##   cryptographically secure pseudo-random number generator.
-##   When possible use OpenSSL PRNG combined with os.random,
-##   if OpenSSL PRNG is not available, use only os.random.
-##
-## Copyright (C) 2013 Fedor Brunner <[email protected]>
-##
-## This file is part of Gajim.
-##
-## Gajim is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published
-## by the Free Software Foundation; version 3 only.
-##
-## Gajim is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Gajim.  If not, see <http://www.gnu.org/licenses/>.
-
-USE_PYOPENSSL = False
-try:
-    import OpenSSL.rand
-    import binascii, os
-    USE_PYOPENSSL = True
-except ImportError:
-    import random
-
-if not USE_PYOPENSSL:
-    getrandbits = random.SystemRandom().getrandbits
-else:
-    def getrandbits(k):
-        """getrandbits(k) -> x.  Generates a long int with k random bits."""
-        if k <= 0:
-            raise ValueError('number of bits must be greater than zero')
-        if k != int(k):
-            raise TypeError('number of bits should be an integer')
-
-        bytes = (k + 7) // 8                    # bits / 8 and rounded up
-
-        # Add system entropy to OpenSSL PRNG
-        OpenSSL.rand.add(os.urandom(bytes), bytes)
-        # Extract random bytes from OpenSSL PRNG
-        random_str = OpenSSL.rand.bytes(bytes)
-
-        x = int(binascii.hexlify(random_str), 16)
-        return x >> (bytes * 8 - k)             # trim excess bits
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/nbxmpp/transports_nb.py 
new/nbxmpp-0.6.1/nbxmpp/transports_nb.py
--- old/nbxmpp-0.6.0/nbxmpp/transports_nb.py    2017-06-04 14:17:22.000000000 
+0200
+++ new/nbxmpp-0.6.1/nbxmpp/transports_nb.py    2017-11-29 21:25:08.000000000 
+0100
@@ -784,7 +784,7 @@
                 'Host: %s:%s' % (self.http_host, self.http_port),
                 'User-Agent: Gajim',
                 'Content-Type: text/xml; charset=utf-8',
-                'Content-Length: %s' % len(str(httpbody))]
+                'Content-Length: %s' % len(httpbody)]
         if self.add_proxy_headers:
             headers.append('Proxy-Connection: keep-alive')
             headers.append('Pragma: no-cache')
@@ -796,7 +796,7 @@
             headers.append('Connection: Keep-Alive')
         headers.append('\r\n')
         headers = '\r\n'.join(headers)
-        return '%s%s' % (headers, httpbody)
+        return b'%s%s' % (headers.encode('utf-8'), httpbody)
 
     def parse_http_message(self, message):
         """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nbxmpp-0.6.0/setup.py new/nbxmpp-0.6.1/setup.py
--- old/nbxmpp-0.6.0/setup.py   2017-09-25 22:18:45.000000000 +0200
+++ new/nbxmpp-0.6.1/setup.py   2017-11-29 21:25:08.000000000 +0100
@@ -3,7 +3,7 @@
 from distutils.core import setup
 
 setup(name='nbxmpp',
-      version='0.6.0',
+      version='0.6.1',
       description='Non blocking Jabber/XMPP module',
       author='Yann Leboulanger',
       author_email='[email protected]',


Reply via email to