Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Rewrites provided by rleftwich@lightkeeper.com
Browse files Browse the repository at this point in the history
This commit (mostly) replaces the code removed by the reversions of:

  2244eca
  75f44f9

Those commits were provided by individuals who hadn't signed a Google
Contributor License Agreement, and couldn't be tracked down to sign one.
By reverting them and asking Robert to reimplement them from scratch,
we removed them from the codebase without losing the relevant functionality
(though we did lose a unit test).
  • Loading branch information
divegeek committed Feb 26, 2015
1 parent e7bd042 commit 993edf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cpp/src/tools/swtoolkit/site_scons/site_init.py
Expand Up @@ -65,6 +65,8 @@ def _HostPlatform():
'openbsd4': 'BSD',
'freebsd6': 'BSD',
'freebsd7': 'BSD',
'freebsd8': 'BSD',
'freebsd9': 'BSD',
'netbsd4': 'BSD',
'netbsd5': 'BSD',
}
Expand Down
8 changes: 4 additions & 4 deletions python/src/keyczar/keyczar.py
Expand Up @@ -776,11 +776,11 @@ def session_material(self):
"""
return self._encrypted_session_material

def Encrypt(self, plaintext):
def Encrypt(self, plaintext, encoder=util.Base64WSEncode):
"""
Encrypts the given plaintext with the session key and returns the base 64-encoded result.
"""
return self._session.crypter.Encrypt(plaintext)
return self._session.crypter.Encrypt(plaintext, encoder)


class SessionDecrypter(object):
Expand All @@ -792,12 +792,12 @@ class SessionDecrypter(object):
def __init__(self, crypter, session_material):
self._session = _Session.LoadPackedKey(crypter.Decrypt(session_material))

def Decrypt(self, ciphertext):
def Decrypt(self, ciphertext, decoder=util.Base64WSDecode):
"""
Decrypts the given base 64-encoded ciphertext with the session key and returns the
decrypted plaintext.
"""
return self._session.crypter.Decrypt(ciphertext)
return self._session.crypter.Decrypt(ciphertext, decoder)


class SignedSessionEncrypter(object):
Expand Down

0 comments on commit 993edf8

Please sign in to comment.