Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <51898453.5010704@mccme.ru>
Date: Wed, 08 May 2013 02:46:43 +0400
From: Alexander Cherepanov <cherepan@...me.ru>
To: john-dev@...ts.openwall.com
Subject: Constification and format interface clarification

Hi!

There are two somewhat interdependent problems/improvements.

1. Constification. IMHO it would be good to add a "const" qualifier to 
function parameters when they are pointers pointing to data which is not 
modified. It will guarantee that string literals are not modified, make 
the code more robust, perhaps permit more optimizations etc.

2. IMHO description of format interface is inadequate (or I don't know 
where to look for it). Take for example description of salt function in 
formats.h:

/* Converts an ASCII salt to its internal representation */
	void *(*salt)(char *ciphertext);

It's not clear whether this function can change *ciphertext (e.g. to 
decode in-place). Can it simply return ciphertext? Can it return an 
address of a static buffer? etc. The same with other functions to 
varying degree.

Adding "const" qualifiers is a one way to clarify the situation. But 
"const" qualifiers alone are not enough of course.

Not sure if it's good time to discuss or make these changes, we can put 
it off until after all realises. WDYT?

-- 
Alexander Cherepanov

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.