| 148 | } |
| 149 | |
| 150 | static apr_status_t mk_pubcert(void *baton, apr_pool_t *p, apr_pool_t *ptemp, |
| 151 | const char *dir, const char *name, |
| 152 | apr_filetype_e ftype) |
| 153 | { |
| 154 | md_cert_t *cert; |
| 155 | apr_array_header_t *chain, *pubcert; |
| 156 | const char *fname, *fpubcert; |
| 157 | apr_status_t rv = APR_SUCCESS; |
| 158 | |
| 159 | (void)baton; |
| 160 | (void)ftype; |
| 161 | (void)p; |
| 162 | if ( MD_OK(md_util_path_merge(&fpubcert, ptemp, dir, MD_FN_PUBCERT, NULL)) |
| 163 | && APR_STATUS_IS_ENOENT(rv = md_chain_fload(&pubcert, ptemp, fpubcert)) |
| 164 | && MD_OK(md_util_path_merge(&fname, ptemp, dir, name, NULL)) |
| 165 | && MD_OK(md_cert_fload(&cert, ptemp, fname)) |
| 166 | && MD_OK(md_util_path_merge(&fname, ptemp, dir, "chain.pem", NULL))) { |
| 167 | |
| 168 | rv = md_chain_fload(&chain, ptemp, fname); |
| 169 | if (APR_STATUS_IS_ENOENT(rv)) { |
| 170 | chain = apr_array_make(ptemp, 1, sizeof(md_cert_t*)); |
| 171 | rv = APR_SUCCESS; |
| 172 | } |
| 173 | if (APR_SUCCESS == rv) { |
| 174 | pubcert = apr_array_make(ptemp, chain->nelts + 1, sizeof(md_cert_t*)); |
| 175 | APR_ARRAY_PUSH(pubcert, md_cert_t *) = cert; |
| 176 | apr_array_cat(pubcert, chain); |
| 177 | rv = md_chain_fsave(pubcert, ptemp, fpubcert, MD_FPROT_F_UONLY); |
| 178 | } |
| 179 | } |
| 180 | return rv; |
| 181 | } |
| 182 | |
| 183 | static apr_status_t upgrade_from_1_0(md_store_fs_t *s_fs, apr_pool_t *p, apr_pool_t *ptemp) |
| 184 | { |
nothing calls this directly
no test coverage detected