Apache HTTPD
Classes | Macros | Functions | Variables
md_core.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <apr_lib.h>
#include <apr_strings.h>
#include <apr_uri.h>
#include <apr_tables.h>
#include <apr_time.h>
#include <apr_date.h>
#include "md_json.h"
#include "md.h"
#include "md_crypt.h"
#include "md_log.h"
#include "md_store.h"
#include "md_util.h"

Go to the source code of this file.

Classes

struct  md_ca_t
 

Macros

#define LE_ACMEv2_PROD   "https://acme-v02.api.letsencrypt.org/directory"
 
#define LE_ACMEv2_STAGING   "https://acme-staging-v02.api.letsencrypt.org/directory"
 
#define BUYPASS_ACME   "https://api.buypass.com/acme/directory"
 
#define BUYPASS_ACME_TEST   "https://api.test4.buypass.no/acme/directory"
 

Functions

int md_contains (const md_t *md, const char *domain, int case_sensitive)
 
const charmd_common_name (const md_t *md1, const md_t *md2)
 
int md_domains_overlap (const md_t *md1, const md_t *md2)
 
apr_size_t md_common_name_count (const md_t *md1, const md_t *md2)
 
int md_is_covered_by_alt_names (const md_t *md, const struct apr_array_header_t *alt_names)
 
md_tmd_create_empty (apr_pool_t *p)
 
int md_equal_domains (const md_t *md1, const md_t *md2, int case_sensitive)
 
int md_contains_domains (const md_t *md1, const md_t *md2)
 
md_tmd_get_by_name (struct apr_array_header_t *mds, const char *name)
 
md_tmd_get_by_domain (struct apr_array_header_t *mds, const char *domain)
 
md_tmd_get_by_dns_overlap (struct apr_array_header_t *mds, const md_t *md)
 
int md_cert_count (const md_t *md)
 
md_tmd_create (apr_pool_t *p, apr_array_header_t *domains)
 
md_tmd_copy (apr_pool_t *p, const md_t *src)
 
md_tmd_clone (apr_pool_t *p, const md_t *src)
 
md_json_tmd_to_json (const md_t *md, apr_pool_t *p)
 
md_tmd_from_json (md_json_t *json, apr_pool_t *p)
 
md_json_tmd_to_public_json (const md_t *md, apr_pool_t *p)
 
const charmd_get_ca_name_from_url (apr_pool_t *p, const char *url)
 
apr_status_t md_get_ca_url_from_name (const char **purl, apr_pool_t *p, const char *name)
 

Variables

static md_ca_t KNOWN_CAs []
 

Macro Definition Documentation

◆ BUYPASS_ACME

#define BUYPASS_ACME   "https://api.buypass.com/acme/directory"

Definition at line 407 of file md_core.c.

◆ BUYPASS_ACME_TEST

#define BUYPASS_ACME_TEST   "https://api.test4.buypass.no/acme/directory"

Definition at line 408 of file md_core.c.

◆ LE_ACMEv2_PROD

#define LE_ACMEv2_PROD   "https://acme-v02.api.letsencrypt.org/directory"

Definition at line 405 of file md_core.c.

◆ LE_ACMEv2_STAGING

#define LE_ACMEv2_STAGING   "https://acme-staging-v02.api.letsencrypt.org/directory"

Definition at line 406 of file md_core.c.

Function Documentation

◆ md_cert_count()

int md_cert_count ( const md_t md)

Definition at line 187 of file md_core.c.

◆ md_clone()

md_t * md_clone ( apr_pool_t p,
const md_t src 
)

Deep copy an md record into another pool.

Definition at line 228 of file md_core.c.

◆ md_common_name()

const char * md_common_name ( const md_t md1,
const md_t md2 
)

Get one common domain name of the two managed domains or NULL.

Definition at line 43 of file md_core.c.

◆ md_common_name_count()

apr_size_t md_common_name_count ( const md_t md1,
const md_t md2 
)

Get the number of common domains.

Definition at line 66 of file md_core.c.

◆ md_contains()

int md_contains ( const md_t md,
const char domain,
int  case_sensitive 
)

Determine if the Managed Domain contains a specific domain name.

Definition at line 35 of file md_core.c.

◆ md_contains_domains()

int md_contains_domains ( const md_t md1,
const md_t md2 
)

Determine if the domains in md1 contain all domains of md2.

Definition at line 136 of file md_core.c.

◆ md_copy()

md_t * md_copy ( apr_pool_t p,
const md_t src 
)

Shallow copy an md record into another pool.

Definition at line 210 of file md_core.c.

◆ md_create()

md_t * md_create ( apr_pool_t p,
struct apr_array_header_t domains 
)

Create a managed domain, given a list of domain names.

Definition at line 196 of file md_core.c.

◆ md_create_empty()

md_t * md_create_empty ( apr_pool_t p)

Create and empty md record, structures initialized.

Definition at line 103 of file md_core.c.

◆ md_domains_overlap()

int md_domains_overlap ( const md_t md1,
const md_t md2 
)

Determine if the names of the two managed domains overlap.

Definition at line 61 of file md_core.c.

◆ md_equal_domains()

int md_equal_domains ( const md_t md1,
const md_t md2,
int  case_sensitive 
)

Determine if the domain names are equal.

Definition at line 121 of file md_core.c.

◆ md_from_json()

md_t * md_from_json ( md_json_t json,
apr_pool_t p 
)

Definition at line 325 of file md_core.c.

◆ md_get_by_dns_overlap()

md_t * md_get_by_dns_overlap ( struct apr_array_header_t mds,
const md_t md 
)

Find a managed domain, different from the given one, that has overlaps in the domain list.

Definition at line 175 of file md_core.c.

◆ md_get_by_domain()

md_t * md_get_by_domain ( struct apr_array_header_t mds,
const char domain 
)

Look up a managed domain by a DNS name it contains.

Definition at line 163 of file md_core.c.

◆ md_get_by_name()

md_t * md_get_by_name ( struct apr_array_header_t mds,
const char name 
)

Look up a managed domain by its name.

Definition at line 151 of file md_core.c.

◆ md_get_ca_name_from_url()

const char * md_get_ca_name_from_url ( apr_pool_t p,
const char url 
)

Definition at line 417 of file md_core.c.

◆ md_get_ca_url_from_name()

apr_status_t md_get_ca_url_from_name ( const char **  purl,
apr_pool_t p,
const char name 
)

Definition at line 433 of file md_core.c.

◆ md_is_covered_by_alt_names()

int md_is_covered_by_alt_names ( const md_t md,
const struct apr_array_header_t alt_names 
)

Definition at line 86 of file md_core.c.

◆ md_to_json()

md_json_t * md_to_json ( const md_t md,
apr_pool_t p 
)

Convert the managed domain into a JSON representation and vice versa.

This reads and writes the following information: name, domains, ca_url, ca_proto and state.

Definition at line 268 of file md_core.c.

◆ md_to_public_json()

md_json_t * md_to_public_json ( const md_t md,
apr_pool_t p 
)

Same as md_to_json(), but with sensitive fields stripped.

Definition at line 391 of file md_core.c.

Variable Documentation

◆ KNOWN_CAs

md_ca_t KNOWN_CAs[]
static
Initial value:
= {
{ "LetsEncrypt", "https://acme-v02.api.letsencrypt.org/directory" },
{ "LetsEncrypt-Test", "https://acme-staging-v02.api.letsencrypt.org/directory" },
{ "Buypass", "https://api.buypass.com/acme/directory" },
{ "Buypass-Test", "https://api.test4.buypass.no/acme/directory" },
}

Definition at line 410 of file md_core.c.