On Mon, Feb 19, 2007 at 07:43:50PM +0100, Bodo Moeller wrote:
Thanks, a giant leap in the right direction! Nit-picking below:
> + /* Move anonymous ciphers to the end. Usually, these will remain
> disabled.
> + * (For applications that allow them, they aren't too bad, but we prefer
> + * authenticated ciphers.) */
> + ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1,
> &head, &tail);
This is not quite right IMHO. I think the anonymous ciphers MUST be
first, because:
1. Most applications use "DEFAULT" and don't see them at all.
2. Applications that want anonymous ciphers, typically don't disable
the non-anonymous ones for interoperability reasons, so won't get to
use them if they are not first.
3. Applications that are happy with anonymous ciphers don't check
certs, so there is no reason to prefer ciphers with with certs, which
just waste cycles.
If the anonymous ciphers are last, perhaps:
ALL+aNULL:ALL:@STRENGTH
produces the desired order for applications that don't check certs, but I
think it is cleaner to put the anonymous kEECDH and kEDH ciphers first,
they use the strongest key-exchange mechanisms available, and best meed
the authentication needs of apps that ignore authentication.
I also think that kEECDH should be sorted ahead of kEDH, within the class
of forward secrecy capable key-exchange mechanisms.
The current somewhat adhoc initial order could be replaced by sort()
(need not be stable for initial order) based on a systematic comparator:
int ciph_compare(c1, c2)
{
if ((ret = (strength_compare(strength(c1), strength(c2)))) != 0)
return ret;
if ((ret = (enc_compare(enc(c1), enc(c2)))) != 0)
return ret;
if ((ret = (kx_compare(kx(c1), kx(c2)))) != 0)
return ret;
if ((ret = (auth_compare(auth(c1), auth(c2)))) != 0)
return ret;
if ((ret = (mac_compare(mac(c1), mac(c2)))) != 0)
return ret;
if ((ret = (proto_compare(proto(c1), proto(c2)))) != 0)
return ret;
}
One then needs to decide how to separately rank the available ciphers,
key exchange mechanisms, ... and whether the above relative order of
comparisons (alg_bits, cipher, key-exchange, auth, mac, proto) is
the right one.
Regardless of the specific details, using a comparator makes the order
more systematic. One can still quible over whether anonymous auth beats
RSA auth, and I may not get my wish there, but I still think a sort based
based on a linear order should be considered. Perhaps this is impractical,
but it seems tempting to me...
--
/"\ ASCII RIBBON NOTICE: If received in error,
\ / CAMPAIGN Victor Duchovni please destroy and notify
X AGAINST IT Security, sender. Sender does not waive
/ \ HTML MAIL Morgan Stanley confidentiality or privilege,
and use is prohibited.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]