abla/tls/pure/verify

Generated from source.

Import with import "abla/tls/pure/verify".

Source: abla/tls/pure/verify/entry.ab

TLS_OID_EC_PUBLIC_KEY (val)

val TLS_OID_EC_PUBLIC_KEY

Subject public-key algorithm identifier for elliptic-curve keys.

TLS_OID_RSA_ENCRYPTION (val)

val TLS_OID_RSA_ENCRYPTION

Subject public-key algorithm identifier for conventional RSA keys.

TLS_OID_ED25519 (val)

val TLS_OID_ED25519

Subject public-key algorithm identifier for Ed25519 keys.

tlsCheckSignature (fun)

fun tlsCheckSignature(leaf: X509Certificate, scheme: int, content: string, signature: string): TlsVerdict

Checks signature over content with the end-entity certificate's key for a TLS signature scheme. A scheme carrying TLS_SIGNATURE_TLS12 (what the TLS 1.2 call sites pass) is checked by TLS 1.2's rules; any other is checked by TLS 1.3's, the strict ones, so a caller that says nothing gets those.

tlsVerifySignature (fun)

fun tlsVerifySignature(leaf: X509Certificate, scheme: int, content: string, signature: string): string

As tlsCheckSignature, the reason only: "" when the signature is valid.

tlsChainVerdictAlert (fun)

fun tlsChainVerdictAlert(kind: int): int

The alert RFC 8446 section 4.4.2.4 and 6.2 give a certificate chain that x509 refused for kind. OpenSSL 3 sends bad_certificate for the rest (a wrong host name, a missing subjectAltName, a bad path).

tlsVerifyServerCertificate (fun)

fun tlsVerifyServerCertificate(chain: array<string>, host: string, scheme: int, content: string,
    signature: string, store: X509TrustStore, now: int, allowAnyHost: bool = false): TlsVerdict

The whole check: the chain against store for host at now (seconds since 1970), then the signature. The verdict carries the alert to send (unknown_ca for a chain with no trusted anchor, certificate_expired for an expired or not yet valid one, unsupported_certificate for a key or signature algorithm it cannot use, else bad_certificate).

TlsPathVerdict (class)

class TlsPathVerdict(val verdict: TlsVerdict, val path: TlsVerifiedPath?)

A verdict with the path the chain verifier found (null when the chain did not verify).

TlsVerifiedPath (class)

class TlsVerifiedPath(val chain: array<string>, val path: array<X509Certificate>)

A chain and the path the chain verifier found for it.

tlsVerifyServerCertificateKeepingPath (fun)

fun tlsVerifyServerCertificateKeepingPath(chain: array<string>, host: string, scheme: int, content: string,
    signature: string, store: X509TrustStore, now: int, allowAnyHost: bool = false): TlsPathVerdict

tlsVerifyServerCertificate that also returns the path it verified.

tlsVerifyClientCertificate (fun)

fun tlsVerifyClientCertificate(chain: array<string>, scheme: int, content: string, signature: string,
    store: X509TrustStore, now: int): TlsVerdict

The verification of a client's certificate chain for a server (extended key usage clientAuth), as tlsVerifyServerCertificate: the same verdicts.

tlsX509Verifier (fun)

fun tlsX509Verifier(store: X509TrustStore, now: () -> int): (array<string>, string, int, string, string) -> TlsVerdict

A verifier for TlsClientConfig that trusts store, with the time from now (called once per handshake).

tlsX509ClientVerifier (fun)

fun tlsX509ClientVerifier(store: X509TrustStore, now: () -> int): (array<string>, int, string, string) -> TlsVerdict

A client verifier for TlsServerConfig that trusts store, with the time from now (called once per handshake).

tlsX509VerifierLazy (fun)

fun tlsX509VerifierLazy(store: () -> X509TrustStore, now: () -> int): (array<string>, string, int, string, string) -> TlsVerdict

As tlsX509Verifier, with the trust store fetched when the server's certificate arrives (not when the connection starts): a handshake that never gets that far, a peer that closes or stalls, does not pay for parsing the system's certificate bundle.

tlsX509Scope (fun)

fun tlsX509Scope(store: X509TrustStore): string

A name for what tlsX509Verifier(store, ...) trusts: the SHA-256 of the store's certificates in order. The scope of a session cache (tlsClientConfigWithSessions): a ticket obtained from a server verified against these roots resumes only for a client that verifies against the same roots.

tlsOcspVerifier (fun)

fun tlsOcspVerifier(store: X509TrustStore, host: string, now: () -> int, policy: int): (array<string>, array<string>) -> TlsVerdict

The staple verifier for TlsClientConfig.stapleVerifier (set both with tlsClientConfigWithRevocation): it builds the path of the chain the server sent against store for host at the time from now (the chain verifier has accepted it already), maps each stapled response to its certificate of the path, and applies policy (OCSP_POLICY_STAPLE or OCSP_POLICY_REQUIRE of abla/crypto/ocsp; see ocspCheckPath). A revoked certificate answers certificate_revoked, any other refusal bad_certificate_status_response (a must-staple certificate without a staple: bad_certificate).

TlsRevocationVerifiers (class)

class TlsRevocationVerifiers(val verifier: (array<string>, string, int, string, string) -> TlsVerdict, val stapleVerifier: (array<string>, array<string>) -> TlsVerdict)

The two verifiers of a client that checks staples, made together (and as tlsX509VerifierLazy and tlsOcspVerifierLazy would be made apart): the chain verifier leaves the path it verified, and the staple verifier of the same handshake uses it, so the chain's signatures are checked once. verifier is for TlsClientConfig.verifier, stapleVerifier for tlsClientConfigWithRevocation.

tlsX509RevocationVerifiers (fun)

fun tlsX509RevocationVerifiers(storeOf: () -> X509TrustStore, host: string, now: () -> int, policy: int): TlsRevocationVerifiers

Makes the chain verifier and the staple verifier of one client together (TlsRevocationVerifiers): the trust store from storeOf, the name host, the time from now, the OCSP policy.

tlsOcspVerifierLazy (fun)

fun tlsOcspVerifierLazy(storeOf: () -> X509TrustStore, host: string, now: () -> int, policy: int, shared: TVar<TlsVerifiedPath?>? = null): (array<string>, array<string>) -> TlsVerdict

tlsOcspVerifier with the trust store read when the staples arrive (the system store is parsed only then, as tlsX509VerifierLazy does).

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.