Changeset bdd10be in mod_gnutls
- Timestamp:
- Jan 11, 2020, 10:40:01 AM (3 years ago)
- Branches:
- asyncio, main, master, proxy-ticket
- Children:
- e798149
- Parents:
- a8374f7
- git-author:
- Fiona Klute <fiona.klute@…> (01/11/20 10:24:59)
- git-committer:
- Fiona Klute <fiona.klute@…> (01/11/20 10:40:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_ocsp.c
ra8374f7 rbdd10be 150 150 * if not NULL). 151 151 * 152 * Returns GNUTLS_E_SUCCESS, or a GnuTLS error code. 152 * @param s server reference for logging 153 * 154 * @return GNUTLS_E_SUCCESS, or a GnuTLS error code. 153 155 */ 154 static int mgs_create_ocsp_request(server_rec *s, gnutls_datum_t *req, 155 gnutls_datum_t *nonce) 156 __attribute__((nonnull(1, 2))); 157 static int mgs_create_ocsp_request(server_rec *s, gnutls_datum_t *req, 158 gnutls_datum_t *nonce) 159 { 160 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) 161 ap_get_module_config(s->module_config, &gnutls_module); 162 156 static int mgs_create_ocsp_request(server_rec *s, 157 struct mgs_ocsp_data *req_data, 158 gnutls_datum_t *req, 159 gnutls_datum_t *nonce) 160 __attribute__((nonnull(1, 3))); 161 static int mgs_create_ocsp_request(server_rec *s, 162 struct mgs_ocsp_data *req_data, 163 gnutls_datum_t *req, 164 gnutls_datum_t *nonce) 165 { 163 166 gnutls_ocsp_req_t r; 164 167 int ret = gnutls_ocsp_req_init(&r); … … 171 174 } 172 175 176 /* issuer is set to a reference, so musn't be cleaned up */ 177 gnutls_x509_crt_t issuer; 178 ret = gnutls_x509_trust_list_get_issuer(*req_data->trust, req_data->cert, 179 &issuer, 0); 180 if (ret != GNUTLS_E_SUCCESS) 181 { 182 ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, 183 "Could not get issuer from trust list: %s (%d)", 184 gnutls_strerror(ret), ret); 185 gnutls_ocsp_req_deinit(r); 186 return ret; 187 } 188 173 189 /* GnuTLS doc says that the digest is "normally" 174 190 * GNUTLS_DIG_SHA1. */ 175 191 ret = gnutls_ocsp_req_add_cert(r, GNUTLS_DIG_SHA256, 176 sc->certs_x509_crt_chain[1], 177 sc->certs_x509_crt_chain[0]); 192 issuer, req_data->cert); 178 193 179 194 if (ret != GNUTLS_E_SUCCESS) … … 673 688 { 674 689 gnutls_datum_t req; 675 int ret = mgs_create_ocsp_request(s, &req, &nonce);690 int ret = mgs_create_ocsp_request(s, sc->ocsp, &req, &nonce); 676 691 if (ret == GNUTLS_E_SUCCESS) 677 692 {
Note: See TracChangeset
for help on using the changeset viewer.