From 1d164bd42600b919931f7f14686a911d2842035d Mon Sep 17 00:00:00 2001 From: Daniel Stan Date: Thu, 10 May 2012 13:56:02 +0200 Subject: [PATCH] [radius_auth] utilisation de hashlib au lieu de md5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: ad72777a01e9f3ce6ea9017b1987a2dc le module md5 est déprécié darcs-hash:20120510115602-ce021-e2f913ecb31fe5dcd088c7fea5154b8c4e4354bf.gz --- radius_auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radius_auth.py b/radius_auth.py index 7ac5a720..fcab0fb8 100644 --- a/radius_auth.py +++ b/radius_auth.py @@ -1,7 +1,7 @@ #! /usr/bin/env python # -*- coding: iso-8859-15 -*- -import os, md5, sys, binascii +import os, hashlib, sys, binascii from syslog import syslog, openlog sys.path.append('/usr/scripts/gestion') @@ -19,7 +19,7 @@ def chap_ok(password, challenge, clear_pass) : try : challenge = binascii.a2b_hex(challenge.replace('0x','')) password = binascii.a2b_hex(password.replace('0x','')) - if md5.new(password[0] + clear_pass + challenge).digest() == password[1:] : + if hashlib.md5(password[0] + clear_pass + challenge).digest() == password[1:] : return True except : return False