| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/x509_req.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) | - | ||||||||||||||||||
| 6 | { | - | ||||||||||||||||||
| 7 | X509_REQ *ret; | - | ||||||||||||||||||
| 8 | X509_REQ_INFO *ri; | - | ||||||||||||||||||
| 9 | int i; | - | ||||||||||||||||||
| 10 | EVP_PKEY *pktmp; | - | ||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | ret = X509_REQ_new(); | - | ||||||||||||||||||
| 13 | if (ret ==
| 0-1 | ||||||||||||||||||
| 14 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 15 | ) { | - | ||||||||||||||||||
| 16 | ERR_put_error(11,(126),((1|64)),__FILE__,31); | - | ||||||||||||||||||
| 17 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 18 | } | - | ||||||||||||||||||
| 19 | - | |||||||||||||||||||
| 20 | ri = &ret->req_info; | - | ||||||||||||||||||
| 21 | - | |||||||||||||||||||
| 22 | ri->version->length = 1; | - | ||||||||||||||||||
| 23 | ri->version->data = CRYPTO_malloc(1, __FILE__, 38); | - | ||||||||||||||||||
| 24 | if (ri->version->data ==
| 0-1 | ||||||||||||||||||
| 25 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 26 | ) | - | ||||||||||||||||||
| 27 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 28 | ri->version->data[0] = 0; | - | ||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | if (!X509_REQ_set_subject_name(ret, X509_get_subject_name(x))
| 0-1 | ||||||||||||||||||
| 31 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 32 | - | |||||||||||||||||||
| 33 | pktmp = X509_get0_pubkey(x); | - | ||||||||||||||||||
| 34 | if (pktmp ==
| 0-1 | ||||||||||||||||||
| 35 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 36 | ) | - | ||||||||||||||||||
| 37 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 38 | i = X509_REQ_set_pubkey(ret, pktmp); | - | ||||||||||||||||||
| 39 | if (!i
| 0-1 | ||||||||||||||||||
| 40 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 41 | - | |||||||||||||||||||
| 42 | if (pkey !=
| 0-1 | ||||||||||||||||||
| 43 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 44 | ) { | - | ||||||||||||||||||
| 45 | if (!X509_REQ_sign(ret, pkey, md)
| 0-1 | ||||||||||||||||||
| 46 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 47 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 48 | return executed 1 time by 1 test: ret;return ret;Executed by:
executed 1 time by 1 test: return ret;Executed by:
| 1 | ||||||||||||||||||
| 49 | err: | - | ||||||||||||||||||
| 50 | X509_REQ_free(ret); | - | ||||||||||||||||||
| 51 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 52 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 53 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 54 | } | - | ||||||||||||||||||
| 55 | - | |||||||||||||||||||
| 56 | EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) | - | ||||||||||||||||||
| 57 | { | - | ||||||||||||||||||
| 58 | if (req ==
| 0-3 | ||||||||||||||||||
| 59 | ((void *)0)
| 0-3 | ||||||||||||||||||
| 60 | ) | - | ||||||||||||||||||
| 61 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 62 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 63 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 64 | return executed 3 times by 1 test: X509_PUBKEY_get(req->req_info.pubkey);return X509_PUBKEY_get(req->req_info.pubkey);Executed by:
executed 3 times by 1 test: return X509_PUBKEY_get(req->req_info.pubkey);Executed by:
| 3 | ||||||||||||||||||
| 65 | } | - | ||||||||||||||||||
| 66 | - | |||||||||||||||||||
| 67 | EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req) | - | ||||||||||||||||||
| 68 | { | - | ||||||||||||||||||
| 69 | if (req ==
| 0-23 | ||||||||||||||||||
| 70 | ((void *)0)
| 0-23 | ||||||||||||||||||
| 71 | ) | - | ||||||||||||||||||
| 72 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 73 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 74 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 75 | return executed 23 times by 1 test: X509_PUBKEY_get0(req->req_info.pubkey);return X509_PUBKEY_get0(req->req_info.pubkey);Executed by:
executed 23 times by 1 test: return X509_PUBKEY_get0(req->req_info.pubkey);Executed by:
| 23 | ||||||||||||||||||
| 76 | } | - | ||||||||||||||||||
| 77 | - | |||||||||||||||||||
| 78 | X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req) | - | ||||||||||||||||||
| 79 | { | - | ||||||||||||||||||
| 80 | return executed 3 times by 1 test: req->req_info.pubkey;return req->req_info.pubkey;Executed by:
executed 3 times by 1 test: return req->req_info.pubkey;Executed by:
| 3 | ||||||||||||||||||
| 81 | } | - | ||||||||||||||||||
| 82 | - | |||||||||||||||||||
| 83 | int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) | - | ||||||||||||||||||
| 84 | { | - | ||||||||||||||||||
| 85 | EVP_PKEY *xk = | - | ||||||||||||||||||
| 86 | ((void *)0) | - | ||||||||||||||||||
| 87 | ; | - | ||||||||||||||||||
| 88 | int ok = 0; | - | ||||||||||||||||||
| 89 | - | |||||||||||||||||||
| 90 | xk = X509_REQ_get_pubkey(x); | - | ||||||||||||||||||
| 91 | switch (EVP_PKEY_cmp(xk, k)) { | - | ||||||||||||||||||
| 92 | case executed 2 times by 1 test: 1:case 1:Executed by:
executed 2 times by 1 test: case 1:Executed by:
| 2 | ||||||||||||||||||
| 93 | ok = 1; | - | ||||||||||||||||||
| 94 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||
| 95 | case executed 1 time by 1 test: 0:case 0:Executed by:
executed 1 time by 1 test: case 0:Executed by:
| 1 | ||||||||||||||||||
| 96 | ERR_put_error(11,(144),(116),__FILE__,94) | - | ||||||||||||||||||
| 97 | ; | - | ||||||||||||||||||
| 98 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||
| 99 | case never executed: -1:case -1:never executed: case -1: | 0 | ||||||||||||||||||
| 100 | ERR_put_error(11,(144),(115),__FILE__,97); | - | ||||||||||||||||||
| 101 | break; never executed: break; | 0 | ||||||||||||||||||
| 102 | case never executed: -2:case -2:never executed: case -2: | 0 | ||||||||||||||||||
| 103 | - | |||||||||||||||||||
| 104 | if (EVP_PKEY_id(k) == 408
| 0 | ||||||||||||||||||
| 105 | ERR_put_error(11,(144),(16),__FILE__,102); | - | ||||||||||||||||||
| 106 | break; never executed: break; | 0 | ||||||||||||||||||
| 107 | } | - | ||||||||||||||||||
| 108 | - | |||||||||||||||||||
| 109 | - | |||||||||||||||||||
| 110 | if (EVP_PKEY_id(k) == 28
| 0 | ||||||||||||||||||
| 111 | - | |||||||||||||||||||
| 112 | ERR_put_error(11,(144),(114),__FILE__,110) | - | ||||||||||||||||||
| 113 | ; | - | ||||||||||||||||||
| 114 | break; never executed: break; | 0 | ||||||||||||||||||
| 115 | } | - | ||||||||||||||||||
| 116 | - | |||||||||||||||||||
| 117 | ERR_put_error(11,(144),(117),__FILE__,114); | - | ||||||||||||||||||
| 118 | } never executed: end of block | 0 | ||||||||||||||||||
| 119 | - | |||||||||||||||||||
| 120 | EVP_PKEY_free(xk); | - | ||||||||||||||||||
| 121 | return executed 3 times by 1 test: ok;return ok;Executed by:
executed 3 times by 1 test: return ok;Executed by:
| 3 | ||||||||||||||||||
| 122 | } | - | ||||||||||||||||||
| 123 | - | |||||||||||||||||||
| 124 | - | |||||||||||||||||||
| 125 | - | |||||||||||||||||||
| 126 | - | |||||||||||||||||||
| 127 | - | |||||||||||||||||||
| 128 | - | |||||||||||||||||||
| 129 | - | |||||||||||||||||||
| 130 | static int ext_nid_list[] = { 172, 171, 0 }; | - | ||||||||||||||||||
| 131 | - | |||||||||||||||||||
| 132 | static int *ext_nids = ext_nid_list; | - | ||||||||||||||||||
| 133 | - | |||||||||||||||||||
| 134 | int X509_REQ_extension_nid(int req_nid) | - | ||||||||||||||||||
| 135 | { | - | ||||||||||||||||||
| 136 | int i, nid; | - | ||||||||||||||||||
| 137 | for (i = 0;; i++) { | - | ||||||||||||||||||
| 138 | nid = ext_nids[i]; | - | ||||||||||||||||||
| 139 | if (nid == 0
| 0-2 | ||||||||||||||||||
| 140 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 141 | else if (req_nid == nid
| 1 | ||||||||||||||||||
| 142 | return executed 1 time by 1 test: 1;return 1;Executed by:
executed 1 time by 1 test: return 1;Executed by:
| 1 | ||||||||||||||||||
| 143 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 144 | } never executed: end of block | 0 | ||||||||||||||||||
| 145 | - | |||||||||||||||||||
| 146 | int *X509_REQ_get_extension_nids(void) | - | ||||||||||||||||||
| 147 | { | - | ||||||||||||||||||
| 148 | return never executed: ext_nids;return ext_nids;never executed: return ext_nids; | 0 | ||||||||||||||||||
| 149 | } | - | ||||||||||||||||||
| 150 | - | |||||||||||||||||||
| 151 | void X509_REQ_set_extension_nids(int *nids) | - | ||||||||||||||||||
| 152 | { | - | ||||||||||||||||||
| 153 | ext_nids = nids; | - | ||||||||||||||||||
| 154 | } never executed: end of block | 0 | ||||||||||||||||||
| 155 | - | |||||||||||||||||||
| 156 | struct stack_st_X509_EXTENSION *X509_REQ_get_extensions(X509_REQ *req) | - | ||||||||||||||||||
| 157 | { | - | ||||||||||||||||||
| 158 | X509_ATTRIBUTE *attr; | - | ||||||||||||||||||
| 159 | ASN1_TYPE *ext = | - | ||||||||||||||||||
| 160 | ((void *)0) | - | ||||||||||||||||||
| 161 | ; | - | ||||||||||||||||||
| 162 | int idx, *pnid; | - | ||||||||||||||||||
| 163 | const unsigned char *p; | - | ||||||||||||||||||
| 164 | - | |||||||||||||||||||
| 165 | if ((
| 0-3 | ||||||||||||||||||
| 166 | ((void *)0)
| 0-3 | ||||||||||||||||||
| 167 | )
| 0-3 | ||||||||||||||||||
| 168 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 169 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 170 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 171 | for (pnid = ext_nids; *
| 2-6 | ||||||||||||||||||
| 172 | idx = X509_REQ_get_attr_by_NID(req, *pnid, -1); | - | ||||||||||||||||||
| 173 | if (idx == -1
| 1-5 | ||||||||||||||||||
| 174 | continue; executed 5 times by 1 test: continue;Executed by:
| 5 | ||||||||||||||||||
| 175 | attr = X509_REQ_get_attr(req, idx); | - | ||||||||||||||||||
| 176 | ext = X509_ATTRIBUTE_get0_type(attr, 0); | - | ||||||||||||||||||
| 177 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||
| 178 | } | - | ||||||||||||||||||
| 179 | if (!ext
| 0-2 | ||||||||||||||||||
| 180 | return executed 2 times by 1 test: return ((void *)0) ;Executed by:
executed 2 times by 1 test: return ((void *)0) ;Executed by:
| 2 | ||||||||||||||||||
| 181 | ((void *)0) executed 2 times by 1 test: return ((void *)0) ;Executed by:
| 2 | ||||||||||||||||||
| 182 | ; executed 2 times by 1 test: return ((void *)0) ;Executed by:
| 2 | ||||||||||||||||||
| 183 | p = ext->value.sequence->data; | - | ||||||||||||||||||
| 184 | return executed 1 time by 1 test: (struct stack_st_X509_EXTENSION *)return (struct stack_st_X509_EXTENSION *) ASN1_item_d2i( ((void *)0) , &p, ext->value.sequence->length, (&(X509_EXTENSIONS_it)));Executed by:
executed 1 time by 1 test: return (struct stack_st_X509_EXTENSION *) ASN1_item_d2i( ((void *)0) , &p, ext->value.sequence->length, (&(X509_EXTENSIONS_it)));Executed by:
| 1 | ||||||||||||||||||
| 185 | ASN1_item_d2i( executed 1 time by 1 test: return (struct stack_st_X509_EXTENSION *) ASN1_item_d2i( ((void *)0) , &p, ext->value.sequence->length, (&(X509_EXTENSIONS_it)));Executed by:
| 1 | ||||||||||||||||||
| 186 | ((void *)0) executed 1 time by 1 test: return (struct stack_st_X509_EXTENSION *) ASN1_item_d2i( ((void *)0) , &p, ext->value.sequence->length, (&(X509_EXTENSIONS_it)));Executed by:
| 1 | ||||||||||||||||||
| 187 | , &p, ext->value.sequence->length, executed 1 time by 1 test: return (struct stack_st_X509_EXTENSION *) ASN1_item_d2i( ((void *)0) , &p, ext->value.sequence->length, (&(X509_EXTENSIONS_it)));Executed by:
| 1 | ||||||||||||||||||
| 188 | (&(X509_EXTENSIONS_it))); executed 1 time by 1 test: return (struct stack_st_X509_EXTENSION *) ASN1_item_d2i( ((void *)0) , &p, ext->value.sequence->length, (&(X509_EXTENSIONS_it)));Executed by:
| 1 | ||||||||||||||||||
| 189 | } | - | ||||||||||||||||||
| 190 | - | |||||||||||||||||||
| 191 | - | |||||||||||||||||||
| 192 | - | |||||||||||||||||||
| 193 | - | |||||||||||||||||||
| 194 | - | |||||||||||||||||||
| 195 | - | |||||||||||||||||||
| 196 | int X509_REQ_add_extensions_nid(X509_REQ *req, struct stack_st_X509_EXTENSION *exts, | - | ||||||||||||||||||
| 197 | int nid) | - | ||||||||||||||||||
| 198 | { | - | ||||||||||||||||||
| 199 | int extlen; | - | ||||||||||||||||||
| 200 | int rv = 0; | - | ||||||||||||||||||
| 201 | unsigned char *ext = | - | ||||||||||||||||||
| 202 | ((void *)0) | - | ||||||||||||||||||
| 203 | ; | - | ||||||||||||||||||
| 204 | - | |||||||||||||||||||
| 205 | extlen = ASN1_item_i2d((ASN1_VALUE *)exts, &ext, | - | ||||||||||||||||||
| 206 | (&(X509_EXTENSIONS_it))); | - | ||||||||||||||||||
| 207 | if (extlen <= 0
| 0-1 | ||||||||||||||||||
| 208 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 209 | rv = X509_REQ_add1_attr_by_NID(req, nid, 16, ext, extlen); | - | ||||||||||||||||||
| 210 | CRYPTO_free(ext, __FILE__, 195); | - | ||||||||||||||||||
| 211 | return executed 1 time by 1 test: rv;return rv;Executed by:
executed 1 time by 1 test: return rv;Executed by:
| 1 | ||||||||||||||||||
| 212 | } | - | ||||||||||||||||||
| 213 | - | |||||||||||||||||||
| 214 | - | |||||||||||||||||||
| 215 | int X509_REQ_add_extensions(X509_REQ *req, struct stack_st_X509_EXTENSION *exts) | - | ||||||||||||||||||
| 216 | { | - | ||||||||||||||||||
| 217 | return executed 1 time by 1 test: X509_REQ_add_extensions_nid(req, exts, 172);return X509_REQ_add_extensions_nid(req, exts, 172);Executed by:
executed 1 time by 1 test: return X509_REQ_add_extensions_nid(req, exts, 172);Executed by:
| 1 | ||||||||||||||||||
| 218 | } | - | ||||||||||||||||||
| 219 | - | |||||||||||||||||||
| 220 | - | |||||||||||||||||||
| 221 | - | |||||||||||||||||||
| 222 | int X509_REQ_get_attr_count(const X509_REQ *req) | - | ||||||||||||||||||
| 223 | { | - | ||||||||||||||||||
| 224 | return executed 5 times by 1 test: X509at_get_attr_count(req->req_info.attributes);return X509at_get_attr_count(req->req_info.attributes);Executed by:
executed 5 times by 1 test: return X509at_get_attr_count(req->req_info.attributes);Executed by:
| 5 | ||||||||||||||||||
| 225 | } | - | ||||||||||||||||||
| 226 | - | |||||||||||||||||||
| 227 | int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos) | - | ||||||||||||||||||
| 228 | { | - | ||||||||||||||||||
| 229 | return executed 6 times by 1 test: X509at_get_attr_by_NID(req->req_info.attributes, nid, lastpos);return X509at_get_attr_by_NID(req->req_info.attributes, nid, lastpos);Executed by:
executed 6 times by 1 test: return X509at_get_attr_by_NID(req->req_info.attributes, nid, lastpos);Executed by:
| 6 | ||||||||||||||||||
| 230 | } | - | ||||||||||||||||||
| 231 | - | |||||||||||||||||||
| 232 | int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj, | - | ||||||||||||||||||
| 233 | int lastpos) | - | ||||||||||||||||||
| 234 | { | - | ||||||||||||||||||
| 235 | return never executed: X509at_get_attr_by_OBJ(req->req_info.attributes, obj, lastpos);return X509at_get_attr_by_OBJ(req->req_info.attributes, obj, lastpos);never executed: return X509at_get_attr_by_OBJ(req->req_info.attributes, obj, lastpos); | 0 | ||||||||||||||||||
| 236 | } | - | ||||||||||||||||||
| 237 | - | |||||||||||||||||||
| 238 | X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc) | - | ||||||||||||||||||
| 239 | { | - | ||||||||||||||||||
| 240 | return executed 2 times by 1 test: X509at_get_attr(req->req_info.attributes, loc);return X509at_get_attr(req->req_info.attributes, loc);Executed by:
executed 2 times by 1 test: return X509at_get_attr(req->req_info.attributes, loc);Executed by:
| 2 | ||||||||||||||||||
| 241 | } | - | ||||||||||||||||||
| 242 | - | |||||||||||||||||||
| 243 | X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc) | - | ||||||||||||||||||
| 244 | { | - | ||||||||||||||||||
| 245 | return never executed: X509at_delete_attr(req->req_info.attributes, loc);return X509at_delete_attr(req->req_info.attributes, loc);never executed: return X509at_delete_attr(req->req_info.attributes, loc); | 0 | ||||||||||||||||||
| 246 | } | - | ||||||||||||||||||
| 247 | - | |||||||||||||||||||
| 248 | int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) | - | ||||||||||||||||||
| 249 | { | - | ||||||||||||||||||
| 250 | if (X509at_add1_attr(&req->req_info.attributes, attr)
| 0 | ||||||||||||||||||
| 251 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 252 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 253 | } | - | ||||||||||||||||||
| 254 | - | |||||||||||||||||||
| 255 | int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, | - | ||||||||||||||||||
| 256 | const ASN1_OBJECT *obj, int type, | - | ||||||||||||||||||
| 257 | const unsigned char *bytes, int len) | - | ||||||||||||||||||
| 258 | { | - | ||||||||||||||||||
| 259 | if (X509at_add1_attr_by_OBJ(&req->req_info.attributes, obj,
| 0 | ||||||||||||||||||
| 260 | type, bytes, len)
| 0 | ||||||||||||||||||
| 261 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 262 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 263 | } | - | ||||||||||||||||||
| 264 | - | |||||||||||||||||||
| 265 | int X509_REQ_add1_attr_by_NID(X509_REQ *req, | - | ||||||||||||||||||
| 266 | int nid, int type, | - | ||||||||||||||||||
| 267 | const unsigned char *bytes, int len) | - | ||||||||||||||||||
| 268 | { | - | ||||||||||||||||||
| 269 | if (X509at_add1_attr_by_NID(&req->req_info.attributes, nid,
| 0-1 | ||||||||||||||||||
| 270 | type, bytes, len)
| 0-1 | ||||||||||||||||||
| 271 | return executed 1 time by 1 test: 1;return 1;Executed by:
executed 1 time by 1 test: return 1;Executed by:
| 1 | ||||||||||||||||||
| 272 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 273 | } | - | ||||||||||||||||||
| 274 | - | |||||||||||||||||||
| 275 | int X509_REQ_add1_attr_by_txt(X509_REQ *req, | - | ||||||||||||||||||
| 276 | const char *attrname, int type, | - | ||||||||||||||||||
| 277 | const unsigned char *bytes, int len) | - | ||||||||||||||||||
| 278 | { | - | ||||||||||||||||||
| 279 | if (X509at_add1_attr_by_txt(&req->req_info.attributes, attrname,
| 0 | ||||||||||||||||||
| 280 | type, bytes, len)
| 0 | ||||||||||||||||||
| 281 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 282 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 283 | } | - | ||||||||||||||||||
| 284 | - | |||||||||||||||||||
| 285 | long X509_REQ_get_version(const X509_REQ *req) | - | ||||||||||||||||||
| 286 | { | - | ||||||||||||||||||
| 287 | return executed 3 times by 1 test: ASN1_INTEGER_get(req->req_info.version);return ASN1_INTEGER_get(req->req_info.version);Executed by:
executed 3 times by 1 test: return ASN1_INTEGER_get(req->req_info.version);Executed by:
| 3 | ||||||||||||||||||
| 288 | } | - | ||||||||||||||||||
| 289 | - | |||||||||||||||||||
| 290 | X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req) | - | ||||||||||||||||||
| 291 | { | - | ||||||||||||||||||
| 292 | return executed 36 times by 1 test: req->req_info.subject;return req->req_info.subject;Executed by:
executed 36 times by 1 test: return req->req_info.subject;Executed by:
| 36 | ||||||||||||||||||
| 293 | } | - | ||||||||||||||||||
| 294 | - | |||||||||||||||||||
| 295 | void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, | - | ||||||||||||||||||
| 296 | const X509_ALGOR **palg) | - | ||||||||||||||||||
| 297 | { | - | ||||||||||||||||||
| 298 | if (psig !=
| 0-3 | ||||||||||||||||||
| 299 | ((void *)0)
| 0-3 | ||||||||||||||||||
| 300 | ) | - | ||||||||||||||||||
| 301 | * executed 3 times by 1 test: psig = req->signature;*psig = req->signature;Executed by:
executed 3 times by 1 test: *psig = req->signature;Executed by:
| 3 | ||||||||||||||||||
| 302 | if (palg !=
| 0-3 | ||||||||||||||||||
| 303 | ((void *)0)
| 0-3 | ||||||||||||||||||
| 304 | ) | - | ||||||||||||||||||
| 305 | * executed 3 times by 1 test: palg = &req->sig_alg;*palg = &req->sig_alg;Executed by:
executed 3 times by 1 test: *palg = &req->sig_alg;Executed by:
| 3 | ||||||||||||||||||
| 306 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||
| 307 | - | |||||||||||||||||||
| 308 | int X509_REQ_get_signature_nid(const X509_REQ *req) | - | ||||||||||||||||||
| 309 | { | - | ||||||||||||||||||
| 310 | 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 | ||||||||||||||||||
| 311 | } | - | ||||||||||||||||||
| 312 | - | |||||||||||||||||||
| 313 | int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp) | - | ||||||||||||||||||
| 314 | { | - | ||||||||||||||||||
| 315 | req->req_info.enc.modified = 1; | - | ||||||||||||||||||
| 316 | return never executed: i2d_X509_REQ_INFO(&req->req_info, pp);return i2d_X509_REQ_INFO(&req->req_info, pp);never executed: return i2d_X509_REQ_INFO(&req->req_info, pp); | 0 | ||||||||||||||||||
| 317 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |