summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2016-01-05 13:19:25 +0100
committerJan Cholasta <jcholast@redhat.com>2016-01-20 11:59:21 +0100
commit126d8993217e356e771ba9781fb08fa9b3400b11 (patch)
tree8eac1fed453cadb993dcff72468edb3b81d995d4 /ipaserver
parent7a742391c1558680900bcb130bbf3fe6790fc573 (diff)
downloadfreeipa-126d8993217e356e771ba9781fb08fa9b3400b11.tar.gz
freeipa-126d8993217e356e771ba9781fb08fa9b3400b11.tar.xz
freeipa-126d8993217e356e771ba9781fb08fa9b3400b11.zip
Use explicit truncating division
In Python 3, the truncating division operator, //, is needed to get C-style "int division". https://fedorahosted.org/freeipa/ticket/5623 Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/ipa_otptoken_import.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipaserver/install/ipa_otptoken_import.py b/ipaserver/install/ipa_otptoken_import.py
index 64670a6ff..e68abc889 100644
--- a/ipaserver/install/ipa_otptoken_import.py
+++ b/ipaserver/install/ipa_otptoken_import.py
@@ -246,9 +246,9 @@ class XMLDecryptor(object):
# Decrypt the data.
slot = nss.get_best_slot(mech)
key = nss.import_sym_key(slot, mech, nss.PK11_OriginUnwrap, nss.CKA_ENCRYPT, self.__key)
- iv = nss.param_from_iv(mech, nss.SecItem(data[0:ivlen/8]))
+ iv = nss.param_from_iv(mech, nss.SecItem(data[0:ivlen//8]))
ctx = nss.create_context_by_sym_key(mech, nss.CKA_DECRYPT, key, iv)
- out = ctx.cipher_op(data[ivlen / 8:])
+ out = ctx.cipher_op(data[ivlen // 8:])
out += ctx.digest_final()
return out