Re: new gmime/gpg bug



Am 03.07.04 19:26 schrieb(en) Jeffrey Stedfast:
I don't see how GMime would change the multipart bounaries. I can only
presume that perhaps Balsa changed them after signing?

If you can show me where GMime went wrong, please do...

Please see the attached test program and the results output (combines stdout and stderr). The app uses plain gmime, no gpgme. In the output, the boundaries of the embedded multipart/mixed object have changed during the signing process, so I assume this is done by gmime. And I don't think calling g_mime_multipart_signed_sign() for an object should change it's contents, shouldn't it? Furthermore, the source file responsible for signing in balsa didn't change since 2 months, and it *did* work before the latest 2 or 3 gmime cvs upgrades.


Cheers, Albrecht.


-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Albrecht Dreß - Johanna-Kirchner-Straße 13 - D-53123 Bonn (Germany) Phone (+49) 228 6199571 - mailto:albrecht dress arcor de _________________________________________________________________________
#include <gmime/gmime.h>

#define MY_MAIL  "albrecht dress arcor de"

int main (int argc, char ** argv)
{
  GMimePart *part;
  GMimeMultipart *mp;
  GMimeSession *session;
  GMimeCipherContext *ctx;
  GMimeMultipartSigned *mps;
  GError *error = NULL;
  gchar * cont;

  g_mime_init(0);
 
  mp = g_mime_multipart_new_with_subtype("mixed");

  part = g_mime_part_new_with_type("text", "plain");
  g_mime_part_set_content(part, "this is part 1", 14);
  g_mime_multipart_add_part(mp, GMIME_OBJECT(part));
  g_object_unref(G_OBJECT(part));

  part = g_mime_part_new_with_type("text", "plain");
  g_mime_part_set_content(part, "this is part 2", 14);
  g_mime_multipart_add_part(mp, GMIME_OBJECT(part));
  g_object_unref(G_OBJECT(part));

  cont = g_mime_object_to_string(GMIME_OBJECT(mp));
  g_message("before signing: '%s'", cont);
  g_free(cont);
  
  session = g_object_new(g_mime_session_get_type(), NULL, NULL);
  ctx = g_mime_gpg_context_new(session, "/usr/bin/gpg");

  mps = g_mime_multipart_signed_new();
  g_mime_multipart_signed_sign(mps, GMIME_OBJECT(mp), ctx, MY_MAIL,
			       GMIME_CIPHER_HASH_DEFAULT, &error);
  
  cont = g_mime_object_to_string(GMIME_OBJECT(mps));
  g_message("after signing: '%s'", cont);
  g_free(cont);
  
  return 0;
}
** Message: before signing: 'Content-Type: multipart/mixed; boundary="=-SmgxjvJuJCvPRQPZa6v/"

--=-SmgxjvJuJCvPRQPZa6v/
Content-Type: text/plain

this is part 1
--=-SmgxjvJuJCvPRQPZa6v/
Content-Type: text/plain

this is part 2
--=-SmgxjvJuJCvPRQPZa6v/--
'

(process:635): gmime-CRITICAL **: file gmime-content-type.c: line 271 (g_mime_content_type_set_parameter): assertion `value != NULL' failed
** Message: after signing: 'Content-Type: multipart/signed; protocol="application/pgp-signature";
	boundary="=-FleBv2T4nMqbVqhKwA+o"

--=-FleBv2T4nMqbVqhKwA+o
Content-Type: multipart/mixed; boundary="=-NuQScCo3Ocknsx7J1gyK"

--=-NuQScCo3Ocknsx7J1gyK
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

this is part 1

--=-NuQScCo3Ocknsx7J1gyK
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

this is part 2

--=-NuQScCo3Ocknsx7J1gyK--

--=-FleBv2T4nMqbVqhKwA+o
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBA5wkTn/9unNAn/9ERAhkFAKCHW03sqK41fkAMFK64WzgZ6StcSQCgjqrS
r5dqlAj1iWwQ/bl3eq5inmw=
=M9TG
-----END PGP SIGNATURE-----

--=-FleBv2T4nMqbVqhKwA+o--
'

Attachment: pgpMLLYeLstut.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]