On Wed, Aug 14, 2002 at 01:53:29PM +0100, Ben Laurie wrote:

>> The consistency checks don't detect that memory *has* been corrupted.
>> They detect that memory *would* be corrupted if the library simply
>> continued to do what it is doing.  But if we return an internal error,
>> this does not actually happen.

> Not so - they detect that an "impossible" condition has occurred, so we 
> do not know whether corruption (or other nastiness) has already occurred 
> or not.

Yes, but if you look at the tests, it is quite obvious that the
typical reason for something "impossible" happening is that a buffer
is too small for its purpose, and that it is quite unlikely that
memory has already been corrupted before the consistency check (and,
thanks to the consistency check, memory won't be corrupted at all).
Just look at your patch, these are the first checks that you added:

+       die(s->s2->conn_id_length <= sizeof s->s2->conn_id);
        memcpy(s->s2->conn_id,p,s->s2->tmp.conn_id_length);

+               die(i <= SSL_MAX_KEY_ARG_LENGTH);
                if (i > 0) RAND_pseudo_bytes(sess->key_arg,i);

+                       die(i <= sizeof sess->master_key);
                        if (RAND_bytes(sess->master_key,i) <= 0)

+               die(karg <= sizeof sess->key_arg);
                memcpy(d,sess->key_arg,(unsigned int)karg);





-- 
Bodo Möller <[EMAIL PROTECTED]>
PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html
* TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt
* Tel. +49-6151-16-6628, Fax +49-6151-16-6036
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to