scan_bind_request.c

filter: Statementstmt 50.0% 16 / 32 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 44.7% 17 / 38 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« pack_tag.c ↑ Summary pack_bind_request.c »
1 #include "scan.h"
2 #include "enum2sv.h"
3  
4 void
5 2 scan_bind_request(const char** src, const char* max, HV *out) {
6 U8 type;
7 I32 version;
8 U32 method;
9 2 SV *dn = newSV(0);
10 2 hv_stores(out, "dn", dn);
11  
12 2 scan_int(src, max, &version);
13 2 hv_stores(out, "version", newSViv(version));
14  
15 2 scan_string_utf8(src, max, dn);
16  
17 2 scan_tag(src, max, &type, &method);
18 2 hv_stores(out, "method", newSVsv(ldap_auth2sv_noinc(method)));
19  
20 2 switch (method) {
21 2 case 0:
22 {
23 STRLEN len;
24 SV *sv;
25 2 ▶ if (type != (ASN1_CONTEXT_SPECIFIC | ASN1_PRIMITIVE))
Branch: 1 branch
BranchTrueFalseTotal
if (type != (ASN1_CONTEXT_SPECIFIC | ASN1_PRIMITIVE)) 0 2 2
26 0 croak("scan_bind_request: bad value type: %u, method: %u",
27 type, (unsigned int)method);
28  
29 2 sv = newSV(0);
30 2 hv_stores(out, "password", sv);
31 2 scan_raw_utf8_notag(src, max, sv);
32 2 break;
33 }
34 0 case 3:
35 {
36 STRLEN len;
37 SV *sv;
38 0 ▶ if (type != (ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED))
Branch: 1 branch
BranchTrueFalseTotal
if (type != (ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED)) 0 0 0
39 0 croak("scan_bind_request: bad value type: %u, method: %u",
40 type, (unsigned int)method);
41  
42 0 scan_length(src, max, &len);
43 0 max = *src + len;
44 0 sv = newSV(0);
45 0 hv_stores(out, "sasl_mechanism", sv);
46 0 scan_string_utf8(src, max, sv);
47 0 ▶ if (*src < max) {
Branch: 1 branch
BranchTrueFalseTotal
if (*src < max) { 0 0 0
48 0 sv = newSV(0);
49 0 hv_stores(out, "sasl_credentials", sv);
50 0 scan_string(src, max, sv);
51 }
52 0 break;
53 }
54 0 default:
55 0 croak("scan_bind_request: unknown authentication");
56 break;
57 }
58 2 }
« pack_tag.c ↑ Summary pack_bind_request.c »