summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ocsp/ocsp_srv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ocsp/ocsp_srv.c')
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_srv.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_srv.c b/src/lib/libcrypto/ocsp/ocsp_srv.c
index c14e8e2bc3..18c8f26852 100644
--- a/src/lib/libcrypto/ocsp/ocsp_srv.c
+++ b/src/lib/libcrypto/ocsp/ocsp_srv.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
@@ -131,6 +131,7 @@ OCSP_response_create(int status, OCSP_BASICRESP *bs)
131 &rsp->responseBytes->response)) 131 &rsp->responseBytes->response))
132 goto err; 132 goto err;
133 return rsp; 133 return rsp;
134
134err: 135err:
135 if (rsp) 136 if (rsp)
136 OCSP_RESPONSE_free(rsp); 137 OCSP_RESPONSE_free(rsp);
@@ -164,7 +165,7 @@ OCSP_basic_add1_status(OCSP_BASICRESP *rsp, OCSP_CERTID *cid, int status,
164 goto err; 165 goto err;
165 166
166 cs = single->certStatus; 167 cs = single->certStatus;
167 switch(cs->type = status) { 168 switch (cs->type = status) {
168 case V_OCSP_CERTSTATUS_REVOKED: 169 case V_OCSP_CERTSTATUS_REVOKED:
169 if (!revtime) { 170 if (!revtime) {
170 OCSPerr(OCSP_F_OCSP_BASIC_ADD1_STATUS, 171 OCSPerr(OCSP_F_OCSP_BASIC_ADD1_STATUS,
@@ -174,14 +175,14 @@ OCSP_basic_add1_status(OCSP_BASICRESP *rsp, OCSP_CERTID *cid, int status,
174 if (!(cs->value.revoked = ri = OCSP_REVOKEDINFO_new())) 175 if (!(cs->value.revoked = ri = OCSP_REVOKEDINFO_new()))
175 goto err; 176 goto err;
176 if (!ASN1_TIME_to_generalizedtime(revtime, &ri->revocationTime)) 177 if (!ASN1_TIME_to_generalizedtime(revtime, &ri->revocationTime))
177 goto err; 178 goto err;
178 if (reason != OCSP_REVOKED_STATUS_NOSTATUS) { 179 if (reason != OCSP_REVOKED_STATUS_NOSTATUS) {
179 if (!(ri->revocationReason = ASN1_ENUMERATED_new())) 180 if (!(ri->revocationReason = ASN1_ENUMERATED_new()))
180 goto err; 181 goto err;
181 if (!(ASN1_ENUMERATED_set(ri->revocationReason, 182 if (!(ASN1_ENUMERATED_set(ri->revocationReason,
182 reason))) 183 reason)))
183 goto err; 184 goto err;
184 } 185 }
185 break; 186 break;
186 187
187 case V_OCSP_CERTSTATUS_GOOD: 188 case V_OCSP_CERTSTATUS_GOOD:
@@ -198,6 +199,7 @@ OCSP_basic_add1_status(OCSP_BASICRESP *rsp, OCSP_CERTID *cid, int status,
198 if (!(sk_OCSP_SINGLERESP_push(rsp->tbsResponseData->responses, single))) 199 if (!(sk_OCSP_SINGLERESP_push(rsp->tbsResponseData->responses, single)))
199 goto err; 200 goto err;
200 return single; 201 return single;
202
201err: 203err:
202 OCSP_SINGLERESP_free(single); 204 OCSP_SINGLERESP_free(single);
203 return NULL; 205 return NULL;
@@ -268,6 +270,7 @@ OCSP_basic_sign(OCSP_BASICRESP *brsp, X509 *signer, EVP_PKEY *key,
268 goto err; 270 goto err;
269 271
270 return 1; 272 return 1;
273
271err: 274err:
272 return 0; 275 return 0;
273} 276}