On 04/08/2017 10:08, Ondrej Lichtner wrote:
On Wed, Jun 28, 2017 at 08:13:29PM +0200, Jan Tluka wrote:
> This will fix the issue with LNST on FIPS enabled system. FIPS does not allow
> use of md5. Python's hashlib has a parameter that can be used to allow use of
> md5 for non-security purpose. LNST uses md5 for caching test modules and tools
> only.
>
> Tested both with python2.6 and python2.7
>
> Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
> ---
> lnst/Common/Utils.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
> index d6d6c57..1a7c926 100644
> --- a/lnst/Common/Utils.py
> +++ b/lnst/Common/Utils.py
> @@ -98,7 +98,7 @@ def bool_it(val):
> return True if int_it(val) else False
>
> def md5sum(file_path, block_size=2**20):
> - md5 = hashlib.md5()
> + md5 = hashlib.md5(usedforsecurity=False)
> with open(file_path, "rb") as f:
> while True:
> data = f.read(block_size)
> --
> 2.7.5
> _______________________________________________
> LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
> To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
pushed, thanks.
-Ondrej
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
Hi,
This actually broke lnst on my machine.
I don't have the usedforsecurity option in python2.7 or python3
but do in python2.6.
I encountered this because I run lnst with python2.7.
root@mtr-stm-023 ~ # python2.6 -c "import hashlib ;
hashlib.md5(usedforsecurity=False)"
root@mtr-stm-023 ~ # python2.7 -c "import hashlib ;
hashlib.md5(usedforsecurity=False)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: openssl_md5() takes no keyword arguments
root@mtr-stm-023 ~ # 1 python3 -c "import hashlib ;
hashlib.md5(usedforsecurity=False)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: openssl_md5() takes no keyword arguments
root@mtr-stm-023 ~ # 1
any idea? is it the python build?
maybe there should be a check if the flag exists and only
then use it?
Thanks,
Roi