Commit ee1e1f0f authored by Alexandre Julliard's avatar Alexandre Julliard

secur32/tests: Don't compare the encrypted results if the session key is different.

parent 8d66ca11
......@@ -1058,20 +1058,14 @@ static void testSignSeal(void)
ok(sec_status == SEC_E_OK, "EncryptMessage returned %s, not SEC_E_OK.\n",
getSecError(sec_status));
/* first 8 bytes must always be the same */
ok(!memcmp(crypt.pBuffers[0].pvBuffer, crypt_trailer_client, 8), "Crypt trailer not as expected.\n");
/* the rest depends on the session key */
if (!memcmp(crypt.pBuffers[0].pvBuffer, crypt_trailer_client, crypt.pBuffers[0].cbBuffer))
{
ok(!memcmp(crypt.pBuffers[0].pvBuffer, crypt_trailer_client,
crypt.pBuffers[0].cbBuffer), "Crypt trailer not as expected.\n");
if (memcmp(crypt.pBuffers[0].pvBuffer, crypt_trailer_client,
crypt.pBuffers[0].cbBuffer))
{
int i;
for (i = 0; i < crypt.pBuffers[0].cbBuffer; i++)
{
if (i % 8 == 0) printf(" ");
printf("0x%02x,", ((unsigned char *)crypt.pBuffers[0].pvBuffer)[i]);
if (i % 8 == 7) printf("\n");
}
printf("\n");
}
ok(!memcmp(crypt.pBuffers[1].pvBuffer, crypt_message_client,
crypt.pBuffers[1].cbBuffer), "Crypt message not as expected.\n");
if (memcmp(crypt.pBuffers[1].pvBuffer, crypt_message_client,
......@@ -1099,6 +1093,8 @@ static void testSignSeal(void)
ok(!memcmp(crypt.pBuffers[1].pvBuffer, message_binary,
crypt.pBuffers[1].cbBuffer),
"Failed to decrypt message correctly.\n");
}
else trace( "A different session key is being used\n" );
trace("Testing with more than one buffer.\n");
......@@ -1139,20 +1135,10 @@ static void testSignSeal(void)
ok(sec_status == SEC_E_OK, "EncryptMessage returned %s, not SEC_E_OK.\n",
getSecError(sec_status));
ok(!memcmp(crypt.pBuffers[3].pvBuffer, crypt_trailer_client2,
crypt.pBuffers[3].cbBuffer), "Crypt trailer not as expected.\n");
ok(!memcmp(crypt.pBuffers[3].pvBuffer, crypt_trailer_client2, 8), "Crypt trailer not as expected.\n");
if (memcmp(crypt.pBuffers[3].pvBuffer, crypt_trailer_client2,
crypt.pBuffers[3].cbBuffer))
{
int i;
for (i = 0; i < crypt.pBuffers[3].cbBuffer; i++)
{
if (i % 8 == 0) printf(" ");
printf("0x%02x,", ((unsigned char *)crypt.pBuffers[3].pvBuffer)[i]);
if (i % 8 == 7) printf("\n");
}
printf("\n");
}
crypt.pBuffers[3].cbBuffer)) goto end;
ok(!memcmp(crypt.pBuffers[1].pvBuffer, crypt_message_client2,
crypt.pBuffers[1].cbBuffer), "Crypt message not as expected.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment