Lines Matching defs:cert

55 	struct cert		*cert;
69 uripath_add(const char *uri, struct cert *cert)
77 up->cert = cert;
82 static struct cert *
91 return up->cert;
129 * Parse the cert pointed at by the AIA URI while doing that also load
130 * the CRL of this cert. While the CRL is validated the returned cert
134 static struct cert *
137 struct cert *cert = NULL;
156 cert = cert_parse_pre(uri, f, flen);
159 if (cert == NULL)
161 if (cert->purpose != CERT_PURPOSE_CA) {
163 purpose2str(cert->purpose), uri);
166 /* try to load the CRL of this cert */
167 parse_load_crl(cert->crl);
169 return cert;
172 cert_free(cert);
185 struct cert *stack[MAX_CERT_DEPTH] = { 0 };
187 struct cert *cert;
194 if ((cert = uripath_lookup(uri)) != NULL) {
195 a = auth_find(&auths, cert->certid);
203 stack[i] = cert = parse_load_cert(uri);
204 if (cert == NULL || cert->purpose != CERT_PURPOSE_CA) {
208 uri = cert->aia;
219 cert = stack[i - 1];
223 if (!valid_x509(uri, ctx, cert->x509, a, crl, &errstr) ||
224 !valid_cert(uri, a, cert)) {
229 cert->talid = a->cert->talid;
230 a = auth_insert(uri, &auths, cert, a);
231 uripath_add(uri, cert);
246 struct cert *cert;
265 cert = cert_parse_pre(file, f, flen);
266 cert = ta_parse(file, cert, tal->pkey, tal->pkeysz);
267 if (cert == NULL)
270 cert->talid = tal->id;
271 auth_insert(file, &auths, cert, NULL);
276 uripath_add(tal->uri[i], cert);
285 find_tal(struct cert *cert)
291 if ((opk = X509_get0_pubkey(cert->x509)) == NULL)
318 if (a != NULL && a->cert != NULL && a->cert->mft != NULL)
319 printf(" %s\n", a->cert->mft);
324 if (a->cert->crl != NULL)
325 printf(" %s\n", a->cert->crl);
326 if (a->issuer != NULL && a->issuer->cert != NULL &&
327 a->issuer->cert->mft != NULL)
329 a->issuer->cert->mft);
330 if (a->cert->aia != NULL)
331 printf(" %s\n", a->cert->aia);
344 struct cert *cert = NULL;
414 cert = cert_parse_pre(file, buf, len);
415 if (cert == NULL)
417 is_ta = (cert->purpose == CERT_PURPOSE_TA);
419 cert = cert_parse(file, cert);
420 if (cert == NULL)
422 aia = cert->aia;
423 x509 = cert->x509;
426 expires = &cert->expires;
427 notbefore = &cert->notbefore;
428 notafter = &cert->notafter;
536 if (status && cert == NULL) {
537 struct cert *eecert;
539 eecert = cert_parse_ee_cert(file, a->cert->talid, x509);
544 cert->talid = a->cert->talid;
545 constraints_validate(file, cert);
550 if ((tal = find_tal(cert)) != NULL) {
551 cert = ta_parse(file, cert, tal->pkey, tal->pkeysz);
552 status = (cert != NULL);
554 expires = &cert->expires;
555 notafter = &cert->notafter;
564 cert_free(cert);
565 cert = NULL;
579 cert_print(cert);
663 cert_free(cert);