diff options
Diffstat (limited to 'src/lib/libcrypto/ocsp/ocsp_vfy.c')
-rw-r--r-- | src/lib/libcrypto/ocsp/ocsp_vfy.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_vfy.c b/src/lib/libcrypto/ocsp/ocsp_vfy.c index aede155871..5d8b2eebcf 100644 --- a/src/lib/libcrypto/ocsp/ocsp_vfy.c +++ b/src/lib/libcrypto/ocsp/ocsp_vfy.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * are met: | 10 | * are met: |
11 | * | 11 | * |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * | 14 | * |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in | 16 | * notice, this list of conditions and the following disclaimer in |
@@ -61,17 +61,17 @@ | |||
61 | #include <string.h> | 61 | #include <string.h> |
62 | 62 | ||
63 | static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs, | 63 | static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs, |
64 | STACK_OF(X509) *certs, X509_STORE *st, unsigned long flags); | 64 | STACK_OF(X509) *certs, X509_STORE *st, unsigned long flags); |
65 | static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id); | 65 | static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id); |
66 | static int ocsp_check_issuer(OCSP_BASICRESP *bs, STACK_OF(X509) *chain, | 66 | static int ocsp_check_issuer(OCSP_BASICRESP *bs, STACK_OF(X509) *chain, |
67 | unsigned long flags); | 67 | unsigned long flags); |
68 | static int ocsp_check_ids(STACK_OF(OCSP_SINGLERESP) *sresp, OCSP_CERTID **ret); | 68 | static int ocsp_check_ids(STACK_OF(OCSP_SINGLERESP) *sresp, OCSP_CERTID **ret); |
69 | static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid, | 69 | static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid, |
70 | STACK_OF(OCSP_SINGLERESP) *sresp); | 70 | STACK_OF(OCSP_SINGLERESP) *sresp); |
71 | static int ocsp_check_delegated(X509 *x, int flags); | 71 | static int ocsp_check_delegated(X509 *x, int flags); |
72 | static int ocsp_req_find_signer(X509 **psigner, OCSP_REQUEST *req, | 72 | static int ocsp_req_find_signer(X509 **psigner, OCSP_REQUEST *req, |
73 | X509_NAME *nm, STACK_OF(X509) *certs, X509_STORE *st, | 73 | X509_NAME *nm, STACK_OF(X509) *certs, X509_STORE *st, |
74 | unsigned long flags); | 74 | unsigned long flags); |
75 | 75 | ||
76 | /* Verify a basic response message */ | 76 | /* Verify a basic response message */ |
77 | int | 77 | int |
@@ -108,14 +108,14 @@ OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, X509_STORE *st, | |||
108 | if (!(flags & OCSP_NOVERIFY)) { | 108 | if (!(flags & OCSP_NOVERIFY)) { |
109 | int init_res; | 109 | int init_res; |
110 | 110 | ||
111 | if(flags & OCSP_NOCHAIN) | 111 | if (flags & OCSP_NOCHAIN) |
112 | init_res = X509_STORE_CTX_init(&ctx, st, signer, NULL); | 112 | init_res = X509_STORE_CTX_init(&ctx, st, signer, NULL); |
113 | else | 113 | else |
114 | init_res = X509_STORE_CTX_init(&ctx, st, signer, | 114 | init_res = X509_STORE_CTX_init(&ctx, st, signer, |
115 | bs->certs); | 115 | bs->certs); |
116 | if (!init_res) { | 116 | if (!init_res) { |
117 | ret = -1; | 117 | ret = -1; |
118 | OCSPerr(OCSP_F_OCSP_BASIC_VERIFY,ERR_R_X509_LIB); | 118 | OCSPerr(OCSP_F_OCSP_BASIC_VERIFY, ERR_R_X509_LIB); |
119 | goto end; | 119 | goto end; |
120 | } | 120 | } |
121 | 121 | ||
@@ -131,7 +131,7 @@ OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, X509_STORE *st, | |||
131 | X509_verify_cert_error_string(i)); | 131 | X509_verify_cert_error_string(i)); |
132 | goto end; | 132 | goto end; |
133 | } | 133 | } |
134 | if(flags & OCSP_NOCHECKS) { | 134 | if (flags & OCSP_NOCHECKS) { |
135 | ret = 1; | 135 | ret = 1; |
136 | goto end; | 136 | goto end; |
137 | } | 137 | } |
@@ -152,7 +152,7 @@ OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, X509_STORE *st, | |||
152 | 152 | ||
153 | x = sk_X509_value(chain, sk_X509_num(chain) - 1); | 153 | x = sk_X509_value(chain, sk_X509_num(chain) - 1); |
154 | if (X509_check_trust(x, NID_OCSP_sign, 0) != | 154 | if (X509_check_trust(x, NID_OCSP_sign, 0) != |
155 | X509_TRUST_TRUSTED) { | 155 | X509_TRUST_TRUSTED) { |
156 | OCSPerr(OCSP_F_OCSP_BASIC_VERIFY, | 156 | OCSPerr(OCSP_F_OCSP_BASIC_VERIFY, |
157 | OCSP_R_ROOT_CA_NOT_TRUSTED); | 157 | OCSP_R_ROOT_CA_NOT_TRUSTED); |
158 | goto end; | 158 | goto end; |
@@ -411,7 +411,7 @@ OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, | |||
411 | init_res = X509_STORE_CTX_init(&ctx, store, signer, | 411 | init_res = X509_STORE_CTX_init(&ctx, store, signer, |
412 | req->optionalSignature->certs); | 412 | req->optionalSignature->certs); |
413 | if (!init_res) { | 413 | if (!init_res) { |
414 | OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY,ERR_R_X509_LIB); | 414 | OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, ERR_R_X509_LIB); |
415 | return 0; | 415 | return 0; |
416 | } | 416 | } |
417 | 417 | ||
@@ -420,7 +420,7 @@ OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, X509_STORE *store, | |||
420 | ret = X509_verify_cert(&ctx); | 420 | ret = X509_verify_cert(&ctx); |
421 | X509_STORE_CTX_cleanup(&ctx); | 421 | X509_STORE_CTX_cleanup(&ctx); |
422 | if (ret <= 0) { | 422 | if (ret <= 0) { |
423 | ret = X509_STORE_CTX_get_error(&ctx); | 423 | ret = X509_STORE_CTX_get_error(&ctx); |
424 | OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, | 424 | OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, |
425 | OCSP_R_CERTIFICATE_VERIFY_ERROR); | 425 | OCSP_R_CERTIFICATE_VERIFY_ERROR); |
426 | ERR_asprintf_error_data("Verify error:%s", | 426 | ERR_asprintf_error_data("Verify error:%s", |