From turbo@conversation.bsdunix.ch  Thu Dec  8 16:02:51 2005
Return-Path: <turbo@conversation.bsdunix.ch>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C16F016A420
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Dec 2005 16:02:51 +0000 (GMT)
	(envelope-from turbo@conversation.bsdunix.ch)
Received: from conversation.bsdunix.ch (fun-dimension.ch [82.220.17.18])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0B74B43D94
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Dec 2005 16:02:40 +0000 (GMT)
	(envelope-from turbo@conversation.bsdunix.ch)
Received: from conversation.bsdunix.ch (localhost.bsdunix.ch [127.0.0.1])
	by conversation.bsdunix.ch (8.13.1/8.13.1) with ESMTP id jB8G2XCq013918
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 8 Dec 2005 17:02:33 +0100 (CET)
	(envelope-from turbo@conversation.bsdunix.ch)
Received: (from turbo@localhost)
	by conversation.bsdunix.ch (8.13.1/8.13.1/Submit) id jB8G2Xjp013917;
	Thu, 8 Dec 2005 17:02:33 +0100 (CET)
	(envelope-from turbo)
Message-Id: <200512081602.jB8G2Xjp013917@conversation.bsdunix.ch>
Date: Thu, 8 Dec 2005 17:02:33 +0100 (CET)
From: Thomas Vogt <thomas@bsdunix.ch>
Reply-To: Thomas Vogt <thomas@bsdunix.ch>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: security/gnupg fix batch mode
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         90105
>Category:       ports
>Synopsis:       security/gnupg fix batch mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kuriyama
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 08 16:10:03 GMT 2005
>Closed-Date:    Fri Dec 16 02:17:22 GMT 2005
>Last-Modified:  Fri Dec 16 02:17:22 GMT 2005
>Originator:     Thomas Vogt
>Release:        FreeBSD 4.11-RELEASE-p10 i386
>Organization:
>Environment:
System: FreeBSD conversation.bsdunix.ch 4.11-RELEASE-p10 FreeBSD 4.11-RELEASE-p10 #3: Fri Jun 17 15:54:34 CEST 2005 root@conversation.bsdunix.ch:/usr/obj/usr/src/sys/CONVERSATION i386


	
>Description:
	- gnupg 1.4.2 does not work properly with --batch. "Assertion failed: (pkt->pkt.generic), function build_packet, file build-packet.c , line 74.". This problem is fixed in the gnupg cvs and will be in the 1.4.3 release.
	- add sha256 checksum
>How-To-Repeat:
	Use BATCH mode
>Fix:



diff -u Makefile.orig Makefile
--- Makefile.orig	Thu Dec  8 16:54:22 2005
+++ Makefile	Thu Dec  8 16:54:31 2005
@@ -7,6 +7,7 @@
 
 PORTNAME=	gnupg
 PORTVERSION=	1.4.2
+PORTREVISION=   1
 CATEGORIES=	security
 MASTER_SITES=	${MASTER_SITE_GNUPG}
 MASTER_SITE_SUBDIR=	gnupg


diff -u distinfo distinfo
--- distinfo.orig	Thu Dec  8 15:03:38 2005
+++ distinfo	Thu Dec  8 15:06:06 2005
@@ -1,4 +1,6 @@
 MD5 (gnupg-1.4.2.tar.bz2) = c7afd50c7d01fcfada229326b3958404
+SHA256 (gnupg-1.4.2.tar.bz2) = 2e59787afe23102ebd8b05d32ce6abf165d2035958b200c2e330329c0a98b892
 SIZE (gnupg-1.4.2.tar.bz2) = 2891177
 MD5 (gnupg-1.4.2.tar.bz2.sig) = 9b2fba5c49d094b1f1b8219d354e61f5
+SHA256 (gnupg-1.4.2.tar.bz2.sig) = a6cc885af017aa0aa059230f246c30cb0adbe8a30bacbc6cc6e85347be6b6e34
 SIZE (gnupg-1.4.2.tar.bz2.sig) = 65


diff -ruN g10/keygen.c.orig g10/keygen.c
--- g10/keygen.c.orig	Thu Dec  8 14:52:16 2005
+++ g10/keygen.c	Thu Dec  8 14:53:55 2005
@@ -2688,7 +2688,14 @@
   PACKET *pkt;
 
   pkt=m_alloc_clear(sizeof(*pkt));
-  pkt->pkttype=PKT_NONE;
+  
+/* We're not acually using a user ID here - this is just an
+     arbitrary choice.  We delete it anyway. */
+
+  pkt->pkttype=PKT_USER_ID;
+  pkt->pkt.user_id=m_alloc_clear(sizeof *pkt->pkt.user_id);
+  pkt->pkt.user_id->ref=1;
+  
   *tree=new_kbnode(pkt);
   delete_kbnode(*tree);
 }
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->kuriyama 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Dec 8 16:12:14 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=90105 

From: Thomas Vogt <thomas@bsdunix.ch>
To: bug-followup@FreeBSD.org, Thomas Vogt <thomas@bsdunix.ch>
Cc: kuriyama@FreeBSD.org
Subject: Re: ports/90105: security/gnupg fix batch mode
Date: Fri, 9 Dec 2005 12:54:46 +0100

 Hi all
 
 Sorry, I sumbitted a wrong fix. Next time I should read the whole cvs  
 entry and do a better testing in my enviroment. The correct patch  
 looks like. This one is the _correct_ fix in the cvs and generate  
 correct keys in the batch mode.
 
 Regards,
 Thomas
 
 --- g10/keygen.c.orig   Tue Jun 21 12:22:17 2005
 +++ g10/keygen.c        Fri Dec  9 11:31:59 2005
 @@ -3243,15 +3243,21 @@
 static int
 write_keyblock( IOBUF out, KBNODE node )
 {
 -    for( ; node ; node = node->next ) {
 -       int rc = build_packet( out, node->pkt );
 -       if( rc ) {
 -           log_error("build_packet(%d) failed: %s\n",
 +  for( ; node ; node = node->next )
 +    {
 +      if(!is_deleted_kbnode(node))
 +       {
 +         int rc = build_packet( out, node->pkt );
 +         if( rc )
 +           {
 +             log_error("build_packet(%d) failed: %s\n",
                          node->pkt->pkttype, g10_errstr(rc) );
 -           return G10ERR_WRITE_FILE;
 +             return G10ERR_WRITE_FILE;
 +           }
          }
       }
 -    return 0;
 +
 +  return 0;
 }
 
 

From: Jun Kuriyama <kuriyama@imgsrc.co.jp>
To: Thomas Vogt <thomas@bsdunix.ch>
Cc: bug-followup@FreeBSD.org, kuriyama@FreeBSD.org
Subject: Re: ports/90105: security/gnupg fix batch mode
Date: Fri, 16 Dec 2005 07:51:16 +0900

 At Fri, 9 Dec 2005 12:54:46 +0100,
 Thomas Vogt wrote:
 > Sorry, I sumbitted a wrong fix. Next time I should read the whole cvs  
 > entry and do a better testing in my enviroment. The correct patch  
 > looks like. This one is the _correct_ fix in the cvs and generate  
 > correct keys in the batch mode.
 
 Thank you for your submission!  Could you point me committed CVS info
 in http://cvs.gnupg.org/?  I cannot find this fix in the repository...
 
 
 -- 
 Jun Kuriyama <kuriyama@imgsrc.co.jp> // IMG SRC, Inc.
              <kuriyama@FreeBSD.org> // FreeBSD Project

From: Thomas Vogt <thomas@bsdunix.ch>
To: bug-followup@FreeBSD.org
Cc: kuriyama@FreeBSD.org
Subject: Re: ports/90105: security/gnupg fix batch mode
Date: Fri, 16 Dec 2005 02:46:50 +0100

 Hi
 
 Jun Kuriyama wrote:
 > At Fri, 9 Dec 2005 12:54:46 +0100,
 > Thomas Vogt wrote:
 >> Sorry, I sumbitted a wrong fix. Next time I should read the whole cvs  
 >> entry and do a better testing in my enviroment. The correct patch  
 >> looks like. This one is the _correct_ fix in the cvs and generate  
 >> correct keys in the batch mode.
 > 
 > Thank you for your submission!  Could you point me committed CVS info
 > in http://cvs.gnupg.org/?  I cannot find this fix in the repository...
 
 Its revision 3853
 http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/trunk/g10/keygen.c?rev=3853&view=log
 
 diff:
 http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/trunk/g10/keygen.c?rev=3853&r1=3852&r2=3853 
 
 
 cheers
 Thomas
State-Changed-From-To: open->closed 
State-Changed-By: kuriyama 
State-Changed-When: Fri Dec 16 02:17:10 UTC 2005 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=90105 
>Unformatted:
