From edwin@mavetju.org  Sat Oct  4 18:17:33 2003
Return-Path: <edwin@mavetju.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9E22916A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  4 Oct 2003 18:17:33 -0700 (PDT)
Received: from mag.barnet.com.au (mag.barnet.com.au [218.185.88.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B2C5143FE0
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  4 Oct 2003 18:17:32 -0700 (PDT)
	(envelope-from edwin@mavetju.org)
Received: from extmail.barnet.com.au (tim.direct.int.barnet.com.au [10.10.10.2])
	by mag.barnet.com.au (Postfix) with ESMTP id 376F110A2;
	Sun,  5 Oct 2003 11:17:30 +1000 (EST)
Received: from k7.mavetju (tim.barnet.com.au [218.185.88.1])
	by extmail.barnet.com.au (Postfix) with ESMTP
	id 10C2F1E1A; Sun,  5 Oct 2003 11:17:28 +1000 (EST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id CD4A26A7101; Sun,  5 Oct 2003 11:17:26 +1000 (EST)
Message-Id: <20031005011726.CD4A26A7101@k7.mavetju>
Date: Sun,  5 Oct 2003 11:17:26 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: handler@grendel.net
Subject: [patch] Make security/sfs compile on -current
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         57586
>Category:       ports
>Synopsis:       [patch] Make security/sfs compile on -current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 04 18:20:15 PDT 2003
>Closed-Date:    Wed Oct 15 15:05:11 PDT 2003
>Last-Modified:  Wed Oct 15 15:05:11 PDT 2003
>Originator:     Edwin Groothuis
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Sun Aug 17 16:04:25 EST 2003 edwin@k7.mavetju:/usr/src/sys/compile/k7 i386

>Description:

	security/sfs doesn't build on -current due to problems with:

	random_prime.C: In member function `bigint& prime_finder::next_strong(unsigned int)':
       random_prime.C:339: warning: comparison is always false due to limited range of data type

       (http://bento.freebsd.org/errorlogs/i386-5-latest/sfs-0.7.2.log)

>How-To-Repeat:

	-

>Fix:

The function fermat2_test() does return true when (some calculated
value) equals 2. It looks like a leftover from a historical change.

--- crypt/random_prime.C.orig   Sat Oct  4 18:14:40 2003
+++ crypt/random_prime.C        Sat Oct  4 18:14:54 2003
@@ -336,7 +336,7 @@
   bigint t1, t2;
   for (;;) {
     next_weak ();
-    if (!tmp || (fermat2_test (tmp, &t1, &t2) == 2 && tmp.probab_prime (iter)))
+    if (!tmp || (fermat2_test (tmp, &t1, &t2) && tmp.probab_prime (iter)))
       return tmp;
   }
 }


Maintainer (cc:d), please approve this patch.
In the mean time, I'm going to find out whats wrong with it to get
ports/57251 fixed. (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/57251)
>Release-Note:
>Audit-Trail:

From: Oliver Lehmann <oliver@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/57586: [patch] Make security/sfs compile on -current
Date: Tue, 7 Oct 2003 22:04:12 +0200

 A follow up can be found at
 	ports/57599
State-Changed-From-To: open->closed 
State-Changed-By: mdodd 
State-Changed-When: Wed Oct 15 15:04:57 PDT 2003 
State-Changed-Why:  
Committed, thanks. 

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