diff --git a/0001-Always-use-base64.encodebytes-base64.encodestring-ha.patch b/0001-Always-use-base64.encodebytes-base64.encodestring-ha.patch new file mode 100644 index 0000000..c4cf3f0 --- /dev/null +++ b/0001-Always-use-base64.encodebytes-base64.encodestring-ha.patch @@ -0,0 +1,36 @@ +From 3debe07ef5c1571f9cfb85985ab4889ab286c35b Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Mon, 26 Apr 2021 14:40:50 +0200 +Subject: [PATCH] Always use base64.encodebytes; base64.encodestring has been + dropped + +--- + tests/test_60_sp.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tests/test_60_sp.py b/tests/test_60_sp.py +index 78e88400..b1eaa7c6 100644 +--- a/tests/test_60_sp.py ++++ b/tests/test_60_sp.py +@@ -1,7 +1,8 @@ + #!/usr/bin/env python + # -*- coding: utf-8 -*- + +-import base64 ++from base64 import encodebytes as b64encode ++ + import pytest + from saml2.authn_context import INTERNETPROTOCOLPASSWORD + from saml2.saml import NAMEID_FORMAT_TRANSIENT +@@ -73,7 +74,7 @@ class TestSP(): + "urn:mace:example.com:saml:roland:sp", trans_name_policy, + "foba0001@example.com", authn=AUTHN) + +- resp_str = base64.encodestring(resp_str.encode('utf-8')) ++ resp_str = b64encode(resp_str.encode('utf-8')) + self.sp.outstanding_queries = {"id1": "http://www.example.com/service"} + session_info = self.sp._eval_authn_response( + {}, {"SAMLResponse": [resp_str]}) +-- +2.31.1 + diff --git a/python-pysaml2.changes b/python-pysaml2.changes index 2691423..22f93e6 100644 --- a/python-pysaml2.changes +++ b/python-pysaml2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Apr 26 12:55:01 UTC 2021 - Dirk Müller + +- add 0001-Always-use-base64.encodebytes-base64.encodestring-ha.patch + ------------------------------------------------------------------- Mon Jan 25 15:06:45 UTC 2021 - Dirk Müller diff --git a/python-pysaml2.spec b/python-pysaml2.spec index 2c93b0b..01b5e97 100644 --- a/python-pysaml2.spec +++ b/python-pysaml2.spec @@ -26,6 +26,8 @@ Summary: Python implementation of SAML Version 2 to be used in a WSGI env License: Apache-2.0 URL: https://github.com/IdentityPython/pysaml2 Source: https://github.com/IdentityPython/pysaml2/archive/v%{version}.tar.gz +# PATCH-FIX-UPSTREAM: https://github.com/IdentityPython/pysaml2/pull/797 +Patch1: 0001-Always-use-base64.encodebytes-base64.encodestring-ha.patch BuildRequires: %{python_module Paste} BuildRequires: %{python_module cryptography >= 1.4} BuildRequires: %{python_module dbm} @@ -64,7 +66,7 @@ Requires: python-six Requires: python-xmlschema Requires: python-zope.interface Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives # We need to have arch build to make ifarch condition below working # BuildArch: noarch %python_subpackages @@ -76,8 +78,7 @@ SAML2 service provider or an identity provider. %prep %setup -q -n %{modname}-%{version} -%ifarch %{ix86} -%endif +%autopatch -p1 # delete shebang of files not in executable path find src/ -name '*.py' -print0 | xargs -0 sed -i '1s/#!.*$//'