FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow savefig to save SVGs on FIPS enabled systems #18192 by daytonb · Pull Request #18193 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 10 additions & 0 deletions doc/api/next_api_changes/behavior/18193-BKB.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ID attribute of XML tags in SVG files now based on SHA256 rather than MD5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Matplotlib generates unique ID attributes for various tags in SVG files.
Matplotlib previously generated these unique IDs using the first 10
characters of an MD5 hash. The MD5 hashing algorithm is not available in
Python on systems with Federal Information Processing Standards (FIPS)
enabled. Matplotlib now uses the first 10 characters of an SHA256 hash
instead. SVG files that would otherwise match those saved with earlier
versions of matplotlib, will have different ID attributes.
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_svg.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def _make_id(self, type, content):
salt = mpl.rcParams['svg.hashsalt']
if salt is None:
salt = str(uuid.uuid4())
m = hashlib.md5()
m = hashlib.sha256()
m.update(salt.encode('utf8'))
m.update(str(content).encode('utf8'))
return '%s%s' % (type, m.hexdigest()[:10])
Expand Down

Back | FazBrowse Home | New Git URL