scan_controls.c

filter: Statementstmt 87.8% 29 / 33 Branchbran 65.3% 17 / 26 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 77.9% 46 / 59 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« scan_delete_request.c ↑ Summary scan_compare_request.c »
1 #include "scan.h"
2  
3 void
4 32 scan_controls(const char **src, const char *max, AV *controls) {
5 STRLEN len;
6 U8 type;
7 U32 tag;
8 32 scan_tag(src, max, &type, &tag);
9 32 ▶ if (type != (ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED) || tag != 0)
Branch: 2 branches
BranchTrueFalseTotal
if (type != (ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED) || tag != 0) 32 0 32
if (type != (ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED) || tag != 0) 0 32 32
10 0 croak("scan_controls: bad packet");
11 32 scan_length(src, max, &len);
12 32 max = *src + len;
13  
14 80 ▶ while (*src < max) {
Branch: 1 branch
BranchTrueFalseTotal
while (*src < max) { 48 32 80
15 HV *control;
16 SV *sv;
17 STRLEN control_len;
18 const char *control_max;
19 48 ▶ scan_sequence(src, max, &control_len);
Branch: 2 branches
BranchTrueFalseTotal
scan_sequence(src, max, &control_len); 48 0 48
scan_sequence(src, max, &control_len); 48 0 48
20 48 control_max = *src + control_len;
21 48 control = newHV();
22 48 av_push(controls, newRV_noinc((SV*)control));
23 48 sv = newSV(0);
24 48 hv_stores(control, "type", sv);
25 48 scan_string_utf8(src, control_max, sv);
26  
27 48 ▶ if (*src == control_max) continue;
Branch: 1 branch
BranchTrueFalseTotal
if (*src == control_max) continue; 16 32 48
28 32 scan_tag(src, control_max, &type, &tag);
29 32 ▶ if (type != (ASN1_UNIVERSAL | ASN1_PRIMITIVE))
Branch: 1 branch
BranchTrueFalseTotal
if (type != (ASN1_UNIVERSAL | ASN1_PRIMITIVE)) 0 32 32
30 0 croak("scan_controls: bad packet");
31 32 ▶ if (tag == ASN1_BOOLEAN) {
Branch: 1 branch
BranchTrueFalseTotal
if (tag == ASN1_BOOLEAN) { 26 6 32
32 I32 criticality;
33 26 scan_numeric_notag(src, control_max, &criticality);
34 26 ▶ if (criticality)
Branch: 1 branch
BranchTrueFalseTotal
if (criticality) 26 0 26
35 26 hv_stores(control, "criticality", newSVsv(&PL_sv_yes));
36 26 ▶ if (*src == control_max) continue;
Branch: 1 branch
BranchTrueFalseTotal
if (*src == control_max) continue; 20 6 26
37 6 scan_tag(src, control_max, &type, &tag);
38 6 ▶ if (type != (ASN1_UNIVERSAL | ASN1_PRIMITIVE))
Branch: 1 branch
BranchTrueFalseTotal
if (type != (ASN1_UNIVERSAL | ASN1_PRIMITIVE)) 0 6 6
39 0 croak("scan_controls: bad packet");
40 }
41 12 ▶ if (tag == ASN1_OCTET_STRING) {
Branch: 1 branch
BranchTrueFalseTotal
if (tag == ASN1_OCTET_STRING) { 12 0 12
42 12 sv = newSV(0);
43 12 hv_stores(control, "value", sv);
44 12 scan_raw_notag(src, control_max, sv);
45 12 ▶ if (*src == control_max) continue;
Branch: 1 branch
BranchTrueFalseTotal
if (*src == control_max) continue; 12 0 12
46 }
47 0 croak("scan_controls: bad packet");
48 }
49 32 }
« scan_delete_request.c ↑ Summary scan_compare_request.c »