lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 2 Oct 2015 01:29:32 +0000
From: Peter Gutmann <pgut001@...auckland.ac.nz>
To: "discussions@...sword-hashing.net" <discussions@...sword-hashing.net>
Subject: RE: [PHC] Specification of a modular crypt format (2)

Alexander Cherepanov <ch3root@...nwall.com> writes:

>It's hard to guarantee it without seeing a full program but this
>multiplication very much looks like a signed integer overflow which is
>undefined behavior (UB).

It's checked a few lines down with 'value >= ( MAX_INTLENGTH / 10 )', where
'value' is the input to the multiply.  My programming style is to use consts
as much as possible, so I create the const where it has to be set at the start
and then check that it was OK before using it.

>The last check seems to be superfluous or at least ineffective.

Paranoid programming, check everything from five different directions if
possible.  It should actually be stated as an invariant:

  INVARIANT( value >= 0 && value <= MAX_INTLENGTH );

but that throws an exception which I don't want in this case.

Peter.

Powered by blists - more mailing lists