import userdir_gpg, userdir_ldap, sys, traceback, time, ldap, os, commands
import pwd, tempfile
import hmac
-try:
- import hashlib
-except ImportError:
- import sha as sha1_module
+import sha as sha1_module
from userdir_gpg import *
from userdir_ldap import *
def make_hmac(str):
F = open(PassDir+"/key-hmac","r");
- key = F.readline()
+ key = F.readline().strip()
F.close();
- return hmac.new(key, str, sha1_module).hexdigest
+ return hmac.new(key, str, sha1_module).hexdigest()