mirror of
https://github.com/gchq/CyberChef.git
synced 2025-06-17 11:45:07 -04:00
70 lines
1.6 KiB
JavaScript
70 lines
1.6 KiB
JavaScript
![]() |
/**
|
||
|
* 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]
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]);
|