Skip to content

Commit

Permalink
rsa_test: fix valgrind warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaeckel committed Aug 21, 2014
1 parent c26de4f commit 2b93747
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion testprof/rsa_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,13 @@ for (cnt = 0; cnt < len; ) {
for (rsa_msgsize = 1; rsa_msgsize <= 117; rsa_msgsize++) {
len = sizeof(out);
len2 = rsa_msgsize;
/* make a random key/msg */
yarrow_read(in, rsa_msgsize, &yarrow_prng);
DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_PKCS_1_V1_5, &key));

len2 = rsa_msgsize;
DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_PKCS_1_V1_5, &stat, &key));
if (!(stat == 1 && stat2 == 0)) {
if (stat != 1) {
fprintf(stderr, "rsa_decrypt_key_ex failed, %d, %d", stat, stat2);
return 1;
}
Expand Down

0 comments on commit 2b93747

Please sign in to comment.