Skip to content

Commit

Permalink
Work in a FIPS enabled environment. closes gh-25
Browse files Browse the repository at this point in the history
  • Loading branch information
frapell committed Jul 21, 2021
1 parent 44c41cc commit fab00e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/25.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Work in a FIPS enabled environment [frapell] (#25)
11 changes: 9 additions & 2 deletions plone/memoize/ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""A cache decorator that uses RAMCache by default.
"""

from functools import partial
from plone.memoize import volatile
from plone.memoize.interfaces import ICacheChooser
from zope import component
Expand All @@ -18,9 +19,15 @@
import cPickle as pickle # Python 2

try:
from hashlib import md5
from hashlib import md5_original
except ImportError:
from md5 import new as md5
from md5 import new as md5_original

try:
hashed = md5_original(b'test')
md5 = md5_original
except ValueError:
md5 = partial(md5_original, usedforsecurity=False)


global_cache = ram.RAMCache()
Expand Down

0 comments on commit fab00e4

Please sign in to comment.