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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 May 2013 12:09:48 +0300
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Cris <linux-cris-kernel@...s.com>
Subject: Re: [PATCH] cris: kgdb: use native hex2bin

On Thu, May 30, 2013 at 10:57 AM, Geert Uytterhoeven
<geert@...ux-m68k.org> wrote:
> On Tue, May 28, 2013 at 5:53 PM, Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
>> diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c
>> index 37e6d2c..07bccd8 100644
>> --- a/arch/cris/arch-v10/kernel/kgdb.c
>> +++ b/arch/cris/arch-v10/kernel/kgdb.c
>
>> @@ -659,18 +651,6 @@ read_register (char regno, unsigned int *valptr)
>>  }
>>
>>  /********************************** Packet I/O ******************************/
>> -/* Returns the integer equivalent of a hexadecimal character. */
>> -static int
>> -hex (char ch)
>> -{
>> -       if ((ch >= 'a') && (ch <= 'f'))
>> -               return (ch - 'a' + 10);
>> -       if ((ch >= '0') && (ch <= '9'))
>> -               return (ch - '0');
>> -       if ((ch >= 'A') && (ch <= 'F'))
>> -               return (ch - 'A' + 10);
>> -       return (-1);
>> -}
>
> This one handles both upper and lower case hex characters, while hex2bin()
> handles lower case only. Is that OK, or should hex2bin be extended?

Its implementation is located in lib/hexdump.c
If you look at it carefully you find that hex2bin calls hex_to_bin()
which services both cases (via using tolower()).

--
With Best Regards,
Andy Shevchenko
--
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