From 7960b5c67f0577e305d9fd86564b19957872d0e3 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 21 Nov 2012 18:33:49 +0200 Subject: [PATCH] trusts: replace use of python-crypto by m2crypto python-crypto package is not available everywhere, use m2crypto instead. Originally we thought to extend python-krbV to provide krb5_c_encrypt() wrapper but m2crypto is readily available. https://fedorahosted.org/freeipa/ticket/3271 --- freeipa.spec.in | 7 +++++-- ipaserver/dcerpc.py | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/freeipa.spec.in b/freeipa.spec.in index 50e743d80..43f4a3af2 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -67,7 +67,7 @@ BuildRequires: sssd >= 1.8.0 BuildRequires: python-lxml BuildRequires: python-pyasn1 >= 0.0.9a BuildRequires: python-dns -BuildRequires: python-crypto +BuildRequires: m2crypto BuildRequires: check BuildRequires: libsss_idmap-devel @@ -181,7 +181,7 @@ daemons included in freeipa-server Summary: Virtual package to install packages required for Active Directory trusts Group: System Environment/Base Requires: %{name}-server = %version-%release -Requires: python-crypto +Requires: m2crypto %if 0%{?fedora} >= 18 Requires: samba-python Requires: samba @@ -733,6 +733,9 @@ fi %ghost %attr(0644,root,apache) %config(noreplace) %{_sysconfdir}/ipa/ca.crt %changelog +* Wed Nov 21 2012 Alexander Bokovoy - 3.0.99-6 +- Replace python-crypto by m2crypto dependency + * Fri Nov 16 2012 Rob Crittenden - 3.0.99-5 - Bump minimum version of slapi-nis to 0.44 diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py index 4eddbcdc3..68b5ad528 100644 --- a/ipaserver/dcerpc.py +++ b/ipaserver/dcerpc.py @@ -41,7 +41,7 @@ from samba.ndr import ndr_pack from samba import net import samba import random -from Crypto.Cipher import ARC4 +from M2Crypto import RC4 try: from ldap.controls import RequestControl as LDAPControl #pylint: disable=F0401 except ImportError: @@ -526,8 +526,8 @@ class TrustDomainInstance(object): def generate_auth(self, trustdom_secret): def arcfour_encrypt(key, data): - c = ARC4.new(key) - return c.encrypt(data) + c = RC4.RC4(key) + return c.update(data) def string_to_array(what): blob = [0] * len(what)