Search Linux Wireless

[PATCH v2] wireless-regb: make db2bin.py use new hashlib for sha1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Python now complains about sha module as its deprecated:

./db2bin.py regulatory.bin db.txt ~/.wireless-regdb-mcgrof.key.priv.pem
./db2bin.py:5: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---

Don't pass along my regulatory.bin changes..

 db2bin.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/db2bin.py b/db2bin.py
index e783b3a..23d3ee2 100755
--- a/db2bin.py
+++ b/db2bin.py
@@ -2,7 +2,7 @@
 
 from cStringIO import StringIO
 import struct
-import sha
+import hashlib
 from dbparse import DBParser
 import sys
 
@@ -127,13 +127,13 @@ if len(sys.argv) > 3:
 
     # determine signature length
     key = RSA.load_key(sys.argv[3])
-    hash = sha.new()
+    hash = hashlib.sha1()
     hash.update(output.getvalue())
     sig = key.sign(hash.digest())
     # write it to file
     siglen.set(len(sig))
     # sign again
-    hash = sha.new()
+    hash = hashlib.sha1()
     hash.update(output.getvalue())
     sig = key.sign(hash.digest())
 
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux