Search Linux Wireless

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

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

 



On Wed, Jul 22, 2009 at 10:52 AM, Luis R.
Rodriguez<lrodriguez@xxxxxxxxxxx> wrote:
> 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>
> ---
>  db2bin.py      |    6 +++---
>  regulatory.bin |  Bin 3084 -> 3084 bytes
>  2 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())
>
> diff --git a/regulatory.bin b/regulatory.bin

Bleh, forgot to clean this, will resend.

  Luis
--
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