| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/x_attrib.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | static const ASN1_TEMPLATE X509_ATTRIBUTE_SET_ch_tt[] = { | - | ||||||||||||
| 3 | { | - | ||||||||||||
| 4 | .flags = (0x1 << 1), | - | ||||||||||||
| 5 | .tag = 0, | - | ||||||||||||
| 6 | .offset = | - | ||||||||||||
| 7 | __builtin_offsetof ( | - | ||||||||||||
| 8 | X509_ATTRIBUTE | - | ||||||||||||
| 9 | , | - | ||||||||||||
| 10 | value.set | - | ||||||||||||
| 11 | ) | - | ||||||||||||
| 12 | , | - | ||||||||||||
| 13 | .field_name = "value.set", | - | ||||||||||||
| 14 | .item = &ASN1_ANY_it, | - | ||||||||||||
| 15 | }, | - | ||||||||||||
| 16 | { | - | ||||||||||||
| 17 | .flags = 0, | - | ||||||||||||
| 18 | .tag = 0, | - | ||||||||||||
| 19 | .offset = | - | ||||||||||||
| 20 | __builtin_offsetof ( | - | ||||||||||||
| 21 | X509_ATTRIBUTE | - | ||||||||||||
| 22 | , | - | ||||||||||||
| 23 | value.single | - | ||||||||||||
| 24 | ) | - | ||||||||||||
| 25 | , | - | ||||||||||||
| 26 | .field_name = "value.single", | - | ||||||||||||
| 27 | .item = &ASN1_ANY_it, | - | ||||||||||||
| 28 | }, | - | ||||||||||||
| 29 | }; | - | ||||||||||||
| 30 | - | |||||||||||||
| 31 | const ASN1_ITEM X509_ATTRIBUTE_SET_it = { | - | ||||||||||||
| 32 | .itype = 0x2, | - | ||||||||||||
| 33 | .utype = | - | ||||||||||||
| 34 | __builtin_offsetof ( | - | ||||||||||||
| 35 | X509_ATTRIBUTE | - | ||||||||||||
| 36 | , | - | ||||||||||||
| 37 | single | - | ||||||||||||
| 38 | ) | - | ||||||||||||
| 39 | , | - | ||||||||||||
| 40 | .templates = X509_ATTRIBUTE_SET_ch_tt, | - | ||||||||||||
| 41 | .tcount = sizeof(X509_ATTRIBUTE_SET_ch_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||||||||
| 42 | .funcs = | - | ||||||||||||
| 43 | ((void *)0) | - | ||||||||||||
| 44 | , | - | ||||||||||||
| 45 | .size = sizeof(X509_ATTRIBUTE), | - | ||||||||||||
| 46 | .sname = "X509_ATTRIBUTE", | - | ||||||||||||
| 47 | }; | - | ||||||||||||
| 48 | - | |||||||||||||
| 49 | static const ASN1_TEMPLATE X509_ATTRIBUTE_seq_tt[] = { | - | ||||||||||||
| 50 | { | - | ||||||||||||
| 51 | .flags = 0, | - | ||||||||||||
| 52 | .tag = 0, | - | ||||||||||||
| 53 | .offset = | - | ||||||||||||
| 54 | __builtin_offsetof ( | - | ||||||||||||
| 55 | X509_ATTRIBUTE | - | ||||||||||||
| 56 | , | - | ||||||||||||
| 57 | object | - | ||||||||||||
| 58 | ) | - | ||||||||||||
| 59 | , | - | ||||||||||||
| 60 | .field_name = "object", | - | ||||||||||||
| 61 | .item = &ASN1_OBJECT_it, | - | ||||||||||||
| 62 | }, | - | ||||||||||||
| 63 | - | |||||||||||||
| 64 | { | - | ||||||||||||
| 65 | .flags = 0 | (0x1<<10), | - | ||||||||||||
| 66 | .tag = 0, | - | ||||||||||||
| 67 | .offset = 0, | - | ||||||||||||
| 68 | .field_name = | - | ||||||||||||
| 69 | ((void *)0) | - | ||||||||||||
| 70 | , | - | ||||||||||||
| 71 | .item = &X509_ATTRIBUTE_SET_it, | - | ||||||||||||
| 72 | }, | - | ||||||||||||
| 73 | }; | - | ||||||||||||
| 74 | - | |||||||||||||
| 75 | const ASN1_ITEM X509_ATTRIBUTE_it = { | - | ||||||||||||
| 76 | .itype = 0x1, | - | ||||||||||||
| 77 | .utype = 16, | - | ||||||||||||
| 78 | .templates = X509_ATTRIBUTE_seq_tt, | - | ||||||||||||
| 79 | .tcount = sizeof(X509_ATTRIBUTE_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||||||||
| 80 | .funcs = | - | ||||||||||||
| 81 | ((void *)0) | - | ||||||||||||
| 82 | , | - | ||||||||||||
| 83 | .size = sizeof(X509_ATTRIBUTE), | - | ||||||||||||
| 84 | .sname = "X509_ATTRIBUTE", | - | ||||||||||||
| 85 | }; | - | ||||||||||||
| 86 | - | |||||||||||||
| 87 | - | |||||||||||||
| 88 | X509_ATTRIBUTE * | - | ||||||||||||
| 89 | d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, const unsigned char **in, long len) | - | ||||||||||||
| 90 | { | - | ||||||||||||
| 91 | return never executed: (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_ATTRIBUTE_it);never executed: return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_ATTRIBUTE_it); | 0 | ||||||||||||
| 92 | &X509_ATTRIBUTE_it); never executed: return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_ATTRIBUTE_it); | 0 | ||||||||||||
| 93 | } | - | ||||||||||||
| 94 | - | |||||||||||||
| 95 | int | - | ||||||||||||
| 96 | i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **out) | - | ||||||||||||
| 97 | { | - | ||||||||||||
| 98 | return never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ATTRIBUTE_it);return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ATTRIBUTE_it);never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ATTRIBUTE_it); | 0 | ||||||||||||
| 99 | } | - | ||||||||||||
| 100 | - | |||||||||||||
| 101 | X509_ATTRIBUTE * | - | ||||||||||||
| 102 | X509_ATTRIBUTE_new(void) | - | ||||||||||||
| 103 | { | - | ||||||||||||
| 104 | return executed 8 times by 1 test: (X509_ATTRIBUTE *)ASN1_item_new(&X509_ATTRIBUTE_it);return (X509_ATTRIBUTE *)ASN1_item_new(&X509_ATTRIBUTE_it);Executed by:
executed 8 times by 1 test: return (X509_ATTRIBUTE *)ASN1_item_new(&X509_ATTRIBUTE_it);Executed by:
| 8 | ||||||||||||
| 105 | } | - | ||||||||||||
| 106 | - | |||||||||||||
| 107 | void | - | ||||||||||||
| 108 | X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) | - | ||||||||||||
| 109 | { | - | ||||||||||||
| 110 | ASN1_item_free((ASN1_VALUE *)a, &X509_ATTRIBUTE_it); | - | ||||||||||||
| 111 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 112 | - | |||||||||||||
| 113 | X509_ATTRIBUTE * | - | ||||||||||||
| 114 | X509_ATTRIBUTE_dup(X509_ATTRIBUTE *x) | - | ||||||||||||
| 115 | { | - | ||||||||||||
| 116 | return never executed: ASN1_item_dup(&X509_ATTRIBUTE_it, x);return ASN1_item_dup(&X509_ATTRIBUTE_it, x);never executed: return ASN1_item_dup(&X509_ATTRIBUTE_it, x); | 0 | ||||||||||||
| 117 | } | - | ||||||||||||
| 118 | - | |||||||||||||
| 119 | X509_ATTRIBUTE * | - | ||||||||||||
| 120 | X509_ATTRIBUTE_create(int nid, int atrtype, void *value) | - | ||||||||||||
| 121 | { | - | ||||||||||||
| 122 | X509_ATTRIBUTE *ret = | - | ||||||||||||
| 123 | ((void *)0) | - | ||||||||||||
| 124 | ; | - | ||||||||||||
| 125 | ASN1_TYPE *val = | - | ||||||||||||
| 126 | ((void *)0) | - | ||||||||||||
| 127 | ; | - | ||||||||||||
| 128 | - | |||||||||||||
| 129 | if ((
| 0-8 | ||||||||||||
| 130 | ((void *)0)
| 0-8 | ||||||||||||
| 131 | ) | - | ||||||||||||
| 132 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||
| 133 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||
| 134 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||
| 135 | ret->object = OBJ_nid2obj(nid); | - | ||||||||||||
| 136 | ret->single = 0; | - | ||||||||||||
| 137 | if ((
| 0-8 | ||||||||||||
| 138 | ((void *)0)
| 0-8 | ||||||||||||
| 139 | ) | - | ||||||||||||
| 140 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 141 | if ((
| 0-8 | ||||||||||||
| 142 | ((void *)0)
| 0-8 | ||||||||||||
| 143 | ) | - | ||||||||||||
| 144 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 145 | if (!sk_push(((_STACK*) (1 ? (ret->value.set) : (struct stack_st_ASN1_TYPE*)0)), ((void*) (1 ? (val) : (ASN1_TYPE*)0)))
| 0-8 | ||||||||||||
| 146 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 147 | - | |||||||||||||
| 148 | ASN1_TYPE_set(val, atrtype, value); | - | ||||||||||||
| 149 | return executed 8 times by 1 test: (ret);return (ret);Executed by:
executed 8 times by 1 test: return (ret);Executed by:
| 8 | ||||||||||||
| 150 | - | |||||||||||||
| 151 | err: | - | ||||||||||||
| 152 | if (ret !=
| 0 | ||||||||||||
| 153 | ((void *)0)
| 0 | ||||||||||||
| 154 | ) | - | ||||||||||||
| 155 | X509_ATTRIBUTE_free(ret); never executed: X509_ATTRIBUTE_free(ret); | 0 | ||||||||||||
| 156 | if (val !=
| 0 | ||||||||||||
| 157 | ((void *)0)
| 0 | ||||||||||||
| 158 | ) | - | ||||||||||||
| 159 | ASN1_TYPE_free(val); never executed: ASN1_TYPE_free(val); | 0 | ||||||||||||
| 160 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||
| 161 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||
| 162 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||
| 163 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |