diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-01-13 01:48:38 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-01-13 01:48:38 +0000 |
commit | 5782ceb2983b9e998b858474224fc011d6f0bd39 (patch) | |
tree | 9a328e5752d5ed38f6698b67ceb054d1475aa62e /crypto/ocsp | |
parent | cc85ec447b65509070a50414664d62d397701df9 (diff) |
New OCSP utility. This can generate, parse and print
OCSP requests. It can also query reponders and parse or
print out responses.
Still needs some more work: OCSP response checks and
of course documentation.
Diffstat (limited to 'crypto/ocsp')
-rw-r--r-- | crypto/ocsp/ocsp.h | 1 | ||||
-rw-r--r-- | crypto/ocsp/ocsp_prn.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/crypto/ocsp/ocsp.h b/crypto/ocsp/ocsp.h index 1db672d08a..60b843a2fa 100644 --- a/crypto/ocsp/ocsp.h +++ b/crypto/ocsp/ocsp.h @@ -532,6 +532,7 @@ DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags); +int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags); int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, X509_STORE *st, unsigned long flags); diff --git a/crypto/ocsp/ocsp_prn.c b/crypto/ocsp/ocsp_prn.c index f949e4b8ae..fc63183517 100644 --- a/crypto/ocsp/ocsp_prn.c +++ b/crypto/ocsp/ocsp_prn.c @@ -180,7 +180,7 @@ err: int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags) { - int i; + int i, ret = 0; long l; unsigned char *p; OCSP_CERTID *cid = NULL; @@ -209,7 +209,7 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags) p = ASN1_STRING_data(rb->response); i = ASN1_STRING_length(rb->response); - if (!(d2i_OCSP_BASICRESP(&br, &p, i))) goto err; + if (!(br = OCSP_response_get1_basic(o))) goto err; rd = br->tbsResponseData; l=ASN1_INTEGER_get(rd->version); if (BIO_printf(bp,"\n Version: %lu (0x%lx)\n", @@ -283,7 +283,8 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags) PEM_write_bio_X509(bp,sk_X509_value(br->certs,i)); } - return 1; + ret = 1; err: - return 0; + OCSP_BASICRESP_free(br); + return ret; } |