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
6a85f3eb
Commit
6a85f3eb
authored
10 years ago
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments/docstrings not to use md5 unless forced to by forces outside our control.
parent
3ccb0b82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
+15
-1
lib/ansible/module_utils/basic.py
+10
-1
lib/ansible/utils/__init__.py
+5
-0
No files found.
lib/ansible/module_utils/basic.py
View file @
6a85f3eb
...
...
@@ -1238,7 +1238,16 @@ class AnsibleModule(object):
return
digest
.
hexdigest
()
def
md5
(
self
,
filename
):
''' Return MD5 hex digest of local file using digest_from_file(). '''
''' Return MD5 hex digest of local file using digest_from_file().
Do not use this function unless you have no other choice for:
1) Optional backwards compatibility
2) Compatibility with a third party protocol
This function will not work on systems complying with FIPS-140-2.
Most uses of this function can use the module.sha1 function instead.
'''
return
self
.
digest_from_file
(
filename
,
_md5
())
def
sha1
(
self
,
filename
):
...
...
This diff is collapsed.
Click to expand it.
lib/ansible/utils/__init__.py
View file @
6a85f3eb
...
...
@@ -864,6 +864,11 @@ checksum_s = secure_hash_s
# Backwards compat. Some modules include md5s in their return values
# Continue to support that for now. As of ansible-1.8, all of those modules
# should also return "checksum" (sha1 for now)
# Do not use m5 unless it is needed for:
# 1) Optional backwards compatibility
# 2) Compliance with a third party protocol
#
# MD5 will not work on systems which are FIPS-140-2 compliant.
def
md5s
(
data
):
return
secure_hash_s
(
data
,
_md5
)
...
...
This diff is collapsed.
Click to expand it.
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