Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/x_algor.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | static 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 | - | |||||||||||||
22 | static 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 | - | |||||||||||||
28 | X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, const unsigned char **in, long len) { return executed 6 times by 1 test: (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGOR_it)));return (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGOR_it))); Executed by:
executed 6 times by 1 test: } int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **out) { returnreturn (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGOR_it))); Executed by:
executed 7 times by 1 test: ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGOR_it)));return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGOR_it))); Executed by:
executed 7 times by 1 test: } X509_ALGOR *X509_ALGOR_new(void) { returnreturn ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGOR_it))); Executed by:
executed 642 times by 1 test: (X509_ALGOR *)ASN1_item_new((&(X509_ALGOR_it)));return (X509_ALGOR *)ASN1_item_new((&(X509_ALGOR_it))); Executed by:
executed 642 times by 1 test: } void X509_ALGOR_free(X509_ALGOR *a) { ASN1_item_free((ASN1_VALUE *)a, (&(X509_ALGOR_it))); }return (X509_ALGOR *)ASN1_item_new((&(X509_ALGOR_it))); Executed by:
executed 6758 times by 1 test: end of block Executed by:
| 6-6758 | ||||||||||||
29 | X509_ALGORS *d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len) { return never executed: (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGORS_it)));return (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGORS_it))); never executed: } int i2d_X509_ALGORS(X509_ALGORS *a, unsigned char **out) { returnreturn (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, (&(X509_ALGORS_it))); executed 52 times by 1 test: ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGORS_it)));return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGORS_it))); Executed by:
executed 52 times by 1 test: }return ASN1_item_i2d((ASN1_VALUE *)a, out, (&(X509_ALGORS_it))); Executed by:
| 0-52 | ||||||||||||
30 | X509_ALGOR * X509_ALGOR_dup(X509_ALGOR *x) { return never executed: ASN1_item_dup((&(X509_ALGOR_it)), x);return ASN1_item_dup((&(X509_ALGOR_it)), x); never executed: }return ASN1_item_dup((&(X509_ALGOR_it)), x); | 0 | ||||||||||||
31 | - | |||||||||||||
32 | int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) | - | ||||||||||||
33 | { | - | ||||||||||||
34 | if (alg ==
| 0-15533 | ||||||||||||
35 | ((void *)0)
| 0-15533 | ||||||||||||
36 | ) | - | ||||||||||||
37 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
38 | - | |||||||||||||
39 | if (ptype != -1
| 416-15117 | ||||||||||||
40 | if (alg->parameter ==
| 0-15117 | ||||||||||||
41 | ((void *)0)
| 0-15117 | ||||||||||||
42 | ) | - | ||||||||||||
43 | alg->parameter = ASN1_TYPE_new(); executed 15117 times by 1 test: alg->parameter = ASN1_TYPE_new(); Executed by:
| 15117 | ||||||||||||
44 | if (alg->parameter ==
| 0-15117 | ||||||||||||
45 | ((void *)0)
| 0-15117 | ||||||||||||
46 | ) | - | ||||||||||||
47 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
48 | } executed 15117 times by 1 test: end of block Executed by:
| 15117 | ||||||||||||
49 | - | |||||||||||||
50 | ASN1_OBJECT_free(alg->algorithm); | - | ||||||||||||
51 | alg->algorithm = aobj; | - | ||||||||||||
52 | - | |||||||||||||
53 | if (ptype == 0
| 0-15533 | ||||||||||||
54 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||
55 | if (ptype == -1
| 416-15117 | ||||||||||||
56 | ASN1_TYPE_free(alg->parameter); | - | ||||||||||||
57 | alg->parameter = | - | ||||||||||||
58 | ((void *)0) | - | ||||||||||||
59 | ; | - | ||||||||||||
60 | } executed 416 times by 1 test: elseend of block Executed by:
| 416 | ||||||||||||
61 | ASN1_TYPE_set(alg->parameter, ptype, pval); executed 15117 times by 1 test: ASN1_TYPE_set(alg->parameter, ptype, pval); Executed by:
| 15117 | ||||||||||||
62 | return executed 15533 times by 1 test: 1;return 1; Executed by:
executed 15533 times by 1 test: return 1; Executed by:
| 15533 | ||||||||||||
63 | } | - | ||||||||||||
64 | - | |||||||||||||
65 | void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, | - | ||||||||||||
66 | const void **ppval, const X509_ALGOR *algor) | - | ||||||||||||
67 | { | - | ||||||||||||
68 | if (paobj
| 12592-41023 | ||||||||||||
69 | * executed 12592 times by 1 test: paobj = algor->algorithm;*paobj = algor->algorithm; Executed by:
executed 12592 times by 1 test: *paobj = algor->algorithm; Executed by:
| 12592 | ||||||||||||
70 | if (pptype
| 222-53393 | ||||||||||||
71 | if (algor->parameter ==
| 269-53124 | ||||||||||||
72 | ((void *)0)
| 269-53124 | ||||||||||||
73 | ) { | - | ||||||||||||
74 | *pptype = -1; | - | ||||||||||||
75 | return; executed 269 times by 1 test: return; Executed by:
| 269 | ||||||||||||
76 | } else | - | ||||||||||||
77 | * executed 53124 times by 1 test: pptype = algor->parameter->type;*pptype = algor->parameter->type; Executed by:
executed 53124 times by 1 test: *pptype = algor->parameter->type; Executed by:
| 53124 | ||||||||||||
78 | if (ppval
| 4-53120 | ||||||||||||
79 | * executed 53120 times by 1 test: ppval = algor->parameter->value.ptr;*ppval = algor->parameter->value.ptr; Executed by:
executed 53120 times by 1 test: *ppval = algor->parameter->value.ptr; Executed by:
| 53120 | ||||||||||||
80 | } executed 53124 times by 1 test: end of block Executed by:
| 53124 | ||||||||||||
81 | } executed 53346 times by 1 test: end of block Executed by:
| 53346 | ||||||||||||
82 | - | |||||||||||||
83 | - | |||||||||||||
84 | - | |||||||||||||
85 | void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) | - | ||||||||||||
86 | { | - | ||||||||||||
87 | int param_type; | - | ||||||||||||
88 | - | |||||||||||||
89 | if (md->flags & 0x0008
| 0-104 | ||||||||||||
90 | param_type = -1; executed 104 times by 1 test: param_type = -1; Executed by:
| 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:
| 104 | ||||||||||||
99 | - | |||||||||||||
100 | int 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
| 0-1310 | ||||||||||||
105 | return never executed: rv;return rv; never executed: return rv; | 0 | ||||||||||||
106 | if (!a->parameter
| 0-1258 | ||||||||||||
107 | return executed 52 times by 1 test: 0;return 0; Executed by:
executed 52 times by 1 test: return 0; Executed by:
| 52 | ||||||||||||
108 | return executed 1258 times by 1 test: ASN1_TYPE_cmp(a->parameter, b->parameter);return ASN1_TYPE_cmp(a->parameter, b->parameter); Executed by:
executed 1258 times by 1 test: return ASN1_TYPE_cmp(a->parameter, b->parameter); Executed by:
| 1258 | ||||||||||||
109 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |