mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-27 12:44:19 +01:00
Fix a test failure by limiting random.randrange to [-32768, 32767]
This commit is contained in:
parent
d39846ae68
commit
699bb15f23
@ -1,5 +1,6 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2002-2005, Jeremiah Fincher
|
# Copyright (c) 2002-2005, Jeremiah Fincher
|
||||||
|
# Copyright (c) 2008, James Vega
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -112,7 +113,7 @@ class Unix(callbacks.Plugin):
|
|||||||
def makeSalt():
|
def makeSalt():
|
||||||
s = '\x00'
|
s = '\x00'
|
||||||
while self._cryptre.sub('', s) != '':
|
while self._cryptre.sub('', s) != '':
|
||||||
s = struct.pack('<h', random.randrange(2**16))
|
s = struct.pack('<h', random.randrange(-(2**15), 2**15))
|
||||||
return s
|
return s
|
||||||
if not salt:
|
if not salt:
|
||||||
salt = makeSalt()
|
salt = makeSalt()
|
||||||
|
Loading…
Reference in New Issue
Block a user