Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_i2d_fp.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x) | - | ||||||||||||
7 | { | - | ||||||||||||
8 | BIO *b; | - | ||||||||||||
9 | int ret; | - | ||||||||||||
10 | - | |||||||||||||
11 | if ((
| 0 | ||||||||||||
12 | ((void *)0)
| 0 | ||||||||||||
13 | ) { | - | ||||||||||||
14 | ERR_put_error(13,(117),(7),__FILE__,24); | - | ||||||||||||
15 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
16 | } | - | ||||||||||||
17 | BIO_ctrl(b,106,0x00,(char *)(out)); | - | ||||||||||||
18 | ret = ASN1_i2d_bio(i2d, b, x); | - | ||||||||||||
19 | BIO_free(b); | - | ||||||||||||
20 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||
21 | } | - | ||||||||||||
22 | - | |||||||||||||
23 | - | |||||||||||||
24 | int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x) | - | ||||||||||||
25 | { | - | ||||||||||||
26 | char *b; | - | ||||||||||||
27 | unsigned char *p; | - | ||||||||||||
28 | int i, j = 0, n, ret = 1; | - | ||||||||||||
29 | - | |||||||||||||
30 | n = i2d(x, | - | ||||||||||||
31 | ((void *)0) | - | ||||||||||||
32 | ); | - | ||||||||||||
33 | if (n <= 0
| 0-29 | ||||||||||||
34 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
35 | - | |||||||||||||
36 | b = CRYPTO_malloc(n, __FILE__, 44); | - | ||||||||||||
37 | if (b ==
| 0-29 | ||||||||||||
38 | ((void *)0)
| 0-29 | ||||||||||||
39 | ) { | - | ||||||||||||
40 | ERR_put_error(13,(116),((1|64)),__FILE__,46); | - | ||||||||||||
41 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
42 | } | - | ||||||||||||
43 | - | |||||||||||||
44 | p = (unsigned char *)b; | - | ||||||||||||
45 | i2d(x, &p); | - | ||||||||||||
46 | - | |||||||||||||
47 | for (;;) { | - | ||||||||||||
48 | i = BIO_write(out, &(b[j]), n); | - | ||||||||||||
49 | if (i == n
| 0-29 | ||||||||||||
50 | break; executed 29 times by 1 test: break; Executed by:
| 29 | ||||||||||||
51 | if (i <= 0
| 0 | ||||||||||||
52 | ret = 0; | - | ||||||||||||
53 | break; never executed: break; | 0 | ||||||||||||
54 | } | - | ||||||||||||
55 | j += i; | - | ||||||||||||
56 | n -= i; | - | ||||||||||||
57 | } never executed: end of block | 0 | ||||||||||||
58 | CRYPTO_free(b, __FILE__, 64); | - | ||||||||||||
59 | return executed 29 times by 1 test: ret;return ret; Executed by:
executed 29 times by 1 test: return ret; Executed by:
| 29 | ||||||||||||
60 | } | - | ||||||||||||
61 | - | |||||||||||||
62 | - | |||||||||||||
63 | - | |||||||||||||
64 | - | |||||||||||||
65 | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x) | - | ||||||||||||
66 | { | - | ||||||||||||
67 | BIO *b; | - | ||||||||||||
68 | int ret; | - | ||||||||||||
69 | - | |||||||||||||
70 | if ((
| 0 | ||||||||||||
71 | ((void *)0)
| 0 | ||||||||||||
72 | ) { | - | ||||||||||||
73 | ERR_put_error(13,(193),(7),__FILE__,77); | - | ||||||||||||
74 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
75 | } | - | ||||||||||||
76 | BIO_ctrl(b,106,0x00,(char *)(out)); | - | ||||||||||||
77 | ret = ASN1_item_i2d_bio(it, b, x); | - | ||||||||||||
78 | BIO_free(b); | - | ||||||||||||
79 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||
80 | } | - | ||||||||||||
81 | - | |||||||||||||
82 | - | |||||||||||||
83 | int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x) | - | ||||||||||||
84 | { | - | ||||||||||||
85 | unsigned char *b = | - | ||||||||||||
86 | ((void *)0) | - | ||||||||||||
87 | ; | - | ||||||||||||
88 | int i, j = 0, n, ret = 1; | - | ||||||||||||
89 | - | |||||||||||||
90 | n = ASN1_item_i2d(x, &b, it); | - | ||||||||||||
91 | if (b ==
| 0-333 | ||||||||||||
92 | ((void *)0)
| 0-333 | ||||||||||||
93 | ) { | - | ||||||||||||
94 | ERR_put_error(13,(192),((1|64)),__FILE__,94); | - | ||||||||||||
95 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
96 | } | - | ||||||||||||
97 | - | |||||||||||||
98 | for (;;) { | - | ||||||||||||
99 | i = BIO_write(out, &(b[j]), n); | - | ||||||||||||
100 | if (i == n
| 0-333 | ||||||||||||
101 | break; executed 333 times by 1 test: break; Executed by:
| 333 | ||||||||||||
102 | if (i <= 0
| 0 | ||||||||||||
103 | ret = 0; | - | ||||||||||||
104 | break; never executed: break; | 0 | ||||||||||||
105 | } | - | ||||||||||||
106 | j += i; | - | ||||||||||||
107 | n -= i; | - | ||||||||||||
108 | } never executed: end of block | 0 | ||||||||||||
109 | CRYPTO_free(b, __FILE__, 109); | - | ||||||||||||
110 | return executed 333 times by 1 test: ret;return ret; Executed by:
executed 333 times by 1 test: return ret; Executed by:
| 333 | ||||||||||||
111 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |