perf(test): fold tls fingerprint normalization into ssrf suite
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { normalizeFingerprint } from "../tls/fingerprint.js";
|
||||
import { isPrivateIpAddress } from "./ssrf.js";
|
||||
|
||||
describe("ssrf ip classification", () => {
|
||||
@@ -30,3 +31,11 @@ describe("ssrf ip classification", () => {
|
||||
expect(isPrivateIpAddress("2001:db8::1")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeFingerprint", () => {
|
||||
it("strips sha256 prefixes and separators", () => {
|
||||
expect(normalizeFingerprint("sha256:AA:BB:cc")).toBe("aabbcc");
|
||||
expect(normalizeFingerprint("SHA-256 11-22-33")).toBe("112233");
|
||||
expect(normalizeFingerprint("aa:bb:cc")).toBe("aabbcc");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { normalizeFingerprint } from "./fingerprint.js";
|
||||
|
||||
describe("normalizeFingerprint", () => {
|
||||
it("strips sha256 prefixes and separators", () => {
|
||||
expect(normalizeFingerprint("sha256:AA:BB:cc")).toBe("aabbcc");
|
||||
expect(normalizeFingerprint("SHA-256 11-22-33")).toBe("112233");
|
||||
expect(normalizeFingerprint("aa:bb:cc")).toBe("aabbcc");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user