View | Details | Raw Unified | Return to bug 150457
Collapse All | Expand All

(-)crypt-gpgme.c (-6 / +12 lines)
Lines 2003-2014 Link Here
2003
  {
2003
  {
2004
    if (!mutt_strncmp ("-----BEGIN PGP ", buf, 15))
2004
    if (!mutt_strncmp ("-----BEGIN PGP ", buf, 15))
2005
    {
2005
    {
2006
      if (!mutt_strcmp ("MESSAGE-----\n", buf + 15))
2006
      if (!mutt_strcmp ("MESSAGE-----\n", buf + 15) ||
2007
	  !mutt_strcmp ("MESSAGE-----\r\n", buf + 15))
2007
      {
2008
      {
2008
	enc = 1;
2009
	enc = 1;
2009
	break;
2010
	break;
2010
      }
2011
      }
2011
      else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15))
2012
      else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) ||
2013
	       !mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15))
2012
      {
2014
      {
2013
	sgn = 1;
2015
	sgn = 1;
2014
	break;
2016
	break;
Lines 2128-2134 Link Here
2128
      continue;
2130
      continue;
2129
    }
2131
    }
2130
2132
2131
    if (!mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n"))
2133
    if (!mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n") ||
2134
	!mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\r\n"))
2132
      break;
2135
      break;
2133
    
2136
    
2134
    if (armor_header)
2137
    if (armor_header)
Lines 2196-2209 Link Here
2196
          clearsign = 0;
2199
          clearsign = 0;
2197
          start_pos = last_pos;
2200
          start_pos = last_pos;
2198
          
2201
          
2199
          if (!mutt_strcmp ("MESSAGE-----\n", buf + 15))
2202
          if (!mutt_strcmp ("MESSAGE-----\n", buf + 15) ||
2203
	      !mutt_strcmp ("MESSAGE-----\r\n", buf + 15))
2200
            needpass = 1;
2204
            needpass = 1;
2201
          else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15))
2205
          else if (!mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) ||
2206
		   !mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15))
2202
            {
2207
            {
2203
              clearsign = 1;
2208
              clearsign = 1;
2204
              needpass = 0;
2209
              needpass = 0;
2205
            }
2210
            }
2206
          else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15))
2211
          else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) ||
2212
		   !mutt_strcmp ("PUBLIC KEY BLOCK-----\r\n", buf + 15))
2207
          {
2213
          {
2208
            needpass = 0;
2214
            needpass = 0;
2209
            pgp_keyblock = 1;
2215
            pgp_keyblock = 1;
(-)pgp.c (-13 / +26 lines)
Lines 219-225 Link Here
219
      continue;
219
      continue;
220
    }
220
    }
221
221
222
    if (mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n") == 0)
222
    if (mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\n") == 0 ||
223
	mutt_strcmp (buf, "-----BEGIN PGP SIGNATURE-----\r\n") == 0)
223
      break;
224
      break;
224
    
225
    
225
    if (armor_header)
226
    if (armor_header)
Lines 287-300 Link Here
287
      clearsign = 0;
288
      clearsign = 0;
288
      start_pos = last_pos;
289
      start_pos = last_pos;
289
290
290
      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0)
291
      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0 ||
292
	  mutt_strcmp ("MESSAGE-----\r\n", buf + 15) == 0)
291
        needpass = 1;
293
        needpass = 1;
292
      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0)
294
      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0 ||
295
	       mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15) == 0)
293
      {
296
      {
294
	clearsign = 1;
297
	clearsign = 1;
295
        needpass = 0;
298
        needpass = 0;
296
      }
299
      }
297
      else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15))
300
      else if (!mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) ||
301
	       !mutt_strcmp ("PUBLIC KEY BLOCK-----\r\n", buf + 15))
298
      {
302
      {
299
        needpass = 0;
303
        needpass = 0;
300
        pgp_keyblock = 1;
304
        pgp_keyblock = 1;
Lines 327-336 Link Here
327
	
331
	
328
	fputs (buf, tmpfp);
332
	fputs (buf, tmpfp);
329
333
330
	if ((needpass && mutt_strcmp ("-----END PGP MESSAGE-----\n", buf) == 0) ||
334
	if ((needpass &&
331
	    (!needpass 
335
	     (mutt_strcmp ("-----END PGP MESSAGE-----\n", buf) == 0 ||
332
             && (mutt_strcmp ("-----END PGP SIGNATURE-----\n", buf) == 0
336
	      mutt_strcmp ("-----END PGP MESSAGE-----\r\n", buf) == 0)) ||
333
                 || mutt_strcmp ("-----END PGP PUBLIC KEY BLOCK-----\n",buf) == 0)))
337
	    (!needpass &&
338
	     (mutt_strcmp ("-----END PGP SIGNATURE-----\n", buf) == 0 ||
339
	      mutt_strcmp ("-----END PGP SIGNATURE-----\r\n", buf) == 0 ||
340
	      mutt_strcmp ("-----END PGP PUBLIC KEY BLOCK-----\n",buf) == 0 ||
341
	      mutt_strcmp ("-----END PGP PUBLIC KEY BLOCK-----\r\n",buf) == 0)))
334
	  break;
342
	  break;
335
	/* remember optional Charset: armor header as defined by RfC4880 */
343
	/* remember optional Charset: armor header as defined by RfC4880 */
336
	if (mutt_strncmp ("Charset: ", buf, 9) == 0)
344
	if (mutt_strncmp ("Charset: ", buf, 9) == 0)
Lines 554-564 Link Here
554
  {
562
  {
555
    if (mutt_strncmp ("-----BEGIN PGP ", buf, 15) == 0)
563
    if (mutt_strncmp ("-----BEGIN PGP ", buf, 15) == 0)
556
    {
564
    {
557
      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0)
565
      if (mutt_strcmp ("MESSAGE-----\n", buf + 15) == 0 ||
566
	  mutt_strcmp ("MESSAGE-----\r\n", buf + 15) == 0)
558
	enc = 1;
567
	enc = 1;
559
      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0)
568
      else if (mutt_strcmp ("SIGNED MESSAGE-----\n", buf + 15) == 0 ||
569
	       mutt_strcmp ("SIGNED MESSAGE-----\r\n", buf + 15) == 0)
560
	sgn = 1;
570
	sgn = 1;
561
      else if (mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0)
571
      else if (mutt_strcmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0 ||
572
	       mutt_strcmp ("PUBLIC KEY BLOCK-----\r\n", buf + 15) == 0)
562
	key = 1;
573
	key = 1;
563
    }
574
    }
564
  }
575
  }
Lines 1067-1075 Link Here
1067
   */
1078
   */
1068
  while (fgets (buffer, sizeof (buffer) - 1, pgpout) != NULL)
1079
  while (fgets (buffer, sizeof (buffer) - 1, pgpout) != NULL)
1069
  {
1080
  {
1070
    if (mutt_strcmp ("-----BEGIN PGP MESSAGE-----\n", buffer) == 0)
1081
    if (mutt_strcmp ("-----BEGIN PGP MESSAGE-----\n", buffer) == 0 ||
1082
	mutt_strcmp ("-----BEGIN PGP MESSAGE-----\r\n", buffer) == 0)
1071
      fputs ("-----BEGIN PGP SIGNATURE-----\n", fp);
1083
      fputs ("-----BEGIN PGP SIGNATURE-----\n", fp);
1072
    else if (mutt_strcmp("-----END PGP MESSAGE-----\n", buffer) == 0)
1084
    else if (mutt_strcmp("-----END PGP MESSAGE-----\n", buffer) == 0 ||
1085
	     mutt_strcmp("-----END PGP MESSAGE-----\r\n", buffer) == 0)
1073
      fputs ("-----END PGP SIGNATURE-----\n", fp);
1086
      fputs ("-----END PGP SIGNATURE-----\n", fp);
1074
    else
1087
    else
1075
      fputs (buffer, fp);
1088
      fputs (buffer, fp);

Return to bug 150457