[Botan-devel] "Access violation" error when creating Pipe object with a PK_Encryptor_Filter

Jack Lloyd lloyd at randombit.net
Fri Jan 25 09:06:02 EST 2008


Hello Reen,

At a glance, you code looks fine. I'm guessing this problem is your
program was not compiled with the /GR flag (if you're using a VC
project the setting should be called something like "Enable
RTTI"). The reason it works with Base64_Encoder but not the
PK_Encryptor_Filter is dynamic_cast (which requires RTTI) is only used
in a few places in Botan, one major one being in the public key code
(though since Pipe also uses dynamic_cast some operations even with a
base64 filter would fail later on).

Regards,
  Jack

On Fri, Jan 25, 2008 at 05:25:15PM +0800, reen du wrote:
> Hi Gurus,
> 
> I am running into an "Access violation" error when trying to initiate a Pipe
> object with a PK_Encryptor_Filter. I am on Windows 2000 with MS VS.Net 2003
> compiler. The compiled program just throws "Exception: Access violation - no
> RTTI data" after following statement:
> 
> Pipe pipe(new Botan::PK_Encryptor_Filter(get_pk_encryptor(*rsakey,
> > "EME1(SHA-1)")));
> 
> 
> I have checked that the "new
> Botan::PK_Encryptor_Filter(get_pk_encryptor(*rsakey, "EME1(SHA-1)"))" did
> returned a valid pointer, and the rsa key is also valid. If I replaced the
> PK_Encryptor_Filter with other types of filters, say, Base64_Encoder, the
> code just worked fine.
> 
> Below attached my complete code. Any pointers are highly appreciated.
> 
> Thanks a lot!
> -Reen



More information about the botan-devel mailing list