Release Crypto Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 10:40:23 +02:00
parent 4b75f819e2
commit 82bb01b13f
37 changed files with 3673 additions and 140 deletions
+67 -1
View File
@@ -1,6 +1,15 @@
import { expect, test, type Page } from "@playwright/test";
import { MODERN_PFX_BASE64, MODERN_PFX_PASSWORD } from "../fixtures/pkcs12";
const ORIGIN = "http://127.0.0.1:4173";
function nodeBase64Buffer(value: string): never {
return (
globalThis as unknown as {
Buffer: { from(source: string, encoding: "base64"): never };
}
).Buffer.from(value, "base64");
}
async function localOnly(page: Page) {
const external: string[] = [];
await page.route("**/*", async (route) => {
@@ -39,6 +48,63 @@ test("inspects a JWK and computes its local thumbprint", async ({ page }) => {
expect(external).toEqual([]);
});
test("round-trips authenticated text with an explicit generated AES key", async ({
page,
}) => {
const external = await localOnly(page);
await page.goto("/deep/nested/crypto/");
await page.getByRole("button", { name: "Generate 256-bit AES key" }).click();
await expect(page.getByLabel("Operation key")).toHaveValue(
/^[A-Za-z0-9_-]{43}$/u,
);
await page.getByRole("button", { name: "Encrypt locally" }).click();
await expect(page.locator(".operation-result > pre")).toContainText(
'"algorithm": "AES-256-GCM"',
);
await page.getByRole("button", { name: "Decrypt" }).click();
await page.getByRole("button", { name: "Decrypt locally" }).click();
await expect(page.locator(".operation-result > pre")).toHaveText(
"Local-only example",
);
expect(external).toEqual([]);
});
test("inspects a modern PFX only after explicit password consent", async ({
page,
}) => {
const external = await localOnly(page);
await page.goto("/deep/nested/crypto/");
await page.getByLabel("Open file").setInputFiles({
name: "modern-test.p12",
mimeType: "application/x-pkcs12",
buffer: nodeBase64Buffer(MODERN_PFX_BASE64),
});
await expect(
page.getByText("Present; explicit password required to verify"),
).toBeVisible();
await expect(
page.getByRole("heading", { name: "Local test identity" }),
).toBeVisible();
await page
.getByLabel(/Use this password in memory for this inspection/u)
.check();
await page
.getByLabel(/PBES2 \/ PKCS #12 password/u)
.fill(MODERN_PFX_PASSWORD);
await page.getByRole("button", { name: "Inspect locally" }).click();
await expect(
page.getByText("Verified with the explicitly supplied password"),
).toBeVisible();
await expect(
page.getByText("Local PFX Test", { exact: false }).first(),
).toBeVisible();
await expect(
page.locator("dt", { hasText: "Private-key algorithm" }),
).toBeVisible();
expect(external).toEqual([]);
});
test("serves the release identity and hardened headers", async ({
request,
}) => {
@@ -51,7 +117,7 @@ test("serves the release identity and hardened headers", async ({
const manifest = await request.get("/deep/nested/crypto/toolbox-app.json");
await expect(manifest.json()).resolves.toMatchObject({
id: "de.add-ideas.crypto-tools",
version: "0.1.0",
version: "0.2.0",
entry: "./",
});
});