FIX use pseudo_randomize() for a proper initialization of orig_data in encrypt_decrypt().

This commit is contained in:
alegon01 2019-03-06 10:26:05 +01:00
parent 7271fe610b
commit b327b76134
1 changed files with 3 additions and 1 deletions

View File

@ -5287,7 +5287,7 @@ static int encrypt_decrypt(CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE privKeyObject)
{
EVP_PKEY *pkey;
unsigned char orig_data[512] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', '\0'};
unsigned char orig_data[512];
unsigned char encrypted[512], data[512];
CK_MECHANISM mech;
CK_ULONG encrypted_len, data_len;
@ -5300,6 +5300,8 @@ static int encrypt_decrypt(CK_SESSION_HANDLE session,
printf(" %s: ", p11_mechanism_to_name(mech_type));
pseudo_randomize(orig_data, sizeof(orig_data));
pkey = get_public_key(session, privKeyObject);
if (pkey == NULL)
return 0;