diff --git a/.githooks/pre-commit b/.githooks/pre-commit index ca40a21..6385f87 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: CPAL-1.0 # # Pre-commit hook (shared with Ianitor). Rejects staged files that must never be in git: # - binaries: any NUL byte anywhere in the staged blob (git attributes do not matter) diff --git a/.githooks/test-pre-commit.sh b/.githooks/test-pre-commit.sh index 771e14a..469d6ba 100644 --- a/.githooks/test-pre-commit.sh +++ b/.githooks/test-pre-commit.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# SPDX-License-Identifier: MPL-2.0 +# SPDX-License-Identifier: CPAL-1.0 # # Self-test for .githooks/pre-commit. Creates a throw-away repository, points it at the # hook and checks that every forbidden case is rejected and normal files are accepted. diff --git a/Cargo.lock b/Cargo.lock index df9e8f7..c74d6dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,7 +123,7 @@ dependencies = [ [[package]] name = "domi-pki" -version = "1.0.0" +version = "1.0.1" dependencies = [ "base64 0.22.1", "rcgen", diff --git a/Cargo.toml b/Cargo.toml index 551db5e..0e59fd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "domi-pki" -version = "1.0.0" +version = "1.0.1" description = "The Domi CA: root certificate through a signer, intermediates, server, device and agent certificates, chain checks. Pure: no I/O." edition = "2024" rust-version = "1.89" diff --git a/README.md b/README.md index d1705e9..1e14ba1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ the checks on them. Used by [Ianitor](https://gitea.marek-novak.cz/mnovak/Ianito ```toml [dependencies] -domi-pki = { git = "https://gitea.marek-novak.cz/mnovak/domi-pki", tag = "v1.0.0" } +domi-pki = { git = "https://gitea.marek-novak.cz/mnovak/domi-pki", tag = "v1.0.1" } ``` Design and rules: [docs/01_domi_pki.md](docs/01_domi_pki.md). Licence: CPAL-1.0 (Common Public Attribution License 1.0), see LICENSE. Anyone redistributing this code, or a work that includes it, must show the attribution in Exhibit B: "Built on Domi", https://aula.marek-novak.cz, Copyright (c) 2026 Marek Novák. Versions before this change stay available under MPL-2.0 to those who received them. diff --git a/src/ca.rs b/src/ca.rs index e217d97..eb37ed3 100644 --- a/src/ca.rs +++ b/src/ca.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Making certificates: the root's (through a [`Signer`]), intermediates from CSRs, and the //! leaves an [`Intermediate`] issues (server, device, agent). diff --git a/src/inspect.rs b/src/inspect.rs index c0b28fd..c594a40 100644 --- a/src/inspect.rs +++ b/src/inspect.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Reading certificates and CSRs (hostile input): what they say, who signed them, match codes. diff --git a/src/lib.rs b/src/lib.rs index 9dbc400..3763fea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The Domi CA (docs/01_domi_pki.md): a small CA on rcgen, checked with rustls-webpki. Pure: the //! caller passes the time in and does every file read and write. Keys are ECDSA P-256; a root diff --git a/src/signer.rs b/src/signer.rs index 2d5049b..cc809d5 100644 --- a/src/signer.rs +++ b/src/signer.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Who signs: the [`Signer`] trait (the root lives in Custos and signs through it) and the local //! [`KeyPair`] (intermediates, tests, the offline machine). diff --git a/src/testing.rs b/src/testing.rs index 8ff7e29..16b3e4d 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Helpers for tests that need certificates the Domi CA itself would never make. diff --git a/src/verify.rs b/src/verify.rs index cda36b5..04643f3 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Checking chains (rustls-webpki) and agent certificates. Everything presented is hostile. diff --git a/tests/agents.rs b/tests/agents.rs index c2cc5b7..f0899fa 100644 --- a/tests/agents.rs +++ b/tests/agents.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Agent certificates (tests first, docs/01): issued from the agent's own CSR, only by the agents //! intermediate; `verify_agent` names the agent, and refuses expired, foreign and mis-chained ones. diff --git a/tests/chains.rs b/tests/chains.rs index 7eb2df5..99e6478 100644 --- a/tests/chains.rs +++ b/tests/chains.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! Chains, expiry and wrong issuers (tests first, docs/01): issued chains validate to the root, //! a leaf cannot sign, pathLen 0 holds, expired and not-yet-valid certificates are refused, and a diff --git a/tests/common/mod.rs b/tests/common/mod.rs index c87f777..7ee4b6e 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. #![allow(dead_code, clippy::unwrap_used, clippy::expect_used, clippy::panic)] diff --git a/tests/signer.rs b/tests/signer.rs index 213ffe5..d2e5667 100644 --- a/tests/signer.rs +++ b/tests/signer.rs @@ -1,6 +1,5 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. +// SPDX-License-Identifier: CPAL-1.0 +// Copyright (c) 2026 Marek Novák. Exhibit A notice: LICENSE at the repository root. //! The root signs only through `Signer` (tests first, docs/01): once per operation, a signer whose //! key is not the root's is refused, a lying signer is caught, and CSRs never steer the profile.