Error encrypting string data

Ralf Schneider ralf@tapfere-schneiderleins.de
Thu, 17 Jul 2003 13:37:25 +0200


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

Hi,

I modified the sample code from tests/ac.c to encrypt a string instead of a=
n=20
unsigned integer, but I get an error with this new code.

The original code from tests/ac.c is (a is the unsigned integer):

  x =3D gcry_mpi_new (0);
  gcry_mpi_set_ui (x, a);

  if (gcry_ac_data_encrypt (hd, GCRY_AC_FLAG_DATA_NO_BLINDING, pubKey, x,=20
&data))
  {
  }

I replaced the code for setting the MPI value:

  char text[] =3D "Dies ist ein Test-String.";
 =20
  x =3D gcry_mpi_new (0);
  gcry_mpi_set_opaque (x, text, strlen(text));

  if (gcry_ac_data_encrypt (hd, GCRY_AC_FLAG_DATA_NO_BLINDING, pubKey, x,=20
&data))
  {
  }

When I execute this code I get a core dump and an error message:

Ohhhh jeeee: ... this is a bug (sexp.c:1046:sexp_sscan)

Did I really find a bug or did I make a mistake within my code? Would be gr=
eat=20
if someone could help me in encrypting string data.

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

iD8DBQE/Fop57YyyfykA0YkRAtZXAJwLd9C/JRsj1Bn0lX+zYunu5IerMQCfcVIg
K87MBEzNaB+8hIdilEbaI48=3D
=3DHKqQ
=2D----END PGP SIGNATURE-----