-----BEGIN PGP SIGNED MESSAGE-----
On 09/06/2010 09:10 AM, Jakub Hrozek wrote:
On 09/03/2010 08:16 PM, Stephen Gallagher wrote:
>>>> [PATCH 3/7] Password obfuscation utility functions
>>> Your b64_encode function declaration is confusing. Please change the
>>> variable name "obufsize" to make it clear that it is the size of
>>> input buffer to the function, not the output size.
> You changed the wrong variable name. The ofbufsize argument is
> describing the size of the input buffer, not the size of the output
> buffer (which is allocated internally by BTOA_DataToAscii)
Ah, OK, I though you were referring to the buffer name as to indicate
whether the conversion is done in-place or not, I though that the size
variable was clear since its pass-by-value. Anyway, changed, hopefully
the declaration looks clear now.
>>> We probably want to include a NULL byte (or some other, more-complicated
>>> terminator like "\0\1\2\3") at the end of the buffer that we can
>>> before blindly reading memory in. This way we can tell if we have a
>>> corrupted or simply wrong obfuscated password.
> A good start, but I think you missed the point a little bit.
I did :-)
> I want us
> to read up to ctsize, then test that the four bytes p+ctsize are the
> This way if the buffer is corrupt or malicious (e.g. the ctsize ==
> MAX_UINT16) we aren't suddenly allocating and copying 64MB of data.
Agreed, this is better, fixed now.
Sorry, I noticed two more things (warnings from gcc):
In file included from /home/bos/sgallagh/workspace/sssd/src/util/util.h:38,
./config.h:91:1: warning: "HAVE_LONG_LONG" redefined
In file included from /usr/include/nspr4/prtypes.h:58,
/usr/include/nspr4/prcpucfg.h:807:1: warning: this is the location of
the previous definition
In function ‘sss_password_encrypt’:
warning: cast discards qualifiers from pointer target type
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----