Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Dec 2019 23:17:31 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Garance A Drosehn <drosih@rpi.edu>
Cc:        freebsd-current@freebsd.org
Subject:   Re: OpenSSL breaks factor(6)
Message-ID:  <20191229071731.GB69227@troutmask.apl.washington.edu>
In-Reply-To: <FD587443-FFA6-486B-B63A-11F425227FF8@rpi.edu>
References:  <20191227212530.GA61314@troutmask.apl.washington.edu> <20191227214717.GA61475@troutmask.apl.washington.edu> <20191227224212.GA61594@troutmask.apl.washington.edu> <92557725-6612-46ED-BA39-FCE91EF6D091@rpi.edu> <20191229051035.GA68947@troutmask.apl.washington.edu> <FD587443-FFA6-486B-B63A-11F425227FF8@rpi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 29, 2019 at 01:34:28AM -0500, Garance A Drosehn wrote:
> On 29 Dec 2019, at 0:10, Steve Kargl wrote:
> 
> > On Sat, Dec 28, 2019 at 10:46:52PM -0500, Garance A Drosehn wrote:
> >>
> >> What if the user wants to factor a hexadecimal value which does not
> >> happen to include [a...f]?
> >>
> >> How about recognizing a prefix of '0x' as a way to indicate the value
> >> is hexadecimal?
> >
> > An interested user will need to add that support.  AFAIK, factor(6)
> > has never recognized the 0x prefix, and I'm not trying to add new
> > features.  I'm simply fixing factor(6) to match its documentation,
> > and trying to ensure WITH_OPENSSL and WITHOUT_OPENSSL give the
> > same results where applicable.
> 
> Well, I'd be willing to do the work to add the new feature, and also
> make the commit.  It'd be a nice easy task for me to tackle...  :)
> 
> But I think documenting that "hex works, but only for hex values
> which have at least one A-F in the value" is not something that I'd
> want to draw attention to via documentation.
> 

You have a 17 year history to worry about as hexadecimal support
was added by "r104720 | fanf | 2002-10-09".  Compiling factor(6)
with and without OpenSSL support after 2002-10-09 gives a utility
with different inconsistent behavior.

Current code:

With OpenSSL
% factor 1abc
1: 1
% factor 1abczzzz
1: 1
% factor +125
factor: +125: illegal numeric format.

Without OpenSSL
% factor 1abc
6844: 2 2 29 59
% factor 1abczzzz
factor: 1abczzzz: illegal numeric format.
% factor +125
125: 5 5 5

Patched code:

With OpenSSL
% factor 1abc
6844: 2 2 29 59
% factor 1abczzzz
6844: 2 2 29 59
% factor +125
125: 5 5 5

Without OpenSSL
% factor 1abc
6844: 2 2 29 59
% factor 1abczzzz
6844: 2 2 29 59
% factor +125
125: 5 5 5

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191229071731.GB69227>