RE: SFL AccessEncodedBlob problem

William Adams <[email protected]> Wed, 24 Sep 2003 10:19:07 +0100
Newsgroups gmane.ietf.sfl
Message-ID <[email protected]>
Instead of AccessEncodedBlob call AccessEncapContent on the MsgToVerify
object.

-----Original Message-----
From: [email protected] [mailto:[email protected]]On
Behalf Of [email protected]
Sent: 24 September 2003 10:02
To: [email protected]
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;

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