| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509v3/v3_tlsf.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | static struct stack_st_CONF_VALUE *i2v_TLS_FEATURE(const X509V3_EXT_METHOD *method, | - | ||||||||||||||||||||||||||||||||||||
| 4 | TLS_FEATURE *tls_feature, | - | ||||||||||||||||||||||||||||||||||||
| 5 | struct stack_st_CONF_VALUE *ext_list); | - | ||||||||||||||||||||||||||||||||||||
| 6 | static TLS_FEATURE *v2i_TLS_FEATURE(const X509V3_EXT_METHOD *method, | - | ||||||||||||||||||||||||||||||||||||
| 7 | X509V3_CTX *ctx, | - | ||||||||||||||||||||||||||||||||||||
| 8 | struct stack_st_CONF_VALUE *nval); | - | ||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||
| 10 | static const ASN1_TEMPLATE TLS_FEATURE_item_tt = | - | ||||||||||||||||||||||||||||||||||||
| 11 | { ((0x2 << 1)), (0), 0, "TLS_FEATURE", (&(ASN1_INTEGER_it)) } | - | ||||||||||||||||||||||||||||||||||||
| 12 | ; static const ASN1_ITEM TLS_FEATURE_it = { 0x0, -1, &TLS_FEATURE_item_tt, 0, | - | ||||||||||||||||||||||||||||||||||||
| 13 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 14 | , 0, "TLS_FEATURE" }; | - | ||||||||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||||||||
| 16 | TLS_FEATURE *TLS_FEATURE_new(void) { return never executed: (TLS_FEATURE *)ASN1_item_new((&(TLS_FEATURE_it)));return (TLS_FEATURE *)ASN1_item_new((&(TLS_FEATURE_it)));never executed: } void TLS_FEATURE_free(TLS_FEATURE *a) { ASN1_item_free((ASN1_VALUE *)a, (&(TLS_FEATURE_it))); }return (TLS_FEATURE *)ASN1_item_new((&(TLS_FEATURE_it)));never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||||||||||||||
| 18 | const X509V3_EXT_METHOD v3_tls_feature = { | - | ||||||||||||||||||||||||||||||||||||
| 19 | 1020, 0, | - | ||||||||||||||||||||||||||||||||||||
| 20 | (&(TLS_FEATURE_it)), | - | ||||||||||||||||||||||||||||||||||||
| 21 | 0, 0, 0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 22 | 0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 23 | (X509V3_EXT_I2V)i2v_TLS_FEATURE, | - | ||||||||||||||||||||||||||||||||||||
| 24 | (X509V3_EXT_V2I)v2i_TLS_FEATURE, | - | ||||||||||||||||||||||||||||||||||||
| 25 | 0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||||||||||||||
| 27 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||||||||||||||
| 29 | }; | - | ||||||||||||||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||||||||||||||
| 32 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||
| 33 | long num; | - | ||||||||||||||||||||||||||||||||||||
| 34 | const char *name; | - | ||||||||||||||||||||||||||||||||||||
| 35 | } TLS_FEATURE_NAME; | - | ||||||||||||||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||||||||||||||
| 37 | static TLS_FEATURE_NAME tls_feature_tbl[] = { | - | ||||||||||||||||||||||||||||||||||||
| 38 | { 5, "status_request" }, | - | ||||||||||||||||||||||||||||||||||||
| 39 | { 17, "status_request_v2" } | - | ||||||||||||||||||||||||||||||||||||
| 40 | }; | - | ||||||||||||||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||||||||||||||
| 48 | static struct stack_st_CONF_VALUE *i2v_TLS_FEATURE(const X509V3_EXT_METHOD *method, | - | ||||||||||||||||||||||||||||||||||||
| 49 | TLS_FEATURE *tls_feature, | - | ||||||||||||||||||||||||||||||||||||
| 50 | struct stack_st_CONF_VALUE *ext_list) | - | ||||||||||||||||||||||||||||||||||||
| 51 | { | - | ||||||||||||||||||||||||||||||||||||
| 52 | int i; | - | ||||||||||||||||||||||||||||||||||||
| 53 | size_t j; | - | ||||||||||||||||||||||||||||||||||||
| 54 | ASN1_INTEGER *ai; | - | ||||||||||||||||||||||||||||||||||||
| 55 | long tlsextid; | - | ||||||||||||||||||||||||||||||||||||
| 56 | for (i = 0; i < sk_ASN1_INTEGER_num(tls_feature)
| 28-110 | ||||||||||||||||||||||||||||||||||||
| 57 | ai = sk_ASN1_INTEGER_value(tls_feature, i); | - | ||||||||||||||||||||||||||||||||||||
| 58 | tlsextid = ASN1_INTEGER_get(ai); | - | ||||||||||||||||||||||||||||||||||||
| 59 | for (j = 0; j < (sizeof(tls_feature_tbl)/sizeof((tls_feature_tbl)[0]))
| 84-213 | ||||||||||||||||||||||||||||||||||||
| 60 | if (tlsextid == tls_feature_tbl[j].num
| 26-187 | ||||||||||||||||||||||||||||||||||||
| 61 | break; executed 26 times by 1 test: break;Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 62 | if (j < (sizeof(tls_feature_tbl)/sizeof((tls_feature_tbl)[0]))
| 26-84 | ||||||||||||||||||||||||||||||||||||
| 63 | X509V3_add_value( executed 26 times by 1 test: X509V3_add_value( ((void *)0) , tls_feature_tbl[j].name, &ext_list);Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 64 | ((void *)0) executed 26 times by 1 test: X509V3_add_value( ((void *)0) , tls_feature_tbl[j].name, &ext_list);Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 65 | , tls_feature_tbl[j].name, &ext_list); executed 26 times by 1 test: X509V3_add_value( ((void *)0) , tls_feature_tbl[j].name, &ext_list);Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 66 | else | - | ||||||||||||||||||||||||||||||||||||
| 67 | X509V3_add_value_int( executed 84 times by 1 test: X509V3_add_value_int( ((void *)0) , ai, &ext_list);Executed by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 68 | ((void *)0) executed 84 times by 1 test: X509V3_add_value_int( ((void *)0) , ai, &ext_list);Executed by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 69 | , ai, &ext_list); executed 84 times by 1 test: X509V3_add_value_int( ((void *)0) , ai, &ext_list);Executed by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 70 | } | - | ||||||||||||||||||||||||||||||||||||
| 71 | return executed 28 times by 1 test: ext_list;return ext_list;Executed by:
executed 28 times by 1 test: return ext_list;Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 72 | } | - | ||||||||||||||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||||||||||||||
| 79 | static TLS_FEATURE *v2i_TLS_FEATURE(const X509V3_EXT_METHOD *method, | - | ||||||||||||||||||||||||||||||||||||
| 80 | X509V3_CTX *ctx, struct stack_st_CONF_VALUE *nval) | - | ||||||||||||||||||||||||||||||||||||
| 81 | { | - | ||||||||||||||||||||||||||||||||||||
| 82 | TLS_FEATURE *tlsf; | - | ||||||||||||||||||||||||||||||||||||
| 83 | char *extval, *endptr; | - | ||||||||||||||||||||||||||||||||||||
| 84 | ASN1_INTEGER *ai; | - | ||||||||||||||||||||||||||||||||||||
| 85 | CONF_VALUE *val; | - | ||||||||||||||||||||||||||||||||||||
| 86 | int i; | - | ||||||||||||||||||||||||||||||||||||
| 87 | size_t j; | - | ||||||||||||||||||||||||||||||||||||
| 88 | long tlsextid; | - | ||||||||||||||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||||||||||||||
| 90 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 91 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 92 | ) { | - | ||||||||||||||||||||||||||||||||||||
| 93 | ERR_put_error(34,(165),((1|64)),__FILE__,99); | - | ||||||||||||||||||||||||||||||||||||
| 94 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||
| 95 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||
| 96 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||
| 97 | } | - | ||||||||||||||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||||||||||||||
| 99 | for (i = 0; i < sk_CONF_VALUE_num(nval)
| 0 | ||||||||||||||||||||||||||||||||||||
| 100 | val = sk_CONF_VALUE_value(nval, i); | - | ||||||||||||||||||||||||||||||||||||
| 101 | if (val->value
| 0 | ||||||||||||||||||||||||||||||||||||
| 102 | extval = val->value; never executed: extval = val->value; | 0 | ||||||||||||||||||||||||||||||||||||
| 103 | else | - | ||||||||||||||||||||||||||||||||||||
| 104 | extval = val->name; never executed: extval = val->name; | 0 | ||||||||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||||||||
| 106 | for (j = 0; j < (sizeof(tls_feature_tbl)/sizeof((tls_feature_tbl)[0]))
| 0 | ||||||||||||||||||||||||||||||||||||
| 107 | if (strcasecmp(extval, tls_feature_tbl[j].name) == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 108 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 109 | if (j < (sizeof(tls_feature_tbl)/sizeof((tls_feature_tbl)[0]))
| 0 | ||||||||||||||||||||||||||||||||||||
| 110 | tlsextid = tls_feature_tbl[j].num; never executed: tlsextid = tls_feature_tbl[j].num; | 0 | ||||||||||||||||||||||||||||||||||||
| 111 | else { | - | ||||||||||||||||||||||||||||||||||||
| 112 | tlsextid = strtol(extval, &endptr, 10); | - | ||||||||||||||||||||||||||||||||||||
| 113 | if (((*
| 0 | ||||||||||||||||||||||||||||||||||||
| 114 | (
| 0 | ||||||||||||||||||||||||||||||||||||
| 115 | ERR_put_error(34,(165),(143),__FILE__,119); | - | ||||||||||||||||||||||||||||||||||||
| 116 | ERR_add_error_data(6, "section:", (val)->section, ",name:", (val)->name, ",value:", (val)->value); | - | ||||||||||||||||||||||||||||||||||||
| 117 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 118 | } | - | ||||||||||||||||||||||||||||||||||||
| 119 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||||||||
| 121 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 122 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||||||||
| 123 | - | |||||||||||||||||||||||||||||||||||||
| 124 | || !ASN1_INTEGER_set(ai, tlsextid)
| 0 | ||||||||||||||||||||||||||||||||||||
| 125 | || sk_ASN1_INTEGER_push(tlsf, ai) <= 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 126 | ERR_put_error(34,(165),((1|64)),__FILE__,128); | - | ||||||||||||||||||||||||||||||||||||
| 127 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||||||||||||||||||||
| 128 | } | - | ||||||||||||||||||||||||||||||||||||
| 129 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 130 | return never executed: tlsf;return tlsf;never executed: return tlsf; | 0 | ||||||||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||||||||
| 132 | err: | - | ||||||||||||||||||||||||||||||||||||
| 133 | sk_ASN1_INTEGER_pop_free(tlsf, ASN1_INTEGER_free); | - | ||||||||||||||||||||||||||||||||||||
| 134 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||
| 135 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||
| 136 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||||||||
| 137 | } | - | ||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |