| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/x_req.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | static int | - | ||||||
| 3 | rinf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) | - | ||||||
| 4 | { | - | ||||||
| 5 | X509_REQ_INFO *rinf = (X509_REQ_INFO *)*pval; | - | ||||||
| 6 | - | |||||||
| 7 | if (operation == 1
| 2-6 | ||||||
| 8 | rinf->attributes = ((struct stack_st_X509_ATTRIBUTE *)sk_new_null()); | - | ||||||
| 9 | if (!rinf->attributes
| 0-2 | ||||||
| 10 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 11 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| 12 | return executed 8 times by 1 test: 1;return 1;Executed by:
executed 8 times by 1 test: return 1;Executed by:
| 8 | ||||||
| 13 | } | - | ||||||
| 14 | - | |||||||
| 15 | static const ASN1_AUX X509_REQ_INFO_aux = { | - | ||||||
| 16 | .flags = 2, | - | ||||||
| 17 | .asn1_cb = rinf_cb, | - | ||||||
| 18 | .enc_offset = | - | ||||||
| 19 | __builtin_offsetof ( | - | ||||||
| 20 | X509_REQ_INFO | - | ||||||
| 21 | , | - | ||||||
| 22 | enc | - | ||||||
| 23 | ) | - | ||||||
| 24 | , | - | ||||||
| 25 | }; | - | ||||||
| 26 | static const ASN1_TEMPLATE X509_REQ_INFO_seq_tt[] = { | - | ||||||
| 27 | { | - | ||||||
| 28 | .offset = | - | ||||||
| 29 | __builtin_offsetof ( | - | ||||||
| 30 | X509_REQ_INFO | - | ||||||
| 31 | , | - | ||||||
| 32 | version | - | ||||||
| 33 | ) | - | ||||||
| 34 | , | - | ||||||
| 35 | .field_name = "version", | - | ||||||
| 36 | .item = &ASN1_INTEGER_it, | - | ||||||
| 37 | }, | - | ||||||
| 38 | { | - | ||||||
| 39 | .offset = | - | ||||||
| 40 | __builtin_offsetof ( | - | ||||||
| 41 | X509_REQ_INFO | - | ||||||
| 42 | , | - | ||||||
| 43 | subject | - | ||||||
| 44 | ) | - | ||||||
| 45 | , | - | ||||||
| 46 | .field_name = "subject", | - | ||||||
| 47 | .item = &X509_NAME_it, | - | ||||||
| 48 | }, | - | ||||||
| 49 | { | - | ||||||
| 50 | .offset = | - | ||||||
| 51 | __builtin_offsetof ( | - | ||||||
| 52 | X509_REQ_INFO | - | ||||||
| 53 | , | - | ||||||
| 54 | pubkey | - | ||||||
| 55 | ) | - | ||||||
| 56 | , | - | ||||||
| 57 | .field_name = "pubkey", | - | ||||||
| 58 | .item = &X509_PUBKEY_it, | - | ||||||
| 59 | }, | - | ||||||
| 60 | - | |||||||
| 61 | - | |||||||
| 62 | - | |||||||
| 63 | { | - | ||||||
| 64 | .flags = (0x1 << 3)|(0x2<<6) | (0x1 << 1) | (0x1), | - | ||||||
| 65 | .offset = | - | ||||||
| 66 | __builtin_offsetof ( | - | ||||||
| 67 | X509_REQ_INFO | - | ||||||
| 68 | , | - | ||||||
| 69 | attributes | - | ||||||
| 70 | ) | - | ||||||
| 71 | , | - | ||||||
| 72 | .field_name = "attributes", | - | ||||||
| 73 | .item = &X509_ATTRIBUTE_it, | - | ||||||
| 74 | }, | - | ||||||
| 75 | }; | - | ||||||
| 76 | - | |||||||
| 77 | const ASN1_ITEM X509_REQ_INFO_it = { | - | ||||||
| 78 | .itype = 0x1, | - | ||||||
| 79 | .utype = 16, | - | ||||||
| 80 | .templates = X509_REQ_INFO_seq_tt, | - | ||||||
| 81 | .tcount = sizeof(X509_REQ_INFO_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||
| 82 | .funcs = &X509_REQ_INFO_aux, | - | ||||||
| 83 | .size = sizeof(X509_REQ_INFO), | - | ||||||
| 84 | .sname = "X509_REQ_INFO", | - | ||||||
| 85 | }; | - | ||||||
| 86 | - | |||||||
| 87 | - | |||||||
| 88 | X509_REQ_INFO * | - | ||||||
| 89 | d2i_X509_REQ_INFO(X509_REQ_INFO **a, const unsigned char **in, long len) | - | ||||||
| 90 | { | - | ||||||
| 91 | return never executed: (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_INFO_it);never executed: return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_INFO_it); | 0 | ||||||
| 92 | &X509_REQ_INFO_it); never executed: return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_INFO_it); | 0 | ||||||
| 93 | } | - | ||||||
| 94 | - | |||||||
| 95 | int | - | ||||||
| 96 | i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **out) | - | ||||||
| 97 | { | - | ||||||
| 98 | return never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it);return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it);never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it); | 0 | ||||||
| 99 | } | - | ||||||
| 100 | - | |||||||
| 101 | X509_REQ_INFO * | - | ||||||
| 102 | X509_REQ_INFO_new(void) | - | ||||||
| 103 | { | - | ||||||
| 104 | return never executed: (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it);return (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it);never executed: return (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it); | 0 | ||||||
| 105 | } | - | ||||||
| 106 | - | |||||||
| 107 | void | - | ||||||
| 108 | X509_REQ_INFO_free(X509_REQ_INFO *a) | - | ||||||
| 109 | { | - | ||||||
| 110 | ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_INFO_it); | - | ||||||
| 111 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||
| 112 | - | |||||||
| 113 | static const ASN1_AUX X509_REQ_aux = { | - | ||||||
| 114 | .app_data = | - | ||||||
| 115 | ((void *)0) | - | ||||||
| 116 | , | - | ||||||
| 117 | .flags = 1, | - | ||||||
| 118 | .ref_offset = | - | ||||||
| 119 | __builtin_offsetof ( | - | ||||||
| 120 | X509_REQ | - | ||||||
| 121 | , | - | ||||||
| 122 | references | - | ||||||
| 123 | ) | - | ||||||
| 124 | , | - | ||||||
| 125 | .ref_lock = 7, | - | ||||||
| 126 | }; | - | ||||||
| 127 | static const ASN1_TEMPLATE X509_REQ_seq_tt[] = { | - | ||||||
| 128 | { | - | ||||||
| 129 | .offset = | - | ||||||
| 130 | __builtin_offsetof ( | - | ||||||
| 131 | X509_REQ | - | ||||||
| 132 | , | - | ||||||
| 133 | req_info | - | ||||||
| 134 | ) | - | ||||||
| 135 | , | - | ||||||
| 136 | .field_name = "req_info", | - | ||||||
| 137 | .item = &X509_REQ_INFO_it, | - | ||||||
| 138 | }, | - | ||||||
| 139 | { | - | ||||||
| 140 | .offset = | - | ||||||
| 141 | __builtin_offsetof ( | - | ||||||
| 142 | X509_REQ | - | ||||||
| 143 | , | - | ||||||
| 144 | sig_alg | - | ||||||
| 145 | ) | - | ||||||
| 146 | , | - | ||||||
| 147 | .field_name = "sig_alg", | - | ||||||
| 148 | .item = &X509_ALGOR_it, | - | ||||||
| 149 | }, | - | ||||||
| 150 | { | - | ||||||
| 151 | .offset = | - | ||||||
| 152 | __builtin_offsetof ( | - | ||||||
| 153 | X509_REQ | - | ||||||
| 154 | , | - | ||||||
| 155 | signature | - | ||||||
| 156 | ) | - | ||||||
| 157 | , | - | ||||||
| 158 | .field_name = "signature", | - | ||||||
| 159 | .item = &ASN1_BIT_STRING_it, | - | ||||||
| 160 | }, | - | ||||||
| 161 | }; | - | ||||||
| 162 | - | |||||||
| 163 | const ASN1_ITEM X509_REQ_it = { | - | ||||||
| 164 | .itype = 0x1, | - | ||||||
| 165 | .utype = 16, | - | ||||||
| 166 | .templates = X509_REQ_seq_tt, | - | ||||||
| 167 | .tcount = sizeof(X509_REQ_seq_tt) / sizeof(ASN1_TEMPLATE), | - | ||||||
| 168 | .funcs = &X509_REQ_aux, | - | ||||||
| 169 | .size = sizeof(X509_REQ), | - | ||||||
| 170 | .sname = "X509_REQ", | - | ||||||
| 171 | }; | - | ||||||
| 172 | - | |||||||
| 173 | - | |||||||
| 174 | X509_REQ * | - | ||||||
| 175 | d2i_X509_REQ(X509_REQ **a, const unsigned char **in, long len) | - | ||||||
| 176 | { | - | ||||||
| 177 | return never executed: (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_it);never executed: return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_it); | 0 | ||||||
| 178 | &X509_REQ_it); never executed: return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_it); | 0 | ||||||
| 179 | } | - | ||||||
| 180 | - | |||||||
| 181 | int | - | ||||||
| 182 | i2d_X509_REQ(X509_REQ *a, unsigned char **out) | - | ||||||
| 183 | { | - | ||||||
| 184 | return never executed: ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it);return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it);never executed: return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it); | 0 | ||||||
| 185 | } | - | ||||||
| 186 | - | |||||||
| 187 | X509_REQ * | - | ||||||
| 188 | X509_REQ_new(void) | - | ||||||
| 189 | { | - | ||||||
| 190 | return executed 2 times by 1 test: (X509_REQ *)ASN1_item_new(&X509_REQ_it);return (X509_REQ *)ASN1_item_new(&X509_REQ_it);Executed by:
executed 2 times by 1 test: return (X509_REQ *)ASN1_item_new(&X509_REQ_it);Executed by:
| 2 | ||||||
| 191 | } | - | ||||||
| 192 | - | |||||||
| 193 | void | - | ||||||
| 194 | X509_REQ_free(X509_REQ *a) | - | ||||||
| 195 | { | - | ||||||
| 196 | ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_it); | - | ||||||
| 197 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||
| 198 | - | |||||||
| 199 | X509_REQ * | - | ||||||
| 200 | X509_REQ_dup(X509_REQ *x) | - | ||||||
| 201 | { | - | ||||||
| 202 | return never executed: ASN1_item_dup(&X509_REQ_it, x);return ASN1_item_dup(&X509_REQ_it, x);never executed: return ASN1_item_dup(&X509_REQ_it, x); | 0 | ||||||
| 203 | } | - | ||||||
| 204 | - | |||||||
| 205 | int | - | ||||||
| 206 | X509_REQ_get_signature_nid(const X509_REQ *req) | - | ||||||
| 207 | { | - | ||||||
| 208 | return never executed: OBJ_obj2nid(req->sig_alg->algorithm);return OBJ_obj2nid(req->sig_alg->algorithm);never executed: return OBJ_obj2nid(req->sig_alg->algorithm); | 0 | ||||||
| 209 | } | - | ||||||
| 210 | - | |||||||
| 211 | void | - | ||||||
| 212 | X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, | - | ||||||
| 213 | const X509_ALGOR **palg) | - | ||||||
| 214 | { | - | ||||||
| 215 | if (psig !=
| 0 | ||||||
| 216 | ((void *)0)
| 0 | ||||||
| 217 | ) | - | ||||||
| 218 | * never executed: psig = req->signature;*psig = req->signature;never executed: *psig = req->signature; | 0 | ||||||
| 219 | if (palg !=
| 0 | ||||||
| 220 | ((void *)0)
| 0 | ||||||
| 221 | ) | - | ||||||
| 222 | * never executed: palg = req->sig_alg;*palg = req->sig_alg;never executed: *palg = req->sig_alg; | 0 | ||||||
| 223 | } never executed: end of block | 0 | ||||||
| Switch to Source code | Preprocessed file |