@@ -236,8 +236,8 @@ static int test_valid_roundtrip(CK_SESSION_HANDLE session,
236236 CK_ULONG encSz , decSz ;
237237 int result = 0 ;
238238
239- memset (plain , 9 , sizeof (plain ));
240- memset (iv , 9 , sizeof (iv ));
239+ XMEMSET (plain , 9 , sizeof (plain ));
240+ XMEMSET (iv , 9 , sizeof (iv ));
241241
242242 mech .mechanism = CKM_AES_CBC_PAD ;
243243 mech .ulParameterLen = sizeof (iv );
@@ -270,7 +270,7 @@ static int test_valid_roundtrip(CK_SESSION_HANDLE session,
270270 ret = funcList -> C_Decrypt (session , cipherOut , encSz , dec , & decSz );
271271 CHECK_CKR (ret , "Test1: C_Decrypt" , CKR_OK );
272272
273- if (decSz != sizeof (plain ) || memcmp (dec , plain , sizeof (plain )) != 0 ) {
273+ if (decSz != sizeof (plain ) || XMEMCMP (dec , plain , sizeof (plain )) != 0 ) {
274274 fprintf (stderr , "FAIL: Test1: decrypted plaintext mismatch\n" );
275275 test_failed ++ ;
276276 result = -1 ;
@@ -299,8 +299,8 @@ static int test_tampered_last_byte_oneshot(CK_SESSION_HANDLE session,
299299 CK_ULONG decSz ;
300300 int result = 0 ;
301301
302- memset (iv , 9 , sizeof (iv ));
303- memcpy (tampered , cipher , cipherLen );
302+ XMEMSET (iv , 9 , sizeof (iv ));
303+ XMEMCPY (tampered , cipher , cipherLen );
304304 tampered [cipherLen - 1 ] ^= 0x01 ; /* flip one bit in last byte */
305305
306306 mech .mechanism = CKM_AES_CBC_PAD ;
@@ -334,8 +334,8 @@ static int test_tampered_last_byte_multipart(CK_SESSION_HANDLE session,
334334 CK_ULONG decSz , lastPartLen ;
335335 int result = 0 ;
336336
337- memset (iv , 9 , sizeof (iv ));
338- memcpy (tampered , cipher , cipherLen );
337+ XMEMSET (iv , 9 , sizeof (iv ));
338+ XMEMCPY (tampered , cipher , cipherLen );
339339 tampered [cipherLen - 1 ] ^= 0x01 ;
340340
341341 mech .mechanism = CKM_AES_CBC_PAD ;
@@ -375,8 +375,8 @@ static int test_tampered_first_block_oneshot(CK_SESSION_HANDLE session,
375375 CK_ULONG decSz ;
376376 int result = 0 ;
377377
378- memset (iv , 9 , sizeof (iv ));
379- memcpy (tampered , cipher , cipherLen );
378+ XMEMSET (iv , 9 , sizeof (iv ));
379+ XMEMCPY (tampered , cipher , cipherLen );
380380 tampered [15 ] ^= 0x01 ; /* flip one bit in last byte of first block */
381381
382382 mech .mechanism = CKM_AES_CBC_PAD ;
0 commit comments