Dear all,
We have discussed earlier the possibility to fuzz controlable codecs (RAW, TEXT, JSON. XML).
The same principle can be applied to the other Titan-native codec, BER, which is used for encoding a number of ASN.1 based protocols.
Here's a snippet of code and the associated log to demonstrate the above:
BERType
DEFINITIONS
AUTOMATIC TAGS
::=
BEGIN
IMPORTS ;
Seq ::= SEQUENCE {
num INTEGER,
str VisibleString
}
END
module fuzzing {
import from BERType all;
external function f_enc(in Seq x) return octetstring
with { extension "prototype(convert) encode(BER:BER_ENCODE_DER)" }
const Seq c := { num := 3, str := "abc" } with { erroneous(num) "after := omit all" }
control {
action(f_enc(c));
@update(c);
action(f_enc(c));
@update(c) with { erroneous(num) "value := 10" }
action(f_enc(c));
}
}
12:14:54.523526 - TTCN-3 Test Executor started in single mode. Version: CRL 113 200/6 R2A.
12:14:54.523611 - Maximum number of open file descriptors: 8193, FD_SETSIZE = 1024
12:14:54.527455 - TTCN Logger v2.2 options: TimeStampFormat:=Time; LogEntityName:=No; LogEventTypes:=No; SourceInfoFormat:=Single; *.FileMask:=LOG_ALL; *.ConsoleMask:=ACTION | ERROR | TESTCASE | STATISTICS_VERDICT | STATISTICS_UNQUALIFIED | WARNING; LogFileSize:=0; LogFileNumber:=1; DiskFullAction:=Error
12:14:54.527481 - Initializing module BERType.
12:14:54.527494 - Initialization of module BERType finished.
12:14:54.527505 - Initializing module PreGenRecordOf.
12:14:54.527517 - Initialization of module PreGenRecordOf finished.
12:14:54.527528 - Initializing module TitanLoggerApi.
12:14:54.527538 - Initialization of module TitanLoggerApi finished.
12:14:54.527549 - Initializing module fuzzing.
12:14:54.527560 - Initialization of module fuzzing finished.
12:14:54.527572 fuzzing.ttcn:10 Execution of control part in module fuzzing started.
12:14:54.527622 fuzzing.ttcn:11 Action: '3003800103'O
12:14:54.527707 fuzzing.ttcn:13 Action: '30088001038103616263'O
12:14:54.527745 fuzzing.ttcn:15 Action: '300802010A8103616263'O
12:14:54.527795 fuzzing.ttcn:15 Execution of control part in module fuzzing finished.
12:14:54.527819 - Verdict statistics: 0 none, 0 pass, 0 inconc, 0 fail, 0 error.
12:14:54.527860 - Test execution summary: 0 test case was executed. Overall verdict: none
12:14:54.527876 - TTCN-3 Test Executor finished in single mode.
Best regards
Elemer