pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #8467: Slightly confusing pgcrypto example in docs
12+ messages / 5 participants
[nested] [flat]

* BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-09-23 23:11  postgresql@richardneill.org
  0 siblings, 1 reply; 12+ messages in thread

From: postgresql@richardneill.org @ 2013-09-23 23:11 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      8467
Logged by:          Richard Neill
Email address:      postgresql@richardneill.org
PostgreSQL version: 9.3.0
Operating system:   Documentation bug
Description:        

The documentation for pgcrypto: 
http://www.postgresql.org/docs/current/static/pgcrypto.html
(and indeed all versions from 8.3-9.3)
contains the following:


--------------------
Example of authentication:


SELECT pswhash = crypt('entered password', pswhash) FROM ... ;


This returns true if the entered password is correct.
--------------------


I found this confusing, because it's  using the same name, "pswhash" in 2
places, one of which is a boolean. It would be, imho, clearer to write the
example query as:


--------------------
SELECT is_authenticated = crypt('entered password', pswhash) FROM ... ;
--------------------


[Also, should the default example perhaps use gen_salt('bf'), as opposed to
gen_salt('md5') ?]




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-09-24 17:31  Magnus Hagander <magnus@hagander.net>
  parent: postgresql@richardneill.org
  0 siblings, 1 reply; 12+ messages in thread

From: Magnus Hagander @ 2013-09-24 17:31 UTC (permalink / raw)
  To: postgresql@richardneill.org; +Cc: pgsql-bugs

On Tue, Sep 24, 2013 at 1:11 AM,  <postgresql@richardneill.org> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      8467
> Logged by:          Richard Neill
> Email address:      postgresql@richardneill.org
> PostgreSQL version: 9.3.0
> Operating system:   Documentation bug
> Description:
>
> The documentation for pgcrypto:
> http://www.postgresql.org/docs/current/static/pgcrypto.html
> (and indeed all versions from 8.3-9.3)
> contains the following:
>
>
> --------------------
> Example of authentication:
>
>
> SELECT pswhash = crypt('entered password', pswhash) FROM ... ;
>
>
> This returns true if the entered password is correct.
> --------------------
>
>
> I found this confusing, because it's  using the same name, "pswhash" in 2
> places, one of which is a boolean. It would be, imho, clearer to write the
> example query as:
>
>
> --------------------
> SELECT is_authenticated = crypt('entered password', pswhash) FROM ... ;
> --------------------

That would render the example incorrect. crypt(pwd, hash) returns the
hash. Not a boolean. This hash needs to be compared to the stored one,
as is explained in the instructions above the example. It's the whole
expression, including the "pswhash = " that returns boolean.

> [Also, should the default example perhaps use gen_salt('bf'), as opposed to
> gen_salt('md5') ?]

This, however, might be a good idea. People should of course always
read the documentation, but having the examples including the "best
practice" would probably be a good idea.

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-09-24 22:20  Richard Neill <rn214@richardneill.org>
  parent: Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 12+ messages in thread

From: Richard Neill @ 2013-09-24 22:20 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: postgresql@richardneill.org; pgsql-bugs

Dear Magnus,

Thanks for your reply.

On 24/09/13 18:31, Magnus Hagander wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference:      8467
>>
>> The documentation for pgcrypto:
>> http://www.postgresql.org/docs/current/static/pgcrypto.html
>> (and indeed all versions from 8.3-9.3)
>> contains the following:
>
>> -------[ ONE] -------------
>> Example of authentication:
>> SELECT pswhash = crypt('entered password', pswhash) FROM ... ;
  > This returns true if the entered password is correct.
>> --------------------
>>
>> I found this confusing, because it's  using the same name, "pswhash" in 2
>> places, one of which is a boolean. It would be, imho, clearer to write the
>> example query as:
>>
>> --------[ TWO ]------------
>> SELECT is_authenticated = crypt('entered password', pswhash) FROM ... ;
>> --------------------
>
> That would render the example incorrect. crypt(pwd, hash) returns the
> hash. Not a boolean. This hash needs to be compared to the stored one,
> as is explained in the instructions above the example. It's the whole
> expression, including the "pswhash = " that returns boolean.

I'm sorry about that: I think I need to correct my proposed correction! 
  I think I've been writing too much C recently, and so I foolishly 
mis-read that as returning pswhash, rather than returning the truth of 
the comparison.

What I meant to write, for clarity, was:

SELECT (pswhash = crypt('entered password', pswhash)) AS pswmatch FROM ... ;

which would make it obvious that we're returning the boolean named pswmatch.

>
>> [Also, should the default example perhaps use gen_salt('bf'), as opposed to
>> gen_salt('md5') ?]
>
> This, however, might be a good idea. People should of course always
> read the documentation, but having the examples including the "best
> practice" would probably be a good idea.

Incidentally, there are 2 other things that confused me in this section.

1. Table F-18. Supported algorithms for crypt()  has a column labelled 
"max password length".  It would perhaps also be useful to know the size 
of column needed to store the crypted password (my original crypt using 
md5 easily fits in a varchar(70), whereas using bf needs the column to 
be varchar(100).)


2. Table F-20. Hash algorithm speeds

What's the difference here between "crypt-md5" and "md5" ?

If I've rightly read this, the algorithm named "md5" in the crypt() 
documentation is named "crypt-md5" here, whereas Table F20's "md5" 
algorithm seems to refer to something else - probably the "normal" 
version of md5.

If so, it would be clearer to write that the last 2 lines ("md5" and 
"sha1") are for comparison only, and refer to the speed of doing an 
ordinary md5/sha1 sum, rather than the md5-variant of crypt().


Anyway, thanks again for your help - Postgres is a wonderful system, 
which I've found to be repeatedly useful.


Best wishes,

Richard







-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-10-02 16:00  Bruce Momjian <bruce@momjian.us>
  parent: Richard Neill <rn214@richardneill.org>
  0 siblings, 2 replies; 12+ messages in thread

From: Bruce Momjian @ 2013-10-02 16:00 UTC (permalink / raw)
  To: Richard Neill <rn214@richardneill.org>; +Cc: Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Tue, Sep 24, 2013 at 11:20:55PM +0100, Richard Neill wrote:
> I'm sorry about that: I think I need to correct my proposed
> correction!  I think I've been writing too much C recently, and so I
> foolishly mis-read that as returning pswhash, rather than returning
> the truth of the comparison.
> 
> What I meant to write, for clarity, was:
> 
> SELECT (pswhash = crypt('entered password', pswhash)) AS pswmatch FROM ... ;
> 
> which would make it obvious that we're returning the boolean named pswmatch.
> 
> >
> >>[Also, should the default example perhaps use gen_salt('bf'), as opposed to
> >>gen_salt('md5') ?]
> >
> >This, however, might be a good idea. People should of course always
> >read the documentation, but having the examples including the "best
> >practice" would probably be a good idea.
> 
> Incidentally, there are 2 other things that confused me in this section.
> 
> 1. Table F-18. Supported algorithms for crypt()  has a column
> labelled "max password length".  It would perhaps also be useful to
> know the size of column needed to store the crypted password (my
> original crypt using md5 easily fits in a varchar(70), whereas using
> bf needs the column to be varchar(100).)
> 
> 
> 2. Table F-20. Hash algorithm speeds
> 
> What's the difference here between "crypt-md5" and "md5" ?
> 
> If I've rightly read this, the algorithm named "md5" in the crypt()
> documentation is named "crypt-md5" here, whereas Table F20's "md5"
> algorithm seems to refer to something else - probably the "normal"
> version of md5.
> 
> If so, it would be clearer to write that the last 2 lines ("md5" and
> "sha1") are for comparison only, and refer to the speed of doing an
> ordinary md5/sha1 sum, rather than the md5-variant of crypt().
> 
> 
> Anyway, thanks again for your help - Postgres is a wonderful system,
> which I've found to be repeatedly useful.

Based on your report, I have developed the attached doc patch which
clarifies when MD5 hash is being referenced, and when MD5 crypt is.  I
have also added your other suggestions.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

md5.diff (text/x-diff, 3.9K) download diff --git a/doc/src/sgml/pgcrypto.sgml b/doc/src/sgml/pgcrypto.sgml new file mode 100644 index a0eead7..976c7db *** a/doc/src/sgml/pgcrypto.sgml --- b/doc/src/sgml/pgcrypto.sgml *************** hmac(data bytea, key text, type text) re *** 95,102 **** </para> <para> ! The algorithms in <function>crypt()</> differ from usual hashing algorithms ! like MD5 or SHA1 in the following respects: </para> <orderedlist> --- 95,102 ---- </para> <para> ! The algorithms in <function>crypt()</> differ from the usual ! MD5 or SHA1 hashing algorithms in the following respects: </para> <orderedlist> *************** hmac(data bytea, key text, type text) re *** 142,147 **** --- 142,148 ---- <entry>Max Password Length</entry> <entry>Adaptive?</entry> <entry>Salt Bits</entry> + <entry>Output length</entry> <entry>Description</entry> </row> </thead> *************** hmac(data bytea, key text, type text) re *** 151,156 **** --- 152,158 ---- <entry>72</entry> <entry>yes</entry> <entry>128</entry> + <entry>60</entry> <entry>Blowfish-based, variant 2a</entry> </row> <row> *************** hmac(data bytea, key text, type text) re *** 158,163 **** --- 160,166 ---- <entry>unlimited</entry> <entry>no</entry> <entry>48</entry> + <entry>34</entry> <entry>MD5-based crypt</entry> </row> <row> *************** hmac(data bytea, key text, type text) re *** 165,170 **** --- 168,174 ---- <entry>8</entry> <entry>yes</entry> <entry>24</entry> + <entry>20</entry> <entry>Extended DES</entry> </row> <row> *************** hmac(data bytea, key text, type text) re *** 172,177 **** --- 176,182 ---- <entry>8</entry> <entry>no</entry> <entry>12</entry> + <entry>13</entry> <entry>Original UNIX crypt</entry> </row> </tbody> *************** UPDATE ... SET pswhash = crypt('new pass *** 205,211 **** <para> Example of authentication: <programlisting> ! SELECT pswhash = crypt('entered password', pswhash) FROM ... ; </programlisting> This returns <literal>true</> if the entered password is correct. </para> --- 210,216 ---- <para> Example of authentication: <programlisting> ! SELECT (pswhash = crypt('entered password', pswhash)) AS pswmatch FROM ... ; </programlisting> This returns <literal>true</> if the entered password is correct. </para> *************** gen_salt(type text [, iter_count integer *** 353,359 **** <entry>12 years</entry> </row> <row> ! <entry><literal>md5</></entry> <entry>2345086</entry> <entry>1 day</entry> <entry>3 years</entry> --- 358,364 ---- <entry>12 years</entry> </row> <row> ! <entry><literal>md5 hash</></entry> <entry>2345086</entry> <entry>1 day</entry> <entry>3 years</entry> *************** gen_salt(type text [, iter_count integer *** 380,386 **** </listitem> <listitem> <para> ! <literal>md5</> numbers are from mdcrack 1.2. </para> </listitem> <listitem> --- 385,391 ---- </listitem> <listitem> <para> ! <literal>md5 hash</> numbers are from mdcrack 1.2. </para> </listitem> <listitem> *************** gen_random_bytes(count integer) returns *** 1343,1349 **** <entry>OpenBSD sys/crypto</entry> </row> <row> ! <entry>MD5 and SHA1</entry> <entry>WIDE Project</entry> <entry>KAME kame/sys/crypto</entry> </row> --- 1348,1354 ---- <entry>OpenBSD sys/crypto</entry> </row> <row> ! <entry>MD5 hash and SHA1</entry> <entry>WIDE Project</entry> <entry>KAME kame/sys/crypto</entry> </row>
^ permalink raw reply [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-10-08 16:26  Bruce Momjian <bruce@momjian.us>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 0 replies; 12+ messages in thread

From: Bruce Momjian @ 2013-10-08 16:26 UTC (permalink / raw)
  To: Richard Neill <rn214@richardneill.org>; +Cc: Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Wed, Oct  2, 2013 at 12:00:44PM -0400, Bruce Momjian wrote:
> Based on your report, I have developed the attached doc patch which
> clarifies when MD5 hash is being referenced, and when MD5 crypt is.  I
> have also added your other suggestions.

Patch applied, and backpatched to 9.3.X.  Thanks for the suggestions.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-10-10 20:05  Peter Eisentraut <peter_e@gmx.net>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 1 reply; 12+ messages in thread

From: Peter Eisentraut @ 2013-10-10 20:05 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Richard Neill <rn214@richardneill.org>; Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

The changes shown below are incorrect, I think.


On 10/2/13 12:00 PM, Bruce Momjian wrote:
> *************** gen_salt(type text [, iter_count integer
> *** 353,359 ****
>          <entry>12 years</entry>
>         </row>
>         <row>
> !        <entry><literal>md5</></entry>
>          <entry>2345086</entry>
>          <entry>1 day</entry>
>          <entry>3 years</entry>
> --- 358,364 ----
>          <entry>12 years</entry>
>         </row>
>         <row>
> !        <entry><literal>md5 hash</></entry>
>          <entry>2345086</entry>
>          <entry>1 day</entry>
>          <entry>3 years</entry>
> *************** gen_salt(type text [, iter_count integer
> *** 380,386 ****
>       </listitem>
>       <listitem>
>        <para>
> !       <literal>md5</> numbers are from mdcrack 1.2.
>        </para>
>       </listitem>
>       <listitem>
> --- 385,391 ----
>       </listitem>
>       <listitem>
>        <para>
> !       <literal>md5 hash</> numbers are from mdcrack 1.2.
>        </para>
>       </listitem>
>       <listitem>
> *************** gen_random_bytes(count integer) returns
> *** 1343,1349 ****
>         <entry>OpenBSD sys/crypto</entry>
>        </row>
>        <row>
> !       <entry>MD5 and SHA1</entry>
>         <entry>WIDE Project</entry>
>         <entry>KAME kame/sys/crypto</entry>
>        </row>
> --- 1348,1354 ----
>         <entry>OpenBSD sys/crypto</entry>
>        </row>
>        <row>
> !       <entry>MD5 hash and SHA1</entry>
>         <entry>WIDE Project</entry>
>         <entry>KAME kame/sys/crypto</entry>
>        </row>



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-10-10 23:14  Bruce Momjian <bruce@momjian.us>
  parent: Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2013-10-10 23:14 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Richard Neill <rn214@richardneill.org>; Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Thu, Oct 10, 2013 at 04:05:50PM -0400, Peter Eisentraut wrote:
> The changes shown below are incorrect, I think.
> 
> 
> On 10/2/13 12:00 PM, Bruce Momjian wrote:
> > *************** gen_salt(type text [, iter_count integer
> > *** 353,359 ****
> >          <entry>12 years</entry>
> >         </row>
> >         <row>
> > !        <entry><literal>md5</></entry>
> >          <entry>2345086</entry>
> >          <entry>1 day</entry>
> >          <entry>3 years</entry>
> > --- 358,364 ----
> >          <entry>12 years</entry>
> >         </row>
> >         <row>
> > !        <entry><literal>md5 hash</></entry>

Uh, the table already has a mention of md5 crypt above:

       <entry><literal>crypt-md5</></entry>

How can the later entry not be MD5 hash?

> >          <entry>2345086</entry>
> >          <entry>1 day</entry>
> >          <entry>3 years</entry>
> > *************** gen_salt(type text [, iter_count integer
> > *** 380,386 ****
> >       </listitem>
> >       <listitem>
> >        <para>
> > !       <literal>md5</> numbers are from mdcrack 1.2.
> >        </para>
> >       </listitem>
> >       <listitem>
> > --- 385,391 ----
> >       </listitem>
> >       <listitem>
> >        <para>
> > !       <literal>md5 hash</> numbers are from mdcrack 1.2.
> >        </para>
> >       </listitem>
> >       <listitem>
> > *************** gen_random_bytes(count integer) returns
> > *** 1343,1349 ****
> >         <entry>OpenBSD sys/crypto</entry>
> >        </row>
> >        <row>
> > !       <entry>MD5 and SHA1</entry>
> >         <entry>WIDE Project</entry>
> >         <entry>KAME kame/sys/crypto</entry>
> >        </row>
> > --- 1348,1354 ----
> >         <entry>OpenBSD sys/crypto</entry>
> >        </row>
> >        <row>
> > !       <entry>MD5 hash and SHA1</entry>
> >         <entry>WIDE Project</entry>
> >         <entry>KAME kame/sys/crypto</entry>
> >        </row>
> 

Again, "MD5 crypt" is mentioned in the same table above:

      <entry>MD5 crypt</entry>

so how can this not be md5 hash?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-10-11 00:22  Peter Eisentraut <peter_e@gmx.net>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Peter Eisentraut @ 2013-10-11 00:22 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Richard Neill <rn214@richardneill.org>; Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Thu, 2013-10-10 at 19:14 -0400, Bruce Momjian wrote:
> > The changes shown below are incorrect, I think.
> > 
> > 
> > On 10/2/13 12:00 PM, Bruce Momjian wrote:
> > > *************** gen_salt(type text [, iter_count integer
> > > *** 353,359 ****
> > >          <entry>12 years</entry>
> > >         </row>
> > >         <row>
> > > !        <entry><literal>md5</></entry>
> > >          <entry>2345086</entry>
> > >          <entry>1 day</entry>
> > >          <entry>3 years</entry>
> > > --- 358,364 ----
> > >          <entry>12 years</entry>
> > >         </row>
> > >         <row>
> > > !        <entry><literal>md5 hash</></entry>
> 
> Uh, the table already has a mention of md5 crypt above:
> 
>        <entry><literal>crypt-md5</></entry>
> 
> How can the later entry not be MD5 hash? 

Because what you pass to the functions is 'md5', not 'md5 hash', which
is what the new text appears to indicate.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-10-11 00:32  Bruce Momjian <bruce@momjian.us>
  parent: Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2013-10-11 00:32 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Richard Neill <rn214@richardneill.org>; Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Thu, Oct 10, 2013 at 08:22:30PM -0400, Peter Eisentraut wrote:
> On Thu, 2013-10-10 at 19:14 -0400, Bruce Momjian wrote:
> > > The changes shown below are incorrect, I think.
> > > 
> > > 
> > > On 10/2/13 12:00 PM, Bruce Momjian wrote:
> > > > *************** gen_salt(type text [, iter_count integer
> > > > *** 353,359 ****
> > > >          <entry>12 years</entry>
> > > >         </row>
> > > >         <row>
> > > > !        <entry><literal>md5</></entry>
> > > >          <entry>2345086</entry>
> > > >          <entry>1 day</entry>
> > > >          <entry>3 years</entry>
> > > > --- 358,364 ----
> > > >          <entry>12 years</entry>
> > > >         </row>
> > > >         <row>
> > > > !        <entry><literal>md5 hash</></entry>
> > 
> > Uh, the table already has a mention of md5 crypt above:
> > 
> >        <entry><literal>crypt-md5</></entry>
> > 
> > How can the later entry not be MD5 hash? 
> 
> Because what you pass to the functions is 'md5', not 'md5 hash', which
> is what the new text appears to indicate.

So if we revert, will it still be clear what is MD5 and what is MD5 hash?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2013-10-11 00:42  Bruce Momjian <bruce@momjian.us>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2013-10-11 00:42 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Richard Neill <rn214@richardneill.org>; Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Thu, Oct 10, 2013 at 08:32:32PM -0400, Bruce Momjian wrote:
> > > How can the later entry not be MD5 hash? 
> > 
> > Because what you pass to the functions is 'md5', not 'md5 hash', which
> > is what the new text appears to indicate.
> 
> So if we revert, will it still be clear what is MD5 and what is MD5 hash?

I mean, will it be clear what is MD5 crypt and what is MD5 hash?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2014-02-13 20:39  Bruce Momjian <bruce@momjian.us>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2014-02-13 20:39 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Richard Neill <rn214@richardneill.org>; Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Thu, Oct 10, 2013 at 08:42:14PM -0400, Bruce Momjian wrote:
> On Thu, Oct 10, 2013 at 08:32:32PM -0400, Bruce Momjian wrote:
> > > > How can the later entry not be MD5 hash? 
> > > 
> > > Because what you pass to the functions is 'md5', not 'md5 hash', which
> > > is what the new text appears to indicate.
> > 
> > So if we revert, will it still be clear what is MD5 and what is MD5 hash?
> 
> I mean, will it be clear what is MD5 crypt and what is MD5 hash?

I have made the attached doc change, which places "(hash)" outside of
the literal text block.  You are right the literal blocks should match
what is passed.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

md5.diff (text/x-diff, 677B) download diff --git a/doc/src/sgml/pgcrypto.sgml b/doc/src/sgml/pgcrypto.sgml new file mode 100644 index 31dba8c..2446879 *** a/doc/src/sgml/pgcrypto.sgml --- b/doc/src/sgml/pgcrypto.sgml *************** gen_salt(type text [, iter_count integer *** 366,372 **** <entry>4</entry> </row> <row> ! <entry><literal>md5 hash</></entry> <entry>150085504</entry> <entry>22.5 minutes</entry> <entry>17 days</entry> --- 366,372 ---- <entry>4</entry> </row> <row> ! <entry><literal>md5</> (hash)</entry> <entry>150085504</entry> <entry>22.5 minutes</entry> <entry>17 days</entry>
^ permalink raw reply [nested|flat] 12+ messages in thread

* Re: BUG #8467: Slightly confusing pgcrypto example in docs
@ 2014-03-20 01:41  Peter Eisentraut <peter_e@gmx.net>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Peter Eisentraut @ 2014-03-20 01:41 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Richard Neill <rn214@richardneill.org>; Magnus Hagander <magnus@hagander.net>; postgresql@richardneill.org; pgsql-bugs

On Thu, 2014-02-13 at 15:39 -0500, Bruce Momjian wrote:
> On Thu, Oct 10, 2013 at 08:42:14PM -0400, Bruce Momjian wrote:
> > On Thu, Oct 10, 2013 at 08:32:32PM -0400, Bruce Momjian wrote:
> > > > > How can the later entry not be MD5 hash? 
> > > > 
> > > > Because what you pass to the functions is 'md5', not 'md5 hash', which
> > > > is what the new text appears to indicate.
> > > 
> > > So if we revert, will it still be clear what is MD5 and what is MD5 hash?
> > 
> > I mean, will it be clear what is MD5 crypt and what is MD5 hash?
> 
> I have made the attached doc change, which places "(hash)" outside of
> the literal text block.  You are right the literal blocks should match
> what is passed.

I think this entire line of patches should be reverted from the 9.3
branch, because it's not a bug fix, and arguably makes no sense.

I also think that these patches should be reverted from the master
branch, because they make no sense and don't actually address the bug
report.  Adding an output length column might make sense as an
independent patch.




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 12+ messages in thread


end of thread, other threads:[~2014-03-20 01:41 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-09-23 23:11 BUG #8467: Slightly confusing pgcrypto example in docs postgresql@richardneill.org
2013-09-24 17:31 ` Magnus Hagander <magnus@hagander.net>
2013-09-24 22:20   ` Richard Neill <rn214@richardneill.org>
2013-10-02 16:00     ` Bruce Momjian <bruce@momjian.us>
2013-10-08 16:26       ` Bruce Momjian <bruce@momjian.us>
2013-10-10 20:05       ` Peter Eisentraut <peter_e@gmx.net>
2013-10-10 23:14         ` Bruce Momjian <bruce@momjian.us>
2013-10-11 00:22           ` Peter Eisentraut <peter_e@gmx.net>
2013-10-11 00:32             ` Bruce Momjian <bruce@momjian.us>
2013-10-11 00:42               ` Bruce Momjian <bruce@momjian.us>
2014-02-13 20:39                 ` Bruce Momjian <bruce@momjian.us>
2014-03-20 01:41                   ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox