Skip to content

Commit

Permalink
Decrease urandom entropy drain
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Ceratto committed Apr 20, 2012
1 parent 066299c commit 6539442
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beaker/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def _encrypt_data(self, session_data=None):
"""Serialize, encipher, and base64 the session dict"""
session_data = session_data or self.copy()
if self.encrypt_key:
nonce = b64encode(os.urandom(40))[:8]
nonce = b64encode(os.urandom(6))[:8]
encrypt_key = crypto.generateCryptoKeys(self.encrypt_key,
self.validate_key + nonce, 1)
data = util.pickle.dumps(session_data, 2)
Expand Down

0 comments on commit 6539442

Please sign in to comment.