hash_password prints hash in wrong order

Bug #291999 reported by Alexey Torkhov
2
Affects Status Importance Assigned to Milestone
Cyphesis
Confirmed
Undecided
Al Riddoch

Bug Description

hash_password() swaps adjacent hex digits in hash.
For example, md5("abc") =
900150983CD24FB0D6963F7D28E17F72

while hash_password("abc") =
09100589C32DF40B6D69F3D7821EF727

It happens because this code is done in wrong order:
        hash.push_back(hex_table[buf[i] & 0xf]);
        hash.push_back(hex_table[(buf[i] & 0xf0) >> 4]);

Revision history for this message
Al Riddoch (alriddoch) wrote :

Tragically fixing this would break compatibility with earlier versions, and has no obvious advantage as with the existing code the function serves its purpose as a password hash even if it does not transform the data as one might expect from the stated algorithm.

I am going to hold off fixing until something else breaks the schema in such a way as I don't care about breaking compatibility.

Changed in cyphesis:
assignee: nobody → Al Riddoch (alriddoch)
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.