mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 01:06:16 -04:00
Add Strip UDP header operation
This commit is contained in:
parent
d635cca210
commit
da74d9b22d
4 changed files with 122 additions and 0 deletions
69
tests/operations/tests/StripUDPHeader.mjs
Normal file
69
tests/operations/tests/StripUDPHeader.mjs
Normal file
|
@ -0,0 +1,69 @@
|
|||
/**
|
||||
* Strip UDP header tests.
|
||||
*
|
||||
* @author c65722 []
|
||||
* @copyright Crown Copyright 2024
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Strip UDP header: No payload",
|
||||
input: "8111003500000000",
|
||||
expectedOutput: "",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
args: ["None"]
|
||||
},
|
||||
{
|
||||
op: "Strip UDP header",
|
||||
args: [],
|
||||
},
|
||||
{
|
||||
op: "To Hex",
|
||||
args: ["None", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Strip UDP header: Payload",
|
||||
input: "8111003500080000ffffffffffffffff",
|
||||
expectedOutput: "ffffffffffffffff",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
args: ["None"]
|
||||
},
|
||||
{
|
||||
op: "Strip UDP header",
|
||||
args: [],
|
||||
},
|
||||
{
|
||||
op: "To Hex",
|
||||
args: ["None", 0]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Strip UDP header: Input length less than header length",
|
||||
input: "81110035000000",
|
||||
expectedOutput: "Need 8 bytes for a UDP Header",
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "From Hex",
|
||||
args: ["None"]
|
||||
},
|
||||
{
|
||||
op: "Strip UDP header",
|
||||
args: [],
|
||||
},
|
||||
{
|
||||
op: "To Hex",
|
||||
args: ["None", 0]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue