[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: SFL AccessEncodedBlob problem



Instead of AccessEncodedBlob call AccessEncapContent on the MsgToVerify
object.

-----Original Message-----
From: owner-imc-sfl@xxxxxxxxxxxx [mailto:owner-imc-sfl@xxxxxxxxxxxx]On
Behalf Of huseyinozkan@xxxxxxxxxxxxxxxxxxxx
Sent: 24 September 2003 10:02
To: imc-sfl@xxxxxxx
Subject: SFL AccessEncodedBlob problem
Importance: High



In the test code below first we sign a message. The signed message is
present now in the MsgToSign variable. Then we want to verify the message.
The data is verified successfully . We can see the wording "DATA VERIFIED
SUCCESSFULLY!" on screen. However in function
MsgToVerify.AccessEncodedBlob()->ConvertMemoryToFile("result.dat") we get
an application error like "the instruction at "0xxxxxxx" referenced memory
at "0xxxxxxx". The memory can not be read" . With this function we just
want to extract the data from the verified message and write it to a file.
What might be the error? Did we forget something?



*******************************************************

CSM_Buffer *pFirstSignedDataBuffer=NULL;

.....
.....
.....
(Message Signed!!!Now we would like to verify the message.)

if (MsgToSign.AccessEncodedBlob())
{
          pFirstSignedDataBuffer = new CSM_Buffer(
          MsgToSign.AccessEncodedBlob()->Access(),
EncodedBlob()->Length());
MsgToSign.AccessEncodedBlob()->ConvertMemoryToFile(TMPFirstSignedDataBinary)
;
}

CSM_MsgToVerify MsgToVerify;

pAppLogin->UseAll();

if ( pFirstSignedDataBuffer &&
     MsgToSign.AccessEncapContent()->m_contentType == id_data)
{
	 if (MsgToVerify.PreProc(pAppLogin, pFirstSignedDataBuffer, NULL)==
SM_NO_ERROR)
	{
		if (MsgToVerify.Verify(pAppLogin) == SM_NO_ERROR)
		{
			printf("DATA VERIFIED SUCCESSFULLY!");
			MsgToVerify.AccessEncodedBlob()->ConvertMemoryToFile("result.dat");
		}
	}

}

delete pFirstSignedDataBuffer;

*******************************************************