21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

of tunable variables that affect the verification process are supported, so we have created<br />

a data structure to hold this information:<br />

#include <br />

#include <br />

typedef struct {<br />

char *url;<br />

X509 *cert;<br />

X509 *issuer;<br />

spc_x509store_t *store;<br />

X509 *sign_cert;<br />

EVP_PKEY *sign_key;<br />

long skew;<br />

long maxage;<br />

} spc_ocsprequest_t;<br />

The fields in this structure are as follows:<br />

url<br />

Address of the OCSP responder to which to connect; this should always be a<br />

URLthat specifies either HTTP or HTTPS as the service. For example, Veri-<br />

Sign’s OCSP responder address is http://ocsp.verisign.com.<br />

cert<br />

Pointer to the certificate whose revocation status you want to check. In many<br />

cases, this will likely come from the peer when establishing or renegotiating an<br />

SSL session.<br />

issuer<br />

Pointer to the certificate that issued the certificate whose revocation status you<br />

want to check. This should be a trusted root certificate.<br />

store<br />

Any information required for building an X509_STORE object internally. This<br />

object will be used for verifying the OCSP responder’s certificate. A full discussion<br />

of this object can be found in Recipe 10.5, but basically it contains trusted<br />

certificates and CRLs that OpenSSL can use to verify the validity of the certificate<br />

received from the OCSP responder.<br />

sign_cert<br />

An OCSP request can optionally be signed. Some servers require signed requests.<br />

Any server will accept a signed request provided that the server is able to verify<br />

the signature. If you want the request to be signed, this field should be non-NULL<br />

and should be a pointer to the certificate to use to sign the request. If you are<br />

going to sign your request, you should use a certificate that has been issued by a<br />

CA that is trusted by the OCSP responder so that the responder will be able to<br />

verify its validity.<br />

Checking Revocation Status via OCSP with OpenSSL | 563<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!