Re: crypt and null termination

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: crypt and null termination
Дата
Msg-id m3k803pe83.fsf@belphigor.mcnaught.org
обсуждение исходный текст
Ответ на crypt and null termination  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:

> > > and conn.salt is char[2].  Isn't this a problem?
> > 
> > I don't think it is.  Note that it refers to the salt as a "character
> > array", not a string.  Also, since '_' isn't in the allowed encoding
> > set, it can tell the difference between a 9-byte salt and a 2-byte
> > salt without a terminating NUL.
> 
> I didn't pick up that array item.
> 
> Anyway, the patch is small so I will apply it.  There is no telling what
> OS's expect a character string there.

Certainly won't hurt.  I just looked at the docs for glibc on Linux,
and it has its own semi-weird extension format for MD5-based hashing,
but doesn't seem to require null termination--it uses an initial '$',
which again isn't part of the encoding set, as a discriminator rather
than '_', and will treat either another '$' or a NUL as the terminator 
for the extended salt.

-Doug
-- 
Free Dmitry Sklyarov! 
http://www.freesklyarov.org/ 

We will return to our regularly scheduled signature shortly.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: He Weiping
Дата:
Сообщение: plpgsql's variable name can't be the same with table column?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: crypt and null termination