OpenCoverage

dh_asn1.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/dh/dh_asn1.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5static int-
6dh_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)-
7{-
8 if (operation == 0
operation == 0Description
TRUEevaluated 140 times by 1 test
Evaluated by:
  • ssltest
FALSEevaluated 700 times by 1 test
Evaluated by:
  • ssltest
) {
140-700
9 *pval = (ASN1_VALUE *)DH_new();-
10 if (*
*pvalDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • ssltest
FALSEnever evaluated
pval
*pvalDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • ssltest
FALSEnever evaluated
)
0-140
11 return
executed 140 times by 1 test: return 2;
Executed by:
  • ssltest
2;
executed 140 times by 1 test: return 2;
Executed by:
  • ssltest
140
12 return
never executed: return 0;
0;
never executed: return 0;
0
13 } else if (operation == 2
operation == 2Description
TRUEnever evaluated
FALSEevaluated 700 times by 1 test
Evaluated by:
  • ssltest
) {
0-700
14 DH_free((DH *)*pval);-
15 *pval = -
16 ((void *)0)-
17 ;-
18 return
never executed: return 2;
2;
never executed: return 2;
0
19 }-
20 return
executed 700 times by 1 test: return 1;
Executed by:
  • ssltest
1;
executed 700 times by 1 test: return 1;
Executed by:
  • ssltest
700
21}-
22-
23static const ASN1_AUX DHparams_aux = {-
24 .app_data = -
25 ((void *)0)-
26 ,-
27 .flags = 0,-
28 .ref_offset = 0,-
29 .ref_lock = 0,-
30 .asn1_cb = dh_cb,-
31 .enc_offset = 0,-
32};-
33static const ASN1_TEMPLATE DHparams_seq_tt[] = {-
34 {-
35 .flags = 0,-
36 .tag = 0,-
37 .offset = -
38 __builtin_offsetof (-
39 DH-
40 , -
41 p-
42 )-
43 ,-
44 .field_name = "p",-
45 .item = &BIGNUM_it,-
46 },-
47 {-
48 .flags = 0,-
49 .tag = 0,-
50 .offset = -
51 __builtin_offsetof (-
52 DH-
53 , -
54 g-
55 )-
56 ,-
57 .field_name = "g",-
58 .item = &BIGNUM_it,-
59 },-
60 {-
61 .flags = (0x1),-
62 .tag = 0,-
63 .offset = -
64 __builtin_offsetof (-
65 DH-
66 , -
67 length-
68 )-
69 ,-
70 .field_name = "length",-
71 .item = &ZLONG_it,-
72 },-
73};-
74-
75const ASN1_ITEM DHparams_it = {-
76 .itype = 0x1,-
77 .utype = 16,-
78 .templates = DHparams_seq_tt,-
79 .tcount = sizeof(DHparams_seq_tt) / sizeof(ASN1_TEMPLATE),-
80 .funcs = &DHparams_aux,-
81 .size = sizeof(DH),-
82 .sname = "DH",-
83};-
84-
85-
86DH *-
87d2i_DHparams(DH **a, const unsigned char **in, long len)-
88{-
89 return
never executed: return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &DHparams_it);
(DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
never executed: return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &DHparams_it);
0
90 &DHparams_it);
never executed: return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &DHparams_it);
0
91}-
92-
93int-
94i2d_DHparams(const DH *a, unsigned char **out)-
95{-
96 return
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it);
ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it);
never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it);
0
97}-
98-
99DH *-
100d2i_DHparams_bio(BIO *bp, DH **a)-
101{-
102 return
never executed: return ASN1_item_d2i_bio(&DHparams_it, bp, a);
ASN1_item_d2i_bio(&DHparams_it, bp, a);
never executed: return ASN1_item_d2i_bio(&DHparams_it, bp, a);
0
103}-
104-
105int-
106i2d_DHparams_bio(BIO *bp, DH *a)-
107{-
108 return
never executed: return ASN1_item_i2d_bio(&DHparams_it, bp, a);
ASN1_item_i2d_bio(&DHparams_it, bp, a);
never executed: return ASN1_item_i2d_bio(&DHparams_it, bp, a);
0
109}-
110-
111DH *-
112d2i_DHparams_fp(FILE *fp, DH **a)-
113{-
114 return
never executed: return ASN1_item_d2i_fp(&DHparams_it, fp, a);
ASN1_item_d2i_fp(&DHparams_it, fp, a);
never executed: return ASN1_item_d2i_fp(&DHparams_it, fp, a);
0
115}-
116-
117int-
118i2d_DHparams_fp(FILE *fp, DH *a)-
119{-
120 return
never executed: return ASN1_item_i2d_fp(&DHparams_it, fp, a);
ASN1_item_i2d_fp(&DHparams_it, fp, a);
never executed: return ASN1_item_i2d_fp(&DHparams_it, fp, a);
0
121}-
122-
123DH *-
124DHparams_dup(DH *dh)-
125{-
126 return
executed 140 times by 1 test: return ASN1_item_dup(&DHparams_it, dh);
Executed by:
  • ssltest
ASN1_item_dup(&DHparams_it, dh);
executed 140 times by 1 test: return ASN1_item_dup(&DHparams_it, dh);
Executed by:
  • ssltest
140
127}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2