Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-httpsig_cffi for 
openSUSE:Factory checked in at 2022-07-11 19:09:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-httpsig_cffi (Old)
 and      /work/SRC/openSUSE:Factory/.python-httpsig_cffi.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-httpsig_cffi"

Mon Jul 11 19:09:42 2022 rev:3 rq:988317 version:15.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-httpsig_cffi/python-httpsig_cffi.changes  
2021-06-01 10:41:27.729221693 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-httpsig_cffi.new.1523/python-httpsig_cffi.changes
        2022-07-11 19:11:06.055757046 +0200
@@ -1,0 +2,5 @@
+Mon Jul 11 07:41:08 UTC 2022 - Mark??ta Machov?? <[email protected]>
+
+- Fix build with new-cryptography.patch
+
+-------------------------------------------------------------------

New:
----
  new-cryptography.patch

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

Other differences:
------------------
++++++ python-httpsig_cffi.spec ++++++
--- /var/tmp/diff_new_pack.E1HRCG/_old  2022-07-11 19:11:06.903758277 +0200
+++ /var/tmp/diff_new_pack.E1HRCG/_new  2022-07-11 19:11:06.907758282 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-httpsig_cffi
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@
 Group:          Development/Languages/Python
 URL:            https://github.com/hawkowl/httpsig_cffi
 Source:         
https://files.pythonhosted.org/packages/source/h/httpsig_cffi/httpsig_cffi-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM https://github.com/hawkowl/httpsig_cffi/pull/2 Fix 
cryptography deprecation warnings and future warning in get_fingerprint
+Patch0:         new-cryptography.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -44,6 +46,7 @@
 
 %prep
 %setup -q -n httpsig_cffi-%{version}
+%autopatch -p1
 
 %build
 %python_build

++++++ new-cryptography.patch ++++++
>From 87b4a3f9ead574a173bb42e7191fc8b2efad9637 Mon Sep 17 00:00:00 2001
From: Art Hall III <[email protected]>
Date: Wed, 24 Apr 2019 15:49:54 -0400
Subject: [PATCH] Fix cryptography deprecation warnings (#1)

* Fix deprecation warnings

The signer and verifier methods have been deprecated in
cryptography since version 2.0

* Fix futurewarning in regular expression in get_fingerprint
---
 httpsig_cffi/sign.py   | 5 ++---
 httpsig_cffi/utils.py  | 2 +-
 httpsig_cffi/verify.py | 6 +-----
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/httpsig_cffi/sign.py b/httpsig_cffi/sign.py
index dd5726e..85b14b1 100644
--- a/httpsig_cffi/sign.py
+++ b/httpsig_cffi/sign.py
@@ -57,9 +57,8 @@ def algorithm(self):
 
     def _sign_rsa(self, data):
         if isinstance(data, six.string_types): data = data.encode("ascii")
-        r = self._rsa_private.signer(padding.PKCS1v15(), self._rsahash())
-        r.update(data)
-        return r.finalize()
+        r = self._rsa_private.sign(data, padding.PKCS1v15(), self._rsahash())
+        return r
 
     def _sign_hmac(self, data):
         if isinstance(data, six.string_types): data = data.encode("ascii")
diff --git a/httpsig_cffi/utils.py b/httpsig_cffi/utils.py
index fc5de71..31ef53e 100644
--- a/httpsig_cffi/utils.py
+++ b/httpsig_cffi/utils.py
@@ -152,7 +152,7 @@ def get_fingerprint(key):
     if key.startswith('ssh-rsa'):
         key = key.split(' ')[1]
     else:
-        regex = r'\-{4,5}[\w|| ]+\-{4,5}'
+        regex = r'\-{4,5}[\w\|\| ]+\-{4,5}'
         key = re.split(regex, key)[1]
 
     key = key.replace('\n', '')
diff --git a/httpsig_cffi/verify.py b/httpsig_cffi/verify.py
index 1cd46b2..b6c3faf 100644
--- a/httpsig_cffi/verify.py
+++ b/httpsig_cffi/verify.py
@@ -32,12 +32,8 @@ def _verify(self, data, signature):
 
         if self.sign_algorithm == 'rsa':
 
-            h = self._rsa_public.verifier(b64decode(signature),
-                                          padding.PKCS1v15(),
-                                          self._rsahash())
-            h.update(data)
             try:
-                h.verify()
+                h = self._rsa_public.verify(b64decode(signature), data, 
padding.PKCS1v15(), self._rsahash())
                 return True
             except InvalidSignature:
                 return False

Reply via email to