You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by William A Rowe Jr <wr...@rowe-clan.net> on 2016/01/06 19:37:08 UTC

EBCDIC bug(s?) in our apr-util//crypto/crypt_blowfish.c implementation

This doesn't look good.  Does an EBCDIC architecture fan want to whip
up the fix?


static char *BF_crypt(const char *key, const char *setting,
	char *output, int size,
	BF_word min)
{
...	static const unsigned char flags_by_subtype[26] =
		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
...	if (setting[0] != '$' ||
	    setting[1] != '2' ||
	    setting[2] < 'a' || setting[2] > 'z' ||
	    !flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a'] ||

Re: EBCDIC bug(s?) in our apr-util//crypto/crypt_blowfish.c implementation

Posted by Eric Covener <co...@gmail.com>.
FWIW I had recently disabled this on my own EBCDIC port when I saw too
late that it doesn't even pass the self-test.  Will not be able to dig
into it though.

On Wed, Jan 6, 2016 at 1:37 PM, William A Rowe Jr <wr...@rowe-clan.net> wrote:
> This doesn't look good.  Does an EBCDIC architecture fan want to whip up the
> fix?
>
>
> static char *BF_crypt(const char *key, const char *setting,
> char *output, int size,
> BF_word min)
> {
> ... static const unsigned char flags_by_subtype[26] =
> {2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
> ... if (setting[0] != '$' ||
>    setting[1] != '2' ||
>    setting[2] < 'a' || setting[2] > 'z' ||
>    !flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a'] ||



-- 
Eric Covener
covener@gmail.com