# davidluke0704/openssl architecture

> Architecture diagram of the GitHub repository davidluke0704/openssl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/davidluke0704/openssl
- Repository: https://github.com/davidluke0704/openssl

## Overview

OpenSSL is a cryptographic toolkit: its command-line program exposes common cryptographic and certificate tasks, libcrypto provides reusable cryptographic services, and libssl implements TLS. The main user workflow is invoking a CLI command to perform a task and receive output; TLS client/server testing is a distinct CLI path through libssl. The README documents the product boundaries and capabilities, while sampled source confirms selected implementation links. Several major subsystems are represented by their exact directories because their implementation was not sampled.

Main entry points: [`apps/openssl.c`](https://github.com/davidluke0704/openssl/blob/master/apps/openssl.c) (OpenSSL CLI), [`ssl/ssl_lib.c`](https://github.com/davidluke0704/openssl/blob/master/ssl/ssl_lib.c) (TLS library), [`crypto`](https://github.com/davidluke0704/openssl/tree/master/crypto) (Crypto library), [`ssl/ssl_local.h`](https://github.com/davidluke0704/openssl/blob/master/ssl/ssl_local.h) (TLS internals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command line"]
  node_cli["OpenSSL CLI<br/>[openssl.c]"]
  node_cli_common["CLI support<br/>[apps.c]"]
  node_cert_commands["Certificate commands<br/>[x509.c]"]
  node_digest_commands["Digest commands<br/>[dgst.c]"]
  node_tls_client["TLS client<br/>[s_client.c]"]
  node_tls_server["TLS server<br/>[s_server.c]"]
end

subgraph group_tls["TLS protocol"]
  node_tls_library["TLS library<br/>[ssl_lib.c]"]
  node_tls_state["Handshake state<br/>[statem_srvr.c]"]
  node_tls_records["TLS records<br/>[ssl3_record.c]"]
  node_ssl_internals["TLS internals<br/>[ssl_local.h]"]
end

subgraph group_crypto["Cryptographic services"]
  node_libcrypto["Crypto library"]
  node_evp["EVP interface<br/>[evp.h]"]
  node_providers["Providers"]
  node_properties["Algorithm properties<br/>[property_query.c]"]
  node_ec["Elliptic curves<br/>[ec_local.h]"]
  node_crypto_context["Library context<br/>[context.c]"]
  node_crypto_internals["Crypto internals<br/>[cryptlib.h]"]
end

subgraph group_protocols["Security protocols"]
  node_cmp["Certificate management"]
  node_cms["Cryptographic messages"]
  node_ocsp["Certificate status"]
  node_x509_verify["Certificate verification<br/>[x509_vfy.c]"]
  node_http["HTTP transport<br/>[http_client.c]"]
end

node_user(("User"))

node_user -->|"invokes"| node_cli
node_cli -.->|"dispatches"| node_cert_commands
node_cli -.->|"dispatches"| node_digest_commands
node_cli -.->|"dispatches"| node_tls_client
node_cli -.->|"dispatches"| node_tls_server
node_tls_client -->|"uses TLS"| node_tls_library
node_tls_server -.->|"uses TLS"| node_tls_library
node_tls_library -->|"based on"| node_libcrypto
node_tls_state -->|"uses state"| node_ssl_internals
node_tls_library -->|"uses state"| node_ssl_internals
node_tls_records -->|"uses state"| node_ssl_internals
node_libcrypto -.->|"exposes API"| node_evp
node_crypto_context -->|"uses definitions"| node_crypto_internals
node_crypto_context -->|"uses properties"| node_properties
node_cli_common -.->|"supports commands"| node_libcrypto
node_cmp -.->|"uses transport"| node_http
node_x509_verify -.->|"uses crypto"| node_libcrypto

click node_cli "https://github.com/davidluke0704/openssl/blob/master/apps/openssl.c"
click node_cli_common "https://github.com/davidluke0704/openssl/blob/master/apps/lib/apps.c"
click node_cert_commands "https://github.com/davidluke0704/openssl/blob/master/apps/x509.c"
click node_digest_commands "https://github.com/davidluke0704/openssl/blob/master/apps/dgst.c"
click node_tls_client "https://github.com/davidluke0704/openssl/blob/master/apps/s_client.c"
click node_tls_server "https://github.com/davidluke0704/openssl/blob/master/apps/s_server.c"
click node_tls_library "https://github.com/davidluke0704/openssl/blob/master/ssl/ssl_lib.c"
click node_tls_state "https://github.com/davidluke0704/openssl/blob/master/ssl/statem/statem_srvr.c"
click node_tls_records "https://github.com/davidluke0704/openssl/blob/master/ssl/record/ssl3_record.c"
click node_ssl_internals "https://github.com/davidluke0704/openssl/blob/master/ssl/ssl_local.h"
click node_libcrypto "https://github.com/davidluke0704/openssl/tree/master/crypto"
click node_evp "https://github.com/davidluke0704/openssl/blob/master/include/crypto/evp.h"
click node_providers "https://github.com/davidluke0704/openssl/tree/master/providers"
click node_properties "https://github.com/davidluke0704/openssl/blob/master/crypto/property/property_query.c"
click node_ec "https://github.com/davidluke0704/openssl/blob/master/crypto/ec/ec_local.h"
click node_crypto_context "https://github.com/davidluke0704/openssl/blob/master/crypto/context.c"
click node_crypto_internals "https://github.com/davidluke0704/openssl/blob/master/include/internal/cryptlib.h"
click node_cmp "https://github.com/davidluke0704/openssl/tree/master/crypto/cmp"
click node_cms "https://github.com/davidluke0704/openssl/tree/master/crypto/cms"
click node_ocsp "https://github.com/davidluke0704/openssl/tree/master/crypto/ocsp"
click node_x509_verify "https://github.com/davidluke0704/openssl/blob/master/crypto/x509/x509_vfy.c"
click node_http "https://github.com/davidluke0704/openssl/blob/master/crypto/http/http_client.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_cli_common,node_cert_commands,node_digest_commands,node_tls_client,node_tls_server,node_user toneBlue
class node_tls_library,node_tls_state,node_tls_records,node_ssl_internals toneAmber
class node_libcrypto,node_evp,node_providers,node_properties,node_ec,node_crypto_context,node_crypto_internals toneMint
class node_cmp,node_cms,node_ocsp,node_x509_verify,node_http toneRose
```

## Components

### Command line

- [OpenSSL CLI](https://github.com/davidluke0704/openssl/blob/master/apps/openssl.c): `apps/openssl.c`
- [CLI support](https://github.com/davidluke0704/openssl/blob/master/apps/lib/apps.c): `apps/lib/apps.c`
- [Certificate commands](https://github.com/davidluke0704/openssl/blob/master/apps/x509.c): `apps/x509.c`
- [Digest commands](https://github.com/davidluke0704/openssl/blob/master/apps/dgst.c): `apps/dgst.c`
- [TLS client](https://github.com/davidluke0704/openssl/blob/master/apps/s_client.c): `apps/s_client.c`
- [TLS server](https://github.com/davidluke0704/openssl/blob/master/apps/s_server.c): `apps/s_server.c`

### TLS protocol

- [TLS library](https://github.com/davidluke0704/openssl/blob/master/ssl/ssl_lib.c): `ssl/ssl_lib.c`
- [Handshake state](https://github.com/davidluke0704/openssl/blob/master/ssl/statem/statem_srvr.c): `ssl/statem/statem_srvr.c`
- [TLS records](https://github.com/davidluke0704/openssl/blob/master/ssl/record/ssl3_record.c): `ssl/record/ssl3_record.c`
- [TLS internals](https://github.com/davidluke0704/openssl/blob/master/ssl/ssl_local.h): `ssl/ssl_local.h`

### Cryptographic services

- [Crypto library](https://github.com/davidluke0704/openssl/tree/master/crypto): `crypto`
- [EVP interface](https://github.com/davidluke0704/openssl/blob/master/include/crypto/evp.h): `include/crypto/evp.h`
- [Providers](https://github.com/davidluke0704/openssl/tree/master/providers): `providers`
- [Algorithm properties](https://github.com/davidluke0704/openssl/blob/master/crypto/property/property_query.c): `crypto/property/property_query.c`
- [Elliptic curves](https://github.com/davidluke0704/openssl/blob/master/crypto/ec/ec_local.h): `crypto/ec/ec_local.h`
- [Library context](https://github.com/davidluke0704/openssl/blob/master/crypto/context.c): `crypto/context.c`
- [Crypto internals](https://github.com/davidluke0704/openssl/blob/master/include/internal/cryptlib.h): `include/internal/cryptlib.h`

### Security protocols

- [Certificate management](https://github.com/davidluke0704/openssl/tree/master/crypto/cmp): `crypto/cmp`
- [Cryptographic messages](https://github.com/davidluke0704/openssl/tree/master/crypto/cms): `crypto/cms`
- [Certificate status](https://github.com/davidluke0704/openssl/tree/master/crypto/ocsp): `crypto/ocsp`
- [Certificate verification](https://github.com/davidluke0704/openssl/blob/master/crypto/x509/x509_vfy.c): `crypto/x509/x509_vfy.c`
- [HTTP transport](https://github.com/davidluke0704/openssl/blob/master/crypto/http/http_client.c): `crypto/http/http_client.c`

### Other components

- **User**

## Connections

- User → OpenSSL CLI: invokes (evidence: `README.md`)
- OpenSSL CLI → Certificate commands: dispatches
- OpenSSL CLI → Digest commands: dispatches
- OpenSSL CLI → TLS client: dispatches
- OpenSSL CLI → TLS server: dispatches
- TLS client → TLS library: uses TLS (evidence: `apps/s_client.c`)
- TLS server → TLS library: uses TLS
- TLS library → Crypto library: based on (evidence: `README.md`)
- Handshake state → TLS internals: uses state (evidence: `ssl/statem/statem_srvr.c`)
- TLS library → TLS internals: uses state (evidence: `ssl/ssl_lib.c`)
- TLS records → TLS internals: uses state (evidence: `ssl/ssl_local.h`)
- Crypto library → EVP interface: exposes API (evidence: `crypto/evp/e_aes.c`)
- Library context → Crypto internals: uses definitions (evidence: `crypto/context.c`)
- Library context → Algorithm properties: uses properties (evidence: `crypto/context.c`)
- CLI support → Crypto library: supports commands
- Certificate management → HTTP transport: uses transport
- Certificate verification → Crypto library: uses crypto (evidence: `crypto/x509/x509_vfy.c`)
