??
> From: [email protected] On Behalf Of baccali
> Sent: Saturday, 03 July, 2010 12:06

> Hi all, sorry for my bad english i'm don't speak very well.
> 
> I subscribed here because i have a probably easy question for 
> you. All is in
> the title. The fact is the notion of keyUsage in signed 
> certficate is very
> hazy for me right now.
> 
> Someone told me its purpose is just to legally "protect" the 
> issuer but
> softwares can easilly overstep this statements. I mean there is no
> "physical" boundaries of what a sofware can do no matter what 
> statement is
> declared in the certificate. Is that right?
> 
Yes, any entity and especially program using a cert can choose how to 
implement KeyUsage, and also ExtendedKeyUsage, or to not implement at all. 
(I abbreviate these KU and EKU for brevity.)

In theory, the CA 'guarantees' the cert (i.e. that the key 
is appropriately bound to the subject for the validity period 
unless revoked) for only the purpose(s) stated and you're taking 
additional risk if you rely on it for an 'unauthorized' purpose. 
Actually public CAs don't provide real guarantees anyway. 

If some software (like an SSL server) offers a cert outside of 
its stated usage, it usually means either (1) the software 
has been written or is being run by people whose understanding 
of security is poor, and thus is significantly more likely 
to be insecure, so you probably don't want to trust it; or 
(2) the software or operators are working around a limitation 
of the CA(s) they use, and are *more* competent than average.
Unfortunately you can't distinguish these looking at the cert.

> Secondly i can't figure out what's the difference between 
> each option and
> when we use this and not this one. Can someone explain me 
> what's the purpose
> of each declaration.
> 
> >From what i've read right now (RFC and google), i think 
> there are some
> options wich include others. For example includes the keyencipherment
> statement am i wrong?
> 
> Let's imagin a software which scrupulously follow the 
> statements in the
> certificate about the key usage.
> 
> KeyEncipherment.
> 
> I presume this soft can encrypt a key but can't encrypt other 
> things than
> that, like the conversation itself or other things like the 
> digest messages
> in the handshake right?
> 
For that privilege alone, correct. KU is a BITSTRING, and 
can have more than one bit set; it's perfectly reasonable 
and common for a cert to have {KeyEncipherment,DigitalSignature} 
and that key(pair) can be used for both purposes.

> DigitalSignature.
> It can sign anything. Which i have understand "encipher" 
> anything. Include
> Key. But i must be wrong otherwise why should we declare the 
> keyencipherment
> statement in a server case? :confused:
> 
Signature is *not* encipherment. For *RSA* (NOT other algorithms) 
the underlying sign primitive is mathematically similar to the 
encipher primitive, but they are not the same as many people 
mistakenly believe, and in particular the signature and encipherment 
schemes built on these primitives are *not* interchangeable.

> KeyAgreement.
> I can't really understand what's is its purpose. Is this for 
> the SSL (RSA?)
> protocole? Because I IMAGINED that this is for the handshake of this
> protocole (or anything eslse which lead to this kind 
> of....... key agreement
> :-/. So if this is right this one include the keyencipherment and the
> digitalsignature (for the diggest).
> 
There is (as far as I know) no KeyAgreement algorithm/scheme for RSA. 
There is an important one for DH (Diffie-Hellman) and ECDH (the Elliptic 
Curve equivalent thereof). You should expect to see KE but not KA 
on a cert for an RSA key, and vice versa on a cert for a DH key. 

> KeyCertSign (wich include the keyencipherment only if i ain't wrong),
> nonRepudiation, EncipherOnly and DecipherOnly had been 
> successfully acquired
> i think. The remained(ing?) confusion comes from the three 
> statement quoted
> above.
> 
It doesn't 'include' or relate to KE at all. It is similar to DS, 
but was broken out separately because the use and security of CA keys 
was thought/expected to be more significant in terms of possible 
security impact than end-entity keys. Similarly for CRLSign. 
Formally this is almost redundant because basicConstraints also can 
specify whether the certified entity is a CA, and also should be 
critical. But that's the choice that the standard(izers) made.

> I would be very indebted to the one who can explain me those 
> notions. Even
> if it's a brief debbuging!! :wistle:
> 
> Since it's not a "physical" constraint every tests i can make 
> would not be
> revealing at all so everything i can learn from is reading 
> and i did'nt find
> sufficient explanations in the RFC.
> 
I believe OpenSSL does check KU on cert-chain verification, 
but I'd have to go through the code to be certain, and this is 
a <ahem> more confusing than usual </> part of the code. If so, 
you could test that. Assuming so, I'm not sure if it can be 
overridden by the verify_callback; you could investigate that.

If you write your own code, you can do whatever you choose, 
but in choosing you should bear in mind the reasons above.
If you are lucky enough to be relying on certs from a CA 
that actually stands behind them, you definitely should do so 
only to the extent they promise in their Practice Statement(s) 
or equivalent, which likely will be encoded in KU and/or EKU.



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to