Error encrypting string data

Ralf Schneider ralf@tapfere-schneiderleins.de
Tue, 22 Jul 2003 23:39:25 +0200


=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Dienstag, 22. Juli 2003 23:17 schrieb Moritz Schulte:
> Ralf Schneider <ralf@tapfere-schneiderleins.de> writes:
> > gcry_ac_key_test returns an error.
>
> Please be a bit more precise; what error?

Strange: the error code is 536870916. I did not find this value in=20
gpg-error.h.

I tried to call gpg_strerror() but the linker says:
g++  -o testit obj/main.o obj/mac.o obj/qmdcodec.o   =20
=2D -Wl,-rpath,/usr/local/qt/lib -L/usr/local/qt/lib -L/usr/X11R6/lib -L/us=
r/lib=20
=2D -lgcrypt -lgpg-error -lqt-mt -lXext -lX11 -lm -lpthread
obj/main.o: In function `main':
/home/ralf/bims/tools/test/main.cpp:206: undefined reference to=20
`gpg_strerror(unsigned)'

Why is there an undefined reference when I link against libgpg-error as sho=
wn=20
above?

> >> in case you did not know that you can dump a MPI value with an
> >> internal function for debugging purposes: _gcry_log_mpidump().
> >
> > How can I use it?
>
> Well, as I said, it is an internal function and not a public
> interface.  You can simply use it from within gdb, e.g.:
>
> gdb> p _gcry_log_mpidump ("", mpi_value)

OK, I'll try this.

At the moment, I tried this to check the MPI values of the original and the=
=20
restored key are equal:

    for (i =3D 0; i < gcry_ac_data_length(privKey->data); i++)
    {
      gcry_ac_data_get_index (privKey->data, i, (const char **)&pname, &mpi=
);
      gcry_ac_data_get_index (restPrivKey->data, i, (const char **)&pname,=
=20
&mpi2);
      if (gcry_mpi_cmp (mpi, mpi2) !=3D 0)
        printf ("MPI %d are not equal", i);
    }

But it seems that all MPI values are equal, the text is not output.

Best regards,
Ralf.
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/Ha8O7YyyfykA0YkRAjHIAJ91FrI+kVoKLl/tBTKem2WuT2Z/EgCgjm62
63SFY65ShOHDV61wsUhhgKg=3D
=3DO3XU
=2D----END PGP SIGNATURE-----