Fix pkcs11-tool encryption error Fix #1694

Make sure data being encrypted is less then the modulus.

 On branch pkcs11-tool-encryption
 Changes to be committed:
	modified:   ../tools/pkcs11-tool.c
This commit is contained in:
Doug Engert 2019-05-30 08:55:03 -05:00 committed by Frank Morgner
parent 278960bf88
commit a2dd500624
1 changed files with 1 additions and 0 deletions

View File

@ -5545,6 +5545,7 @@ static int encrypt_decrypt(CK_SESSION_HANDLE session,
printf(" %s: ", p11_mechanism_to_name(mech_type));
pseudo_randomize(orig_data, sizeof(orig_data));
orig_data[0] = 0; /* Make sure it is less then modulus */
pkey = get_public_key(session, privKeyObject);
if (pkey == NULL)