OLD | NEW |
1 /* ocsp_cl.c */ | 1 /* ocsp_cl.c */ |
2 /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL | 2 /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL |
3 * project. */ | 3 * project. */ |
4 | 4 |
5 /* History: | 5 /* History: |
6 This file was transfered to Richard Levitte from CertCo by Kathy | 6 This file was transfered to Richard Levitte from CertCo by Kathy |
7 Weinhold in mid-spring 2000 to be included in OpenSSL or released | 7 Weinhold in mid-spring 2000 to be included in OpenSSL or released |
8 as a patch kit. */ | 8 as a patch kit. */ |
9 | 9 |
10 /* ==================================================================== | 10 /* ==================================================================== |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 unsigned long flags) | 148 unsigned long flags) |
149 { | 149 { |
150 int i; | 150 int i; |
151 OCSP_SIGNATURE *sig; | 151 OCSP_SIGNATURE *sig; |
152 X509 *x; | 152 X509 *x; |
153 | 153 |
154 if (!OCSP_request_set1_name(req, X509_get_subject_name(signer))) | 154 if (!OCSP_request_set1_name(req, X509_get_subject_name(signer))) |
155 goto err; | 155 goto err; |
156 | 156 |
157 if (!(req->optionalSignature = sig = OCSP_SIGNATURE_new())) goto err; | 157 if (!(req->optionalSignature = sig = OCSP_SIGNATURE_new())) goto err; |
158 if (!dgst) dgst = EVP_sha1(); | |
159 if (key) | 158 if (key) |
160 { | 159 { |
161 if (!X509_check_private_key(signer, key)) | 160 if (!X509_check_private_key(signer, key)) |
162 { | 161 { |
163 OCSPerr(OCSP_F_OCSP_REQUEST_SIGN, OCSP_R_PRIVATE_KEY_DOE
S_NOT_MATCH_CERTIFICATE); | 162 OCSPerr(OCSP_F_OCSP_REQUEST_SIGN, OCSP_R_PRIVATE_KEY_DOE
S_NOT_MATCH_CERTIFICATE); |
164 goto err; | 163 goto err; |
165 } | 164 } |
166 if (!OCSP_REQUEST_sign(req, key, dgst)) goto err; | 165 if (!OCSP_REQUEST_sign(req, key, dgst)) goto err; |
167 } | 166 } |
168 | 167 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 362 |
364 /* Also don't allow nextUpdate to precede thisUpdate */ | 363 /* Also don't allow nextUpdate to precede thisUpdate */ |
365 if (ASN1_STRING_cmp(nextupd, thisupd) < 0) | 364 if (ASN1_STRING_cmp(nextupd, thisupd) < 0) |
366 { | 365 { |
367 OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, OCSP_R_NEXTUPDATE_BEFORE_THI
SUPDATE); | 366 OCSPerr(OCSP_F_OCSP_CHECK_VALIDITY, OCSP_R_NEXTUPDATE_BEFORE_THI
SUPDATE); |
368 ret = 0; | 367 ret = 0; |
369 } | 368 } |
370 | 369 |
371 return ret; | 370 return ret; |
372 } | 371 } |
OLD | NEW |