From acfae4b6e85ac49753ba424dc51535301a98da39 Mon Sep 17 00:00:00 2001 From: mnovak Date: Mon, 23 Nov 2026 00:19:31 +0100 Subject: [PATCH] [repo] Licence: CPAL-1.0 file headers instead of the MPL-2.0 notice Each source file's three-line MPL-2.0 notice becomes an SPDX CPAL-1.0 header with the copyright line; the Exhibit A notice itself is in LICENSE (CPAL 3.5). Shell scripts' SPDX ids follow. Comments only: no code changes. --- .githooks/pre-commit | 2 +- .githooks/test-pre-commit.sh | 2 +- src/ca.rs | 5 ++--- src/inspect.rs | 5 ++--- src/lib.rs | 5 ++--- src/signer.rs | 5 ++--- src/testing.rs | 5 ++--- src/verify.rs | 5 ++--- tests/agents.rs | 5 ++--- tests/chains.rs | 5 ++--- tests/common/mod.rs | 5 ++--- tests/signer.rs | 5 ++--- 12 files changed, 22 insertions(+), 32 deletions(-) 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/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.