Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/pkcs7/pk7_attr.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, | - | ||||||||||||
5 | struct stack_st_X509_ALGOR *cap) | - | ||||||||||||
6 | { | - | ||||||||||||
7 | ASN1_STRING *seq; | - | ||||||||||||
8 | - | |||||||||||||
9 | if ((
| 0-20 | ||||||||||||
10 | ((void *)0)
| 0-20 | ||||||||||||
11 | ) { | - | ||||||||||||
12 | ERR_put_error(33,(118),((1|64)),__FILE__,26); | - | ||||||||||||
13 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
14 | } | - | ||||||||||||
15 | seq->length = ASN1_item_i2d((ASN1_VALUE *)cap, &seq->data, | - | ||||||||||||
16 | (&(X509_ALGORS_it))); | - | ||||||||||||
17 | return executed 20 times by 1 test: PKCS7_add_signed_attribute(si, 167,return PKCS7_add_signed_attribute(si, 167, 16, seq); Executed by:
executed 20 times by 1 test: return PKCS7_add_signed_attribute(si, 167, 16, seq); Executed by:
| 20 | ||||||||||||
18 | 16, seq); executed 20 times by 1 test: return PKCS7_add_signed_attribute(si, 167, 16, seq); Executed by:
| 20 | ||||||||||||
19 | } | - | ||||||||||||
20 | - | |||||||||||||
21 | struct stack_st_X509_ALGOR *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si) | - | ||||||||||||
22 | { | - | ||||||||||||
23 | ASN1_TYPE *cap; | - | ||||||||||||
24 | const unsigned char *p; | - | ||||||||||||
25 | - | |||||||||||||
26 | cap = PKCS7_get_signed_attribute(si, 167); | - | ||||||||||||
27 | if (cap ==
| 0 | ||||||||||||
28 | ((void *)0)
| 0 | ||||||||||||
29 | || (
| 0 | ||||||||||||
30 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||
31 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||
32 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||
33 | p = cap->value.sequence->data; | - | ||||||||||||
34 | return never executed: (struct stack_st_X509_ALGOR *)return (struct stack_st_X509_ALGOR *) ASN1_item_d2i( ((void *)0) , &p, cap->value.sequence->length, (&(X509_ALGORS_it))); never executed: return (struct stack_st_X509_ALGOR *) ASN1_item_d2i( ((void *)0) , &p, cap->value.sequence->length, (&(X509_ALGORS_it))); | 0 | ||||||||||||
35 | ASN1_item_d2i( never executed: return (struct stack_st_X509_ALGOR *) ASN1_item_d2i( ((void *)0) , &p, cap->value.sequence->length, (&(X509_ALGORS_it))); | 0 | ||||||||||||
36 | ((void *)0) never executed: return (struct stack_st_X509_ALGOR *) ASN1_item_d2i( ((void *)0) , &p, cap->value.sequence->length, (&(X509_ALGORS_it))); | 0 | ||||||||||||
37 | , &p, cap->value.sequence->length, never executed: return (struct stack_st_X509_ALGOR *) ASN1_item_d2i( ((void *)0) , &p, cap->value.sequence->length, (&(X509_ALGORS_it))); | 0 | ||||||||||||
38 | (&(X509_ALGORS_it))); never executed: return (struct stack_st_X509_ALGOR *) ASN1_item_d2i( ((void *)0) , &p, cap->value.sequence->length, (&(X509_ALGORS_it))); | 0 | ||||||||||||
39 | } | - | ||||||||||||
40 | - | |||||||||||||
41 | - | |||||||||||||
42 | int PKCS7_simple_smimecap(struct stack_st_X509_ALGOR *sk, int nid, int arg) | - | ||||||||||||
43 | { | - | ||||||||||||
44 | ASN1_INTEGER *nbit = | - | ||||||||||||
45 | ((void *)0) | - | ||||||||||||
46 | ; | - | ||||||||||||
47 | X509_ALGOR *alg; | - | ||||||||||||
48 | - | |||||||||||||
49 | if ((
| 0-160 | ||||||||||||
50 | ((void *)0)
| 0-160 | ||||||||||||
51 | ) { | - | ||||||||||||
52 | ERR_put_error(33,(119),((1|64)),__FILE__,56); | - | ||||||||||||
53 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
54 | } | - | ||||||||||||
55 | ASN1_OBJECT_free(alg->algorithm); | - | ||||||||||||
56 | alg->algorithm = OBJ_nid2obj(nid); | - | ||||||||||||
57 | if (arg > 0
| 60-100 | ||||||||||||
58 | if ((
| 0-60 | ||||||||||||
59 | ((void *)0)
| 0-60 | ||||||||||||
60 | ) { | - | ||||||||||||
61 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
62 | } | - | ||||||||||||
63 | if ((
| 0-60 | ||||||||||||
64 | ((void *)0)
| 0-60 | ||||||||||||
65 | ) { | - | ||||||||||||
66 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
67 | } | - | ||||||||||||
68 | if (!ASN1_INTEGER_set(nbit, arg)
| 0-60 | ||||||||||||
69 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
70 | } | - | ||||||||||||
71 | alg->parameter->value.integer = nbit; | - | ||||||||||||
72 | alg->parameter->type = 2; | - | ||||||||||||
73 | nbit = | - | ||||||||||||
74 | ((void *)0) | - | ||||||||||||
75 | ; | - | ||||||||||||
76 | } executed 60 times by 1 test: end of block Executed by:
| 60 | ||||||||||||
77 | if (!sk_X509_ALGOR_push(sk, alg)
| 0-160 | ||||||||||||
78 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||
79 | } | - | ||||||||||||
80 | return executed 160 times by 1 test: 1;return 1; Executed by:
executed 160 times by 1 test: return 1; Executed by:
| 160 | ||||||||||||
81 | err: | - | ||||||||||||
82 | ERR_put_error(33,(119),((1|64)),__FILE__,80); | - | ||||||||||||
83 | ASN1_INTEGER_free(nbit); | - | ||||||||||||
84 | X509_ALGOR_free(alg); | - | ||||||||||||
85 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
86 | } | - | ||||||||||||
87 | - | |||||||||||||
88 | int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid) | - | ||||||||||||
89 | { | - | ||||||||||||
90 | if (PKCS7_get_signed_attribute(si, 50)
| 0-20 | ||||||||||||
91 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
92 | if (!coid
| 0-20 | ||||||||||||
93 | coid = OBJ_nid2obj(21); executed 20 times by 1 test: coid = OBJ_nid2obj(21); Executed by:
| 20 | ||||||||||||
94 | return executed 20 times by 1 test: PKCS7_add_signed_attribute(si, 50,return PKCS7_add_signed_attribute(si, 50, 6, coid); Executed by:
executed 20 times by 1 test: return PKCS7_add_signed_attribute(si, 50, 6, coid); Executed by:
| 20 | ||||||||||||
95 | 6, coid); executed 20 times by 1 test: return PKCS7_add_signed_attribute(si, 50, 6, coid); Executed by:
| 20 | ||||||||||||
96 | } | - | ||||||||||||
97 | - | |||||||||||||
98 | int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t) | - | ||||||||||||
99 | { | - | ||||||||||||
100 | if (t ==
| 0-19 | ||||||||||||
101 | ((void *)0)
| 0-19 | ||||||||||||
102 | && (
| 0-19 | ||||||||||||
103 | ((void *)0)
| 0-19 | ||||||||||||
104 | , 0)) ==
| 0-19 | ||||||||||||
105 | ((void *)0)
| 0-19 | ||||||||||||
106 | ) { | - | ||||||||||||
107 | ERR_put_error(33,(135),((1|64)),__FILE__,100) | - | ||||||||||||
108 | ; | - | ||||||||||||
109 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
110 | } | - | ||||||||||||
111 | return executed 19 times by 1 test: PKCS7_add_signed_attribute(si, 52,return PKCS7_add_signed_attribute(si, 52, 23, t); Executed by:
executed 19 times by 1 test: return PKCS7_add_signed_attribute(si, 52, 23, t); Executed by:
| 19 | ||||||||||||
112 | 23, t); executed 19 times by 1 test: return PKCS7_add_signed_attribute(si, 52, 23, t); Executed by:
| 19 | ||||||||||||
113 | } | - | ||||||||||||
114 | - | |||||||||||||
115 | int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, | - | ||||||||||||
116 | const unsigned char *md, int mdlen) | - | ||||||||||||
117 | { | - | ||||||||||||
118 | ASN1_OCTET_STRING *os; | - | ||||||||||||
119 | os = ASN1_OCTET_STRING_new(); | - | ||||||||||||
120 | if (os ==
| 0-20 | ||||||||||||
121 | ((void *)0)
| 0-20 | ||||||||||||
122 | ) | - | ||||||||||||
123 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
124 | if (!ASN1_STRING_set(os, md, mdlen)
| 0-20 | ||||||||||||
125 | || !PKCS7_add_signed_attribute(si, 51,
| 0-20 | ||||||||||||
126 | 4, os)
| 0-20 | ||||||||||||
127 | ASN1_OCTET_STRING_free(os); | - | ||||||||||||
128 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
129 | } | - | ||||||||||||
130 | return executed 20 times by 1 test: 1;return 1; Executed by:
executed 20 times by 1 test: return 1; Executed by:
| 20 | ||||||||||||
131 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |