From owner-freebsd-current@freebsd.org Sat Dec 28 03:02:14 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3AF51D8081 for ; Sat, 28 Dec 2019 03:02:14 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47l7lT0vz7z4s5f for ; Sat, 28 Dec 2019 03:02:12 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id xBS32BFP041084; Fri, 27 Dec 2019 19:02:11 -0800 (PST) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xBS32BaP041083; Fri, 27 Dec 2019 19:02:11 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201912280302.xBS32BaP041083@gndrsh.dnsmgr.net> Subject: Re: OpenSSL breaks factor(6) In-Reply-To: <20191227230335.GA61736@troutmask.apl.washington.edu> To: sgk@troutmask.apl.washington.edu Date: Fri, 27 Dec 2019 19:02:11 -0800 (PST) CC: freebsd-current@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 47l7lT0vz7z4s5f X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [-0.48 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.71)[-0.706,0]; FROM_HAS_DN(0.00)[]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.02), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.71)[-0.708,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2019 03:02:14 -0000 > On Fri, Dec 27, 2019 at 02:42:12PM -0800, Steve Kargl wrote: > > On Fri, Dec 27, 2019 at 01:47:17PM -0800, Steve Kargl wrote: > > > On Fri, Dec 27, 2019 at 01:25:30PM -0800, Steve Kargl wrote: > > > > The use of OpenSSL in factor(6) breaks factor(6) with respect to > > > > its documentation. > > > > > > > > % man factor > > > > ... > > > > Numbers may be preceded by a single '+'. > > > > ... > > > > > > > > % factor +125 > > > > factor: +125: illegal numeric format. > > > > > > > > > > This fixes factor(6) for the above issue. The issue with > > > hexadecimal is not easily fixed. > > > > > > > This patch now includes a fix for hexadecimal conversion. It > > simple scans the string for a hex digit in [a,...,f] and assumes > > that a hexadecimal string has been entered. A string that includes > > character from the decimal digits is assumed to by a decimal > > representation. > > Might as well fix the documentation. Acknowledges that factor(6) > can deal with hexidecimal strings, and as a bonus fixes the bogus > information about the maximum value considered by primes(6). > > Index: factor.6 > =================================================================== > --- factor.6 (revision 355983) > +++ factor.6 (working copy) > @@ -36,7 +36,7 @@ > .\" > .\" chongo /\oo/\ > .\" > -.Dd October 10, 2002 > +.Dd December 27, 2019 > .Dt FACTOR 6 > .Os > .Sh NAME > @@ -67,11 +67,20 @@ > .Nm > is invoked with no arguments, > .Nm > -reads numbers, one per line, from standard input, until end of file or error. > +reads numbers, one per line, from standard input, until end of file or 0 > +is entered or an error occurs. > Leading white-space and empty lines are ignored. > Numbers may be preceded by a single > .Ql + . > Numbers are terminated by a non-digit character (such as a newline). > +Numbers can be either decimal or hexadecimal strings. > +If the string contains only decimal digits, it is treated as a > +decimal representation for a number. > +A hexadecimal string should not a ^contain? s/a/an/ > +.Em 0x > +or > +.Em 0X > +prefix. > After a number is read, it is factored. > .Pp > The > @@ -89,7 +98,7 @@ > value must not be greater than the maximum. > The default and maximum value of > .Ar stop > -is 3825123056546413050. > +is 18446744073709551615. > .Pp > When the > .Nm primes > > -- > Steve -- Rod Grimes rgrimes@freebsd.org