Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
md.h File Reference
#include "md_time.h"
#include "md_version.h"
Include dependency graph for md.h:

Go to the source code of this file.

Data Structures

struct  md_t
 
struct  md_pubcert_t
 

Macros

#define MD_PKEY_RSA_BITS_MIN   2048
 
#define MD_PKEY_RSA_BITS_DEF   2048
 
#define MD_HSTS_HEADER   "Strict-Transport-Security"
 
#define MD_HSTS_MAX_AGE_DEFAULT   15768000
 
#define PROTO_ACME_TLS_1   "acme-tls/1"
 
#define MD_TIME_LIFE_NORM   (apr_time_from_sec(100 * MD_SECS_PER_DAY))
 
#define MD_TIME_RENEW_WINDOW_DEF   (apr_time_from_sec(33 * MD_SECS_PER_DAY))
 
#define MD_TIME_WARN_WINDOW_DEF   (apr_time_from_sec(10 * MD_SECS_PER_DAY))
 
#define MD_TIME_OCSP_KEEP_NORM   (apr_time_from_sec(7 * MD_SECS_PER_DAY))
 
#define MD_OTHER   "other"
 
#define MD_KEY_ACCOUNT   "account"
 
#define MD_KEY_ACME_TLS_1   "acme-tls/1"
 
#define MD_KEY_ACTIVATION_DELAY   "activation-delay"
 
#define MD_KEY_ACTIVITY   "activity"
 
#define MD_KEY_AGREEMENT   "agreement"
 
#define MD_KEY_AUTHORIZATIONS   "authorizations"
 
#define MD_KEY_BITS   "bits"
 
#define MD_KEY_CA   "ca"
 
#define MD_KEY_CA_URL   "ca-url"
 
#define MD_KEY_CERT   "cert"
 
#define MD_KEY_CERT_FILE   "cert-file"
 
#define MD_KEY_CERTIFICATE   "certificate"
 
#define MD_KEY_CHALLENGE   "challenge"
 
#define MD_KEY_CHALLENGES   "challenges"
 
#define MD_KEY_CMD_DNS01   "cmd-dns-01"
 
#define MD_KEY_COMPLETE   "complete"
 
#define MD_KEY_CONTACT   "contact"
 
#define MD_KEY_CONTACTS   "contacts"
 
#define MD_KEY_CSR   "csr"
 
#define MD_KEY_DETAIL   "detail"
 
#define MD_KEY_DISABLED   "disabled"
 
#define MD_KEY_DIR   "dir"
 
#define MD_KEY_DOMAIN   "domain"
 
#define MD_KEY_DOMAINS   "domains"
 
#define MD_KEY_ENTRIES   "entries"
 
#define MD_KEY_ERRORED   "errored"
 
#define MD_KEY_ERROR   "error"
 
#define MD_KEY_ERRORS   "errors"
 
#define MD_KEY_EXPIRES   "expires"
 
#define MD_KEY_FINALIZE   "finalize"
 
#define MD_KEY_FINISHED   "finished"
 
#define MD_KEY_FROM   "from"
 
#define MD_KEY_GOOD   "good"
 
#define MD_KEY_HTTP   "http"
 
#define MD_KEY_HTTPS   "https"
 
#define MD_KEY_ID   "id"
 
#define MD_KEY_IDENTIFIER   "identifier"
 
#define MD_KEY_KEY   "key"
 
#define MD_KEY_KEYAUTHZ   "keyAuthorization"
 
#define MD_KEY_LAST   "last"
 
#define MD_KEY_LAST_RUN   "last-run"
 
#define MD_KEY_LOCATION   "location"
 
#define MD_KEY_LOG   "log"
 
#define MD_KEY_MDS   "managed-domains"
 
#define MD_KEY_MESSAGE   "message"
 
#define MD_KEY_MUST_STAPLE   "must-staple"
 
#define MD_KEY_NAME   "name"
 
#define MD_KEY_NEXT_RUN   "next-run"
 
#define MD_KEY_NOTIFIED   "notified"
 
#define MD_KEY_OCSP   "ocsp"
 
#define MD_KEY_OCSPS   "ocsps"
 
#define MD_KEY_ORDERS   "orders"
 
#define MD_KEY_PERMANENT   "permanent"
 
#define MD_KEY_PKEY   "privkey"
 
#define MD_KEY_PKEY_FILE   "pkey-file"
 
#define MD_KEY_PROBLEM   "problem"
 
#define MD_KEY_PROTO   "proto"
 
#define MD_KEY_READY   "ready"
 
#define MD_KEY_REGISTRATION   "registration"
 
#define MD_KEY_RENEW   "renew"
 
#define MD_KEY_RENEW_AT   "renew-at"
 
#define MD_KEY_RENEW_MODE   "renew-mode"
 
#define MD_KEY_RENEWAL   "renewal"
 
#define MD_KEY_RENEWING   "renewing"
 
#define MD_KEY_RENEW_WINDOW   "renew-window"
 
#define MD_KEY_REQUIRE_HTTPS   "require-https"
 
#define MD_KEY_RESOURCE   "resource"
 
#define MD_KEY_RESPONSE   "response"
 
#define MD_KEY_REVOKED   "revoked"
 
#define MD_KEY_SERIAL   "serial"
 
#define MD_KEY_SHA256_FINGERPRINT   "sha256-fingerprint"
 
#define MD_KEY_STAPLING   "stapling"
 
#define MD_KEY_STATE   "state"
 
#define MD_KEY_STATUS   "status"
 
#define MD_KEY_STORE   "store"
 
#define MD_KEY_SUBPROBLEMS   "subproblems"
 
#define MD_KEY_TEMPORARY   "temporary"
 
#define MD_KEY_TOKEN   "token"
 
#define MD_KEY_TOTAL   "total"
 
#define MD_KEY_TRANSITIVE   "transitive"
 
#define MD_KEY_TYPE   "type"
 
#define MD_KEY_UNKNOWN   "unknown"
 
#define MD_KEY_UNTIL   "until"
 
#define MD_KEY_URL   "url"
 
#define MD_KEY_URI   "uri"
 
#define MD_KEY_VALID   "valid"
 
#define MD_KEY_VALID_FROM   "valid-from"
 
#define MD_KEY_VALUE   "value"
 
#define MD_KEY_VERSION   "version"
 
#define MD_KEY_WATCHED   "watched"
 
#define MD_KEY_WHEN   "when"
 
#define MD_KEY_WARN_WINDOW   "warn-window"
 
#define MD_VAL_UPDATE(n, o, s)   ((n)->s != (o)->s)
 
#define MD_SVAL_UPDATE(n, o, s)   ((n)->s && (!(o)->s || strcmp((n)->s, (o)->s)))
 
#define LE_ACMEv1_PROD   "https://acme-v01.api.letsencrypt.org/directory"
 
#define LE_ACMEv1_STAGING   "https://acme-staging.api.letsencrypt.org/directory"
 
#define LE_ACMEv2_PROD   "https://acme-v02.api.letsencrypt.org/directory"
 
#define LE_ACMEv2_STAGING   "https://acme-staging-v02.api.letsencrypt.org/directory"
 
#define MD_OK(c)   (APR_SUCCESS == (rv = c))
 

Typedefs

typedef struct md_t md_t
 
typedef apr_status_t md_job_notify_cb (struct md_job_t *job, const char *reason, struct md_result_t *result, apr_pool_t *p, void *baton)
 
typedef struct md_pubcert_t md_pubcert_t
 

Enumerations

enum  md_state_t {
  MD_S_UNKNOWN = 0, MD_S_INCOMPLETE = 1, MD_S_COMPLETE = 2, MD_S_EXPIRED_DEPRECATED = 3,
  MD_S_ERROR = 4, MD_S_MISSING_INFORMATION = 5
}
 
enum  md_require_t { MD_REQUIRE_UNSET = -1, MD_REQUIRE_OFF, MD_REQUIRE_TEMPORARY, MD_REQUIRE_PERMANENT }
 
enum  md_renew_mode_t { MD_RENEW_DEFAULT = -1, MD_RENEW_MANUAL, MD_RENEW_AUTO, MD_RENEW_ALWAYS }
 

Functions

int md_contains (const md_t *md, const char *domain, int case_sensitive)
 
int md_domains_overlap (const md_t *md1, const md_t *md2)
 
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)
 
const char * md_common_name (const md_t *md1, const md_t *md2)
 
apr_size_t md_common_name_count (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)
 
md_tmd_create_empty (apr_pool_t *p)
 
md_tmd_create (apr_pool_t *p, struct apr_array_header_t *domains)
 
md_tmd_clone (apr_pool_t *p, const md_t *src)
 
md_tmd_copy (apr_pool_t *p, const md_t *src)
 
struct md_json_tmd_to_json (const md_t *md, apr_pool_t *p)
 
md_tmd_from_json (struct md_json_t *json, apr_pool_t *p)
 
int md_is_covered_by_alt_names (const md_t *md, const struct apr_array_header_t *alt_names)
 

Macro Definition Documentation

#define LE_ACMEv1_PROD   "https://acme-v01.api.letsencrypt.org/directory"
#define LE_ACMEv1_STAGING   "https://acme-staging.api.letsencrypt.org/directory"
#define LE_ACMEv2_PROD   "https://acme-v02.api.letsencrypt.org/directory"
#define LE_ACMEv2_STAGING   "https://acme-staging-v02.api.letsencrypt.org/directory"
#define MD_HSTS_HEADER   "Strict-Transport-Security"
#define MD_HSTS_MAX_AGE_DEFAULT   15768000
#define MD_KEY_ACCOUNT   "account"
#define MD_KEY_ACME_TLS_1   "acme-tls/1"
#define MD_KEY_ACTIVATION_DELAY   "activation-delay"
#define MD_KEY_ACTIVITY   "activity"
#define MD_KEY_AGREEMENT   "agreement"
#define MD_KEY_AUTHORIZATIONS   "authorizations"
#define MD_KEY_BITS   "bits"
#define MD_KEY_CA   "ca"
#define MD_KEY_CA_URL   "ca-url"
#define MD_KEY_CERT   "cert"
#define MD_KEY_CERT_FILE   "cert-file"
#define MD_KEY_CERTIFICATE   "certificate"
#define MD_KEY_CHALLENGE   "challenge"
#define MD_KEY_CHALLENGES   "challenges"
#define MD_KEY_CMD_DNS01   "cmd-dns-01"
#define MD_KEY_COMPLETE   "complete"
#define MD_KEY_CONTACT   "contact"
#define MD_KEY_CONTACTS   "contacts"
#define MD_KEY_CSR   "csr"
#define MD_KEY_DETAIL   "detail"
#define MD_KEY_DIR   "dir"
#define MD_KEY_DISABLED   "disabled"
#define MD_KEY_DOMAIN   "domain"
#define MD_KEY_DOMAINS   "domains"
#define MD_KEY_ENTRIES   "entries"
#define MD_KEY_ERROR   "error"
#define MD_KEY_ERRORED   "errored"
#define MD_KEY_ERRORS   "errors"
#define MD_KEY_EXPIRES   "expires"
#define MD_KEY_FINALIZE   "finalize"
#define MD_KEY_FINISHED   "finished"
#define MD_KEY_FROM   "from"
#define MD_KEY_GOOD   "good"
#define MD_KEY_HTTP   "http"
#define MD_KEY_HTTPS   "https"
#define MD_KEY_ID   "id"
#define MD_KEY_IDENTIFIER   "identifier"
#define MD_KEY_KEY   "key"
#define MD_KEY_KEYAUTHZ   "keyAuthorization"
#define MD_KEY_LAST   "last"
#define MD_KEY_LAST_RUN   "last-run"
#define MD_KEY_LOCATION   "location"
#define MD_KEY_LOG   "log"
#define MD_KEY_MDS   "managed-domains"
#define MD_KEY_MESSAGE   "message"
#define MD_KEY_MUST_STAPLE   "must-staple"
#define MD_KEY_NAME   "name"
#define MD_KEY_NEXT_RUN   "next-run"
#define MD_KEY_NOTIFIED   "notified"
#define MD_KEY_OCSP   "ocsp"
#define MD_KEY_OCSPS   "ocsps"
#define MD_KEY_ORDERS   "orders"
#define MD_KEY_PERMANENT   "permanent"
#define MD_KEY_PKEY   "privkey"
#define MD_KEY_PKEY_FILE   "pkey-file"
#define MD_KEY_PROBLEM   "problem"
#define MD_KEY_PROTO   "proto"
#define MD_KEY_READY   "ready"
#define MD_KEY_REGISTRATION   "registration"
#define MD_KEY_RENEW   "renew"
#define MD_KEY_RENEW_AT   "renew-at"
#define MD_KEY_RENEW_MODE   "renew-mode"
#define MD_KEY_RENEW_WINDOW   "renew-window"
#define MD_KEY_RENEWAL   "renewal"
#define MD_KEY_RENEWING   "renewing"
#define MD_KEY_REQUIRE_HTTPS   "require-https"
#define MD_KEY_RESOURCE   "resource"
#define MD_KEY_RESPONSE   "response"
#define MD_KEY_REVOKED   "revoked"
#define MD_KEY_SERIAL   "serial"
#define MD_KEY_SHA256_FINGERPRINT   "sha256-fingerprint"
#define MD_KEY_STAPLING   "stapling"
#define MD_KEY_STATE   "state"
#define MD_KEY_STATUS   "status"
#define MD_KEY_STORE   "store"
#define MD_KEY_SUBPROBLEMS   "subproblems"
#define MD_KEY_TEMPORARY   "temporary"
#define MD_KEY_TOKEN   "token"
#define MD_KEY_TOTAL   "total"
#define MD_KEY_TRANSITIVE   "transitive"
#define MD_KEY_TYPE   "type"
#define MD_KEY_UNKNOWN   "unknown"
#define MD_KEY_UNTIL   "until"
#define MD_KEY_URI   "uri"
#define MD_KEY_URL   "url"
#define MD_KEY_VALID   "valid"
#define MD_KEY_VALID_FROM   "valid-from"
#define MD_KEY_VALUE   "value"
#define MD_KEY_VERSION   "version"
#define MD_KEY_WARN_WINDOW   "warn-window"
#define MD_KEY_WATCHED   "watched"
#define MD_KEY_WHEN   "when"
#define MD_OK (   c)    (APR_SUCCESS == (rv = c))
#define MD_OTHER   "other"
#define MD_PKEY_RSA_BITS_DEF   2048
#define MD_PKEY_RSA_BITS_MIN   2048
#define MD_SVAL_UPDATE (   n,
  o,
 
)    ((n)->s && (!(o)->s || strcmp((n)->s, (o)->s)))
#define MD_TIME_LIFE_NORM   (apr_time_from_sec(100 * MD_SECS_PER_DAY))
#define MD_TIME_OCSP_KEEP_NORM   (apr_time_from_sec(7 * MD_SECS_PER_DAY))
#define MD_TIME_RENEW_WINDOW_DEF   (apr_time_from_sec(33 * MD_SECS_PER_DAY))
#define MD_TIME_WARN_WINDOW_DEF   (apr_time_from_sec(10 * MD_SECS_PER_DAY))
#define MD_VAL_UPDATE (   n,
  o,
 
)    ((n)->s != (o)->s)
#define PROTO_ACME_TLS_1   "acme-tls/1"

Typedef Documentation

typedef apr_status_t md_job_notify_cb(struct md_job_t *job, const char *reason, struct md_result_t *result, apr_pool_t *p, void *baton)
typedef struct md_pubcert_t md_pubcert_t
typedef struct md_t md_t

Enumeration Type Documentation

Enumerator
MD_RENEW_DEFAULT 
MD_RENEW_MANUAL 
MD_RENEW_AUTO 
MD_RENEW_ALWAYS 
Enumerator
MD_REQUIRE_UNSET 
MD_REQUIRE_OFF 
MD_REQUIRE_TEMPORARY 
MD_REQUIRE_PERMANENT 
enum md_state_t
Enumerator
MD_S_UNKNOWN 
MD_S_INCOMPLETE 
MD_S_COMPLETE 
MD_S_EXPIRED_DEPRECATED 
MD_S_ERROR 
MD_S_MISSING_INFORMATION 

Function Documentation

md_t* md_clone ( apr_pool_t p,
const md_t src 
)

Deep copy an md record into another pool.

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.

apr_size_t md_common_name_count ( const md_t md1,
const md_t md2 
)

Get the number of common domains.

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

Determine if the Managed Domain contains a specific domain name.

int md_contains_domains ( const md_t md1,
const md_t md2 
)

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

md_t* md_copy ( apr_pool_t p,
const md_t src 
)

Shallow copy an md record into another pool.

md_t* md_create ( apr_pool_t p,
struct apr_array_header_t domains 
)

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

md_t* md_create_empty ( apr_pool_t p)

Create and empty md record, structures initialized.

int md_domains_overlap ( const md_t md1,
const md_t md2 
)

Determine if the names of the two managed domains overlap.

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

Determine if the domain names are equal.

md_t* md_from_json ( struct md_json_t json,
apr_pool_t p 
)
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.

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.

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

Look up a managed domain by its name.

int md_is_covered_by_alt_names ( const md_t md,
const struct apr_array_header_t alt_names 
)
struct 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.