Fatal error: out of core in secure memory - during decrypt function call

Moritz Schulte moritz@duesseldorf.ccc.de
Fri, 09 May 2003 18:31:31 +0200


"Warren, Tony" <tonyw@prairiesys.com> writes:

Hi,

One comment on your code:

> char encryptMe[] = "";
[...]
> scanf( "%s", encryptMe );

That is not safe.

And now, to the actuall problem: it seems as if your code would
trigger a bug with in libgcrypt.  As far as I can tell right now [i
have to investigate this more deeply], some MPI related arithmetic is
wrong.  The consequence is that gcry_xmalloc_secure is asked to
allocate zero bytes; of course the return value is NULL.  This is then
interpretated as an out-of-memory situation.

It seems that somehow `m1' and `m2' in rsa.c:secret() end up being the
same.  The difference of these numbers is then used as one factor
passed to mpi_mulm.  I am still trying to find out where the problem
is.

		moritz
-- 
moritz@duesseldorf.ccc.de - http://duesseldorf.ccc.de/~moritz/
GPG fingerprint = 3A14 3923 15BE FD57 FC06  B501 0841 2D7B 6F98 4199