From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jul 5 20:10:11 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44E0A106564A for ; Tue, 5 Jul 2011 20:10:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 224908FC12 for ; Tue, 5 Jul 2011 20:10:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p65KAAs0002172 for ; Tue, 5 Jul 2011 20:10:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p65KAAXI002171; Tue, 5 Jul 2011 20:10:10 GMT (envelope-from gnats) Resent-Date: Tue, 5 Jul 2011 20:10:10 GMT Resent-Message-Id: <201107052010.p65KAAXI002171@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mark Atkinson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5516D106566C for ; Tue, 5 Jul 2011 20:05:06 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 2C02F8FC13 for ; Tue, 5 Jul 2011 20:05:06 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p65K55eh013738 for ; Tue, 5 Jul 2011 20:05:05 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p65K55mZ013737; Tue, 5 Jul 2011 20:05:05 GMT (envelope-from nobody) Message-Id: <201107052005.p65K55mZ013737@red.freebsd.org> Date: Tue, 5 Jul 2011 20:05:05 GMT From: Mark Atkinson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/158674: [PATCH] security/gnupg fix gpg2 Assertion failed: (data), function mpi_from_sexp, file pkglue.c, line 41. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 20:10:11 -0000 >Number: 158674 >Category: ports >Synopsis: [PATCH] security/gnupg fix gpg2 Assertion failed: (data), function mpi_from_sexp, file pkglue.c, line 41. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Jul 05 20:10:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Mark Atkinson >Release: 9.0-current >Organization: >Environment: FreeBSD moby 9.0-CURRENT FreeBSD 9.0-CURRENT #4 r223681: Wed Jun 29 12:50:00 PDT 2011 >Description: If you try to sign something in the recent gnupg 2.0.17 w/libcrypt 5.0 you will receive the following error: enigmail> /usr/local/bin/gpg2 --charset utf8 --batch --no-tty --status-fd 2 --comment Using GnuPG with Mozilla - http://enigmail.mozdev.org/ -t --clearsign -u --use-agent Warning: using insecure memory! Assertion failed: (data), function mpi_from_sexp, file pkglue.c, line 41. This is first described here: http://www.gossamer-threads.com/lists/gnupg/gcrypt/55063 and the appropriate patch is found here: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blobdiff_plain;f=g10/pkglue.c;h=5c47511f7236cbde17a2a983bc597950be830475;hp=cbfe21ea89f4088033e660c5210178a535fb86c9;hb=13290b0e0fcf3a493e4848b29329d56b69bc4dd9;hpb=af497d52c3c88d1cdbedf1c7c2ce2f21f2bc9ad4 >How-To-Repeat: Attempt to sign with gnupg 2.0.17 w/libcrypt 5.0 >Fix: Apply the attached patch recompile and re-install. Patch attached with submission follows: diff --git a/g10/pkglue.c b/g10/pkglue.c index cbfe21e..5c47511 100644 --- a/g10/pkglue.c +++ b/g10/pkglue.c @@ -34,10 +34,10 @@ mpi_from_sexp (gcry_sexp_t sexp, const char * item) { gcry_sexp_t list; gcry_mpi_t data; - + list = gcry_sexp_find_token (sexp, item, 0); assert (list); - data = gcry_sexp_nth_mpi (list, 1, 0); + data = gcry_sexp_nth_mpi (list, 1, GCRYMPI_FMT_USG); assert (data); gcry_sexp_release (list); return data; @@ -293,7 +293,7 @@ pk_decrypt (int algo, gcry_mpi_t * result, gcry_mpi_t * data, if (rc) return rc; - *result = gcry_sexp_nth_mpi (s_plain, 0, 0); + *result = gcry_sexp_nth_mpi (s_plain, 0, GCRYMPI_FMT_USG); gcry_sexp_release (s_plain); if (!*result) return -1; /* oops */ >Release-Note: >Audit-Trail: >Unformatted: