Make tests' work with python3

This was not compatible with python3 due to encoding issues of the input
and the out. Ensure we pass the input plaintext as bytes to the
encryption routine and use the base64 module to convert the output to

Change-Id: Ie8b3a8e5c93544e448016829c1071240b68e8957
Clark Boylan 2017-10-19 11:03:10 -07:00 committed by Clark Boylan
parent 9f0f4408d5
commit 0996ab2857
1 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import base64
import sys
import os
@ -27,8 +28,10 @@ def main():
private_key, public_key = \
ciphertext = encryption.encrypt_pkcs1_oaep(sys.argv[1], public_key)
plaintext = sys.argv[1].encode('utf-8')
ciphertext = encryption.encrypt_pkcs1_oaep(plaintext, public_key)
if __name__ == '__main__':