lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 5 May 2008 14:58:07 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Harvey Harrison <harvey.harrison@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] lib: add ascii hex helper functions

On Sat, 03 May 2008 12:27:27 -0700
Harvey Harrison <harvey.harrison@...il.com> wrote:

> Everyone rolls their own version around the tree, centralize
> in lib/hexdump.c.  Move the only existing users of hex_asc over
> to the hi/lo helpers.
> 
> Add helpers for reading binary values from a stream of hex chars.
> Most existing users want to know how many chars were read as well.
> This implementation chooses to return the number of chars read
> and takes a pointer to the value being read.
> 
> As an alternative, a char **buf could be passed and the value could
> be returned and the pointer updated by reference.
> 
> Fixed size helpers for u8, u16, u32 and u64 have been added with
> another helper that takes an argument specifying the max number of
> chars to read (capped to the size that will fit in an unsigned long)
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@...il.com>
> ---
> Andrew, I've thought a little more about this, It's possible we could
> get away without the u8/u16 helpers, but it does make the api nicely
> complete, and they are pretty small.  Most users really want to read
> a long or an int, but many can be move to the u32/u64 versions to
> tighten up implicit assumptions being made about the length being
> read.

hex_to_val() is distressingly similar to simple_strtoul(..., ..., 16).

> I'll wait for coment before fixing the previous series of patches to
> use these.

I'm all worn out on this one.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ