OpenCoverage

x_algor.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/x_algor.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static const ASN1_TEMPLATE X509_ALGOR_seq_tt[] = {-
4 { (0), (0), -
5 __builtin_offsetof (-
6 X509_ALGOR-
7 , -
8 algorithm-
9 )-
10 , "algorithm", (&(ASN1_OBJECT_it)) },-
11 { ((0x1)), (0), -
12 __builtin_offsetof (-
13 X509_ALGOR-
14 , -
15 parameter-
16 )-
17 , "parameter", (&(ASN1_ANY_it)) }-
18} ; const ASN1_ITEM X509_ALGOR_it = { 0x1, 16, X509_ALGOR_seq_tt, sizeof(X509_ALGOR_seq_tt) / sizeof(ASN1_TEMPLATE), -
19 ((void *)0)-
20 , sizeof(X509_ALGOR), "X509_ALGOR" };-
21-
22static const ASN1_TEMPLATE X509_ALGORS_item_tt =-
23 { ((0x2 << 1)), (0), 0, "algorithms", (&(X509_ALGOR_it)) }-
24; const ASN1_ITEM X509_ALGORS_it = { 0x0, -1, &X509_ALGORS_item_tt, 0, -
25((void *)0)-
26, 0, "X509_ALGORS" };-
27-
28X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, const unsigned char **in, long len) { return
executed 6 times by 1 test: return (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGOR_it)));
Executed by:
  • libcrypto.so.1.1
(X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGOR_it)));
executed 6 times by 1 test: return (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGOR_it)));
Executed by:
  • libcrypto.so.1.1
} int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **out) { return
executed 7 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGOR_it)));
Executed by:
  • libcrypto.so.1.1
ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGOR_it)));
executed 7 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGOR_it)));
Executed by:
  • libcrypto.so.1.1
} X509_ALGOR *X509_ALGOR_new(void) { return
executed 642 times by 1 test: return (X509_ALGOR *)ASN1_item_new((&(X509_ALGOR_it)));
Executed by:
  • libcrypto.so.1.1
(X509_ALGOR *)ASN1_item_new((&(X509_ALGOR_it)));
executed 642 times by 1 test: return (X509_ALGOR *)ASN1_item_new((&(X509_ALGOR_it)));
Executed by:
  • libcrypto.so.1.1
} void X509_ALGOR_free(X509_ALGOR *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_ALGOR_it))); }
executed 6758 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6-6758
29X509_ALGORS *d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len) { return
never executed: return (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGORS_it)));
(X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGORS_it)));
never executed: return (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGORS_it)));
} int i2d_X509_ALGORS(X509_ALGORS *a, unsigned char **out) { return
executed 52 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGORS_it)));
Executed by:
  • libcrypto.so.1.1
ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGORS_it)));
executed 52 times by 1 test: return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGORS_it)));
Executed by:
  • libcrypto.so.1.1
}
0-52
30X509_ALGOR * X509_ALGOR_dup(X509_ALGOR *x) { return
never executed: return ASN1_item_dup((&(X509_ALGOR_it)), x);
ASN1_item_dup((&(X509_ALGOR_it)), x);
never executed: return ASN1_item_dup((&(X509_ALGOR_it)), x);
}
0
31-
32int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)-
33{-
34 if (alg ==
alg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15533
35 ((void *)0)
alg == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15533
36 )-
37 return
never executed: return 0;
0;
never executed: return 0;
0
38-
39 if (ptype != -1
ptype != -1Description
TRUEevaluated 15117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 416 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
416-15117
40 if (alg->parameter ==
alg->parameter == ((void *)0)Description
TRUEevaluated 15117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-15117
41 ((void *)0)
alg->parameter == ((void *)0)Description
TRUEevaluated 15117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-15117
42 )-
43 alg->parameter = ASN1_TYPE_new();
executed 15117 times by 1 test: alg->parameter = ASN1_TYPE_new();
Executed by:
  • libcrypto.so.1.1
15117
44 if (alg->parameter ==
alg->parameter == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15117
45 ((void *)0)
alg->parameter == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 15117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-15117
46 )-
47 return
never executed: return 0;
0;
never executed: return 0;
0
48 }
executed 15117 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
15117
49-
50 ASN1_OBJECT_free(alg->algorithm);-
51 alg->algorithm = aobj;-
52-
53 if (ptype == 0
ptype == 0Description
TRUEnever evaluated
FALSEevaluated 15533 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-15533
54 return
never executed: return 1;
1;
never executed: return 1;
0
55 if (ptype == -1
ptype == -1Description
TRUEevaluated 416 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15117 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
416-15117
56 ASN1_TYPE_free(alg->parameter);-
57 alg->parameter = -
58 ((void *)0)-
59 ;-
60 }
executed 416 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else
416
61 ASN1_TYPE_set(alg->parameter, ptype, pval);
executed 15117 times by 1 test: ASN1_TYPE_set(alg->parameter, ptype, pval);
Executed by:
  • libcrypto.so.1.1
15117
62 return
executed 15533 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 15533 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
15533
63}-
64-
65void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype,-
66 const void **ppval, const X509_ALGOR *algor)-
67{-
68 if (paobj
paobjDescription
TRUEevaluated 12592 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 41023 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
12592-41023
69 *
executed 12592 times by 1 test: *paobj = algor->algorithm;
Executed by:
  • libcrypto.so.1.1
paobj = algor->algorithm;
executed 12592 times by 1 test: *paobj = algor->algorithm;
Executed by:
  • libcrypto.so.1.1
12592
70 if (pptype
pptypeDescription
TRUEevaluated 53393 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 222 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
222-53393
71 if (algor->parameter ==
algor->paramet...== ((void *)0)Description
TRUEevaluated 269 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53124 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
269-53124
72 ((void *)0)
algor->paramet...== ((void *)0)Description
TRUEevaluated 269 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53124 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
269-53124
73 ) {-
74 *pptype = -1;-
75 return;
executed 269 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
269
76 } else-
77 *
executed 53124 times by 1 test: *pptype = algor->parameter->type;
Executed by:
  • libcrypto.so.1.1
pptype = algor->parameter->type;
executed 53124 times by 1 test: *pptype = algor->parameter->type;
Executed by:
  • libcrypto.so.1.1
53124
78 if (ppval
ppvalDescription
TRUEevaluated 53120 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
4-53120
79 *
executed 53120 times by 1 test: *ppval = algor->parameter->value.ptr;
Executed by:
  • libcrypto.so.1.1
ppval = algor->parameter->value.ptr;
executed 53120 times by 1 test: *ppval = algor->parameter->value.ptr;
Executed by:
  • libcrypto.so.1.1
53120
80 }
executed 53124 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
53124
81}
executed 53346 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
53346
82-
83-
84-
85void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)-
86{-
87 int param_type;-
88-
89 if (md->flags & 0x0008
md->flags & 0x0008Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-104
90 param_type = -1;
executed 104 times by 1 test: param_type = -1;
Executed by:
  • libcrypto.so.1.1
104
91 else-
92 param_type = 5;
never executed: param_type = 5;
0
93-
94 X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, -
95 ((void *)0)-
96 );-
97-
98}
executed 104 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
104
99-
100int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b)-
101{-
102 int rv;-
103 rv = OBJ_cmp(a->algorithm, b->algorithm);-
104 if (rv
rvDescription
TRUEnever evaluated
FALSEevaluated 1310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1310
105 return
never executed: return rv;
rv;
never executed: return rv;
0
106 if (!a->parameter
!a->parameterDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1258 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !b->parameter
!b->parameterDescription
TRUEevaluated 52 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-1258
107 return
executed 52 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 52 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
52
108 return
executed 1258 times by 1 test: return ASN1_TYPE_cmp(a->parameter, b->parameter);
Executed by:
  • libcrypto.so.1.1
ASN1_TYPE_cmp(a->parameter, b->parameter);
executed 1258 times by 1 test: return ASN1_TYPE_cmp(a->parameter, b->parameter);
Executed by:
  • libcrypto.so.1.1
1258
109}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2