Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
9a7eb577
Commit
9a7eb577
authored
Nov 11, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some changes to FIPS compat since SLES implements it differently
parent
d4d23b1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
lib/ansible/module_utils/basic.py
+7
-1
lib/ansible/utils/__init__.py
+9
-1
No files found.
lib/ansible/module_utils/basic.py
View file @
9a7eb577
...
...
@@ -95,7 +95,11 @@ except ImportError:
try
:
from
hashlib
import
md5
as
_md5
except
ImportError
:
from
md5
import
md5
as
_md5
try
:
from
md5
import
md5
as
_md5
except
ImportError
:
# MD5 unavailable. Possibly FIPS mode
_md5
=
None
try
:
from
hashlib
import
sha256
as
_sha256
...
...
@@ -1248,6 +1252,8 @@ class AnsibleModule(object):
Most uses of this function can use the module.sha1 function instead.
'''
if
not
_md5
:
raise
ValueError
(
'MD5 not available. Possibly running in FIPS mode'
)
return
self
.
digest_from_file
(
filename
,
_md5
())
def
sha1
(
self
,
filename
):
...
...
lib/ansible/utils/__init__.py
View file @
9a7eb577
...
...
@@ -79,7 +79,11 @@ except ImportError:
try
:
from
hashlib
import
md5
as
_md5
except
ImportError
:
from
md5
import
md5
as
_md5
try
:
from
md5
import
md5
as
_md5
except
ImportError
:
# Assume we're running in FIPS mode here
_md5
=
None
PASSLIB_AVAILABLE
=
False
try
:
...
...
@@ -870,9 +874,13 @@ checksum_s = secure_hash_s
#
# MD5 will not work on systems which are FIPS-140-2 compliant.
def
md5s
(
data
):
if
not
_md5
:
raise
ValueError
(
'MD5 not available. Possibly running in FIPS mode'
)
return
secure_hash_s
(
data
,
_md5
)
def
md5
(
filename
):
if
not
_md5
:
raise
ValueError
(
'MD5 not available. Possibly running in FIPS mode'
)
return
secure_hash
(
filename
,
_md5
)
def
default
(
value
,
function
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment