21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ights of the entity tied to that certificate. Finally, check to make sure the certificate<br />

presented has not been compromised or otherwise revoked.<br />

Discussion<br />

The specifics of how to do certificate verification vary depending on the library you<br />

are using. However, the methodology remains much the same no matter which<br />

library you use. Most libraries perform basic certificate verification for you but leave<br />

you to perform identity checks, such as ensuring that a certificate presented by a<br />

server is actually appropriate for that server to be presenting.<br />

First, note that public key infrastructures tend to support “hierarchies” of certificates,<br />

although not all infrastructures do. That is, a root certificate from VeriSign<br />

might be used to sign a “signing” certificate at AT&T, which might then be used to<br />

sign individual certificates for AT&T employees. VeriSign may not sign the employee<br />

certificates directly, but we can establish a chain of trust, because the personal certificates<br />

are “trusted” by the AT&T signing certificate, and VeriSign trusts the AT&T<br />

signing certificate. There can be arbitrary levels of depth in a certificate hierarchy.<br />

For example, the AT&T company-wide signing certificate could be used to sign<br />

department-wide certificates, which may then sign individual certificates.<br />

Second, just because a CA signs a certificate does not necessarily mean that the certificate<br />

should be trusted by the entity that is presenting it. For example, suppose<br />

that you want to perform an electronic commerce transaction with Amazon. When<br />

an SSLconnection to Amazon’s server is established, the server presents a certificate.<br />

The first thing you do is check to see that there is a trusted path to a root CA that<br />

you trust. Suppose that the certificate presented to you is signed by VeriSign and has<br />

not expired. Does that mean the transaction should go forward? No! You have no<br />

idea whether the certificate that has been presented to you was issued to Amazon or<br />

not. For all you know, it could have been issued to Fred’s Mattress Warehouse or<br />

any other entity. If you get a certificate that is not from Amazon or its representative,<br />

it is probably an attacker’s certificate. Therefore, you need to verify the information<br />

in the certificate to make sure that it really should be trusted. Remember that the signature<br />

on the certificate proves that the data in the certificate has not been altered. A<br />

certificate issued to attacker.org cannot be modified to look like a certificate issued<br />

to Amazon because the signature verification would fail.<br />

Third, what happens if Amazon’s private key is stolen? They will create a new private<br />

key and get a new certificate issued that is bound to that new key, but what<br />

about the old key? An attacker could present the old certificate, and you wouldn’t be<br />

able to tell the difference between it and the new certificate until the old certificate<br />

expires.<br />

One solution to this problem is to use a certificate revocation list (CRL), a list of certificate<br />

serial numbers signed by the CA that represent invalid certificates. These lists<br />

Understanding X.509 Certificate Verification Methodology | 523<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!