| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/evp_lib.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | - | ||||||
| 4 | { | - | ||||||
| 5 | int ret; | - | ||||||
| 6 | - | |||||||
| 7 | if (c->cipher->set_asn1_parameters !=
| 2-33 | ||||||
| 8 | ((void *)0)
| 2-33 | ||||||
| 9 | ) | - | ||||||
| 10 | ret = c->cipher->set_asn1_parameters(c, type); executed 2 times by 1 test: ret = c->cipher->set_asn1_parameters(c, type);Executed by:
| 2 | ||||||
| 11 | else if (c->cipher->flags & 0x1000
| 0-33 | ||||||
| 12 | switch ((EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) & 0xF0007)) { | - | ||||||
| 13 | case executed 7 times by 1 test: 0x10002:case 0x10002:Executed by:
executed 7 times by 1 test: case 0x10002:Executed by:
| 7 | ||||||
| 14 | if (EVP_CIPHER_CTX_nid(c) == 246
| 3-4 | ||||||
| 15 | ASN1_TYPE_set(type, 5, executed 4 times by 1 test: ASN1_TYPE_set(type, 5, ((void *)0) );Executed by:
| 4 | ||||||
| 16 | ((void *)0) executed 4 times by 1 test: ASN1_TYPE_set(type, 5, ((void *)0) );Executed by:
| 4 | ||||||
| 17 | ); executed 4 times by 1 test: ASN1_TYPE_set(type, 5, ((void *)0) );Executed by:
| 4 | ||||||
| 18 | ret = 1; | - | ||||||
| 19 | break; executed 7 times by 1 test: break;Executed by:
| 7 | ||||||
| 20 | - | |||||||
| 21 | case never executed: 0x6:case 0x6:never executed: case 0x6: | 0 | ||||||
| 22 | case never executed: 0x7:case 0x7:never executed: case 0x7: | 0 | ||||||
| 23 | case never executed: 0x10001:case 0x10001:never executed: case 0x10001: | 0 | ||||||
| 24 | case never executed: 0x10003:case 0x10003:never executed: case 0x10003: | 0 | ||||||
| 25 | ret = -2; | - | ||||||
| 26 | break; never executed: break; | 0 | ||||||
| 27 | - | |||||||
| 28 | default executed 26 times by 1 test: :default:Executed by:
executed 26 times by 1 test: default:Executed by:
| 26 | ||||||
| 29 | ret = EVP_CIPHER_set_asn1_iv(c, type); | - | ||||||
| 30 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||
| 31 | } else | - | ||||||
| 32 | ret = -1; never executed: ret = -1; | 0 | ||||||
| 33 | if (ret <= 0
| 0-35 | ||||||
| 34 | ERR_put_error(6,(205),(ret == -2 ? 228 : 122),__FILE__,46) never executed: ERR_put_error(6,(205),(ret == -2 ? 228 : 122),__FILE__,46) ; | 0 | ||||||
| 35 | 0 | |||||||
| 36 | ; never executed: ERR_put_error(6,(205),(ret == -2 ? 228 : 122),__FILE__,46) ; | 0 | ||||||
| 37 | if (ret < -1
| 0-35 | ||||||
| 38 | ret = -1; never executed: ret = -1; | 0 | ||||||
| 39 | return executed 35 times by 1 test: ret;return ret;Executed by:
executed 35 times by 1 test: return ret;Executed by:
| 35 | ||||||
| 40 | } | - | ||||||
| 41 | - | |||||||
| 42 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | - | ||||||
| 43 | { | - | ||||||
| 44 | int ret; | - | ||||||
| 45 | - | |||||||
| 46 | if (c->cipher->get_asn1_parameters !=
| 2-32 | ||||||
| 47 | ((void *)0)
| 2-32 | ||||||
| 48 | ) | - | ||||||
| 49 | ret = c->cipher->get_asn1_parameters(c, type); executed 2 times by 1 test: ret = c->cipher->get_asn1_parameters(c, type);Executed by:
| 2 | ||||||
| 50 | else if (c->cipher->flags & 0x1000
| 0-32 | ||||||
| 51 | switch ((EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) & 0xF0007)) { | - | ||||||
| 52 | - | |||||||
| 53 | case executed 6 times by 1 test: 0x10002:case 0x10002:Executed by:
executed 6 times by 1 test: case 0x10002:Executed by:
| 6 | ||||||
| 54 | ret = 1; | - | ||||||
| 55 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||
| 56 | - | |||||||
| 57 | case never executed: 0x6:case 0x6:never executed: case 0x6: | 0 | ||||||
| 58 | case never executed: 0x7:case 0x7:never executed: case 0x7: | 0 | ||||||
| 59 | case never executed: 0x10001:case 0x10001:never executed: case 0x10001: | 0 | ||||||
| 60 | case never executed: 0x10003:case 0x10003:never executed: case 0x10003: | 0 | ||||||
| 61 | ret = -2; | - | ||||||
| 62 | break; never executed: break; | 0 | ||||||
| 63 | - | |||||||
| 64 | default executed 26 times by 1 test: :default:Executed by:
executed 26 times by 1 test: default:Executed by:
| 26 | ||||||
| 65 | ret = EVP_CIPHER_get_asn1_iv(c, type); | - | ||||||
| 66 | break; executed 26 times by 1 test: break;Executed by:
| 26 | ||||||
| 67 | } | - | ||||||
| 68 | } else | - | ||||||
| 69 | ret = -1; never executed: ret = -1; | 0 | ||||||
| 70 | if (ret <= 0
| 0-34 | ||||||
| 71 | ERR_put_error(6,(204),(ret == -2 ? 107 : 122),__FILE__,81) never executed: ERR_put_error(6,(204),(ret == -2 ? 107 : 122),__FILE__,81) ; | 0 | ||||||
| 72 | 0 | |||||||
| 73 | ; never executed: ERR_put_error(6,(204),(ret == -2 ? 107 : 122),__FILE__,81) ; | 0 | ||||||
| 74 | if (ret < -1
| 0-34 | ||||||
| 75 | ret = -1; never executed: ret = -1; | 0 | ||||||
| 76 | return executed 34 times by 1 test: ret;return ret;Executed by:
executed 34 times by 1 test: return ret;Executed by:
| 34 | ||||||
| 77 | } | - | ||||||
| 78 | - | |||||||
| 79 | int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | - | ||||||
| 80 | { | - | ||||||
| 81 | int i = 0; | - | ||||||
| 82 | unsigned int l; | - | ||||||
| 83 | - | |||||||
| 84 | if (type !=
| 0-26 | ||||||
| 85 | ((void *)0)
| 0-26 | ||||||
| 86 | ) { | - | ||||||
| 87 | l = EVP_CIPHER_CTX_iv_length(c); | - | ||||||
| 88 | (void)((l <= sizeof(c->iv)) ? 0 : (OPENSSL_die("assertion failed: " "l <= sizeof(c->iv)", __FILE__, 94), 1)); | - | ||||||
| 89 | i = ASN1_TYPE_get_octetstring(type, c->oiv, l); | - | ||||||
| 90 | if (i != (int)l
| 0-26 | ||||||
| 91 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||
| 92 | else if (i > 0
| 0-26 | ||||||
| 93 | memcpy(c->iv, c->oiv, l); executed 26 times by 1 test: memcpy(c->iv, c->oiv, l);Executed by:
| 26 | ||||||
| 94 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||
| 95 | return executed 26 times by 1 test: i;return i;Executed by:
executed 26 times by 1 test: return i;Executed by:
| 26 | ||||||
| 96 | } | - | ||||||
| 97 | - | |||||||
| 98 | int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | - | ||||||
| 99 | { | - | ||||||
| 100 | int i = 0; | - | ||||||
| 101 | unsigned int j; | - | ||||||
| 102 | - | |||||||
| 103 | if (type !=
| 0-26 | ||||||
| 104 | ((void *)0)
| 0-26 | ||||||
| 105 | ) { | - | ||||||
| 106 | j = EVP_CIPHER_CTX_iv_length(c); | - | ||||||
| 107 | (void)((j <= sizeof(c->iv)) ? 0 : (OPENSSL_die("assertion failed: " "j <= sizeof(c->iv)", __FILE__, 111), 1)); | - | ||||||
| 108 | i = ASN1_TYPE_set_octetstring(type, c->oiv, j); | - | ||||||
| 109 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||
| 110 | return executed 26 times by 1 test: i;return i;Executed by:
executed 26 times by 1 test: return i;Executed by:
| 26 | ||||||
| 111 | } | - | ||||||
| 112 | - | |||||||
| 113 | - | |||||||
| 114 | int EVP_CIPHER_type(const EVP_CIPHER *ctx) | - | ||||||
| 115 | { | - | ||||||
| 116 | int nid; | - | ||||||
| 117 | ASN1_OBJECT *otmp; | - | ||||||
| 118 | nid = EVP_CIPHER_nid(ctx); | - | ||||||
| 119 | - | |||||||
| 120 | switch (nid) { | - | ||||||
| 121 | - | |||||||
| 122 | case executed 2 times by 1 test: 37:case 37:Executed by:
executed 2 times by 1 test: case 37:Executed by:
| 2 | ||||||
| 123 | case never executed: 166:case 166:never executed: case 166: | 0 | ||||||
| 124 | case never executed: 98:case 98:never executed: case 98: | 0 | ||||||
| 125 | - | |||||||
| 126 | return executed 2 times by 1 test: 37;return 37;Executed by:
executed 2 times by 1 test: return 37;Executed by:
| 2 | ||||||
| 127 | - | |||||||
| 128 | case never executed: 5:case 5:never executed: case 5: | 0 | ||||||
| 129 | case never executed: 97:case 97:never executed: case 97: | 0 | ||||||
| 130 | - | |||||||
| 131 | return never executed: 5;return 5;never executed: return 5; | 0 | ||||||
| 132 | - | |||||||
| 133 | case never executed: 421:case 421:never executed: case 421: | 0 | ||||||
| 134 | case never executed: 653:case 653:never executed: case 653: | 0 | ||||||
| 135 | case never executed: 650:case 650:never executed: case 650: | 0 | ||||||
| 136 | - | |||||||
| 137 | return never executed: 421;return 421;never executed: return 421; | 0 | ||||||
| 138 | - | |||||||
| 139 | case never executed: 425:case 425:never executed: case 425: | 0 | ||||||
| 140 | case never executed: 654:case 654:never executed: case 654: | 0 | ||||||
| 141 | case never executed: 651:case 651:never executed: case 651: | 0 | ||||||
| 142 | - | |||||||
| 143 | return never executed: 425;return 425;never executed: return 425; | 0 | ||||||
| 144 | - | |||||||
| 145 | case never executed: 429:case 429:never executed: case 429: | 0 | ||||||
| 146 | case never executed: 655:case 655:never executed: case 655: | 0 | ||||||
| 147 | case never executed: 652:case 652:never executed: case 652: | 0 | ||||||
| 148 | - | |||||||
| 149 | return never executed: 429;return 429;never executed: return 429; | 0 | ||||||
| 150 | - | |||||||
| 151 | case never executed: 30:case 30:never executed: case 30: | 0 | ||||||
| 152 | case never executed: 657:case 657:never executed: case 657: | 0 | ||||||
| 153 | case never executed: 656:case 656:never executed: case 656: | 0 | ||||||
| 154 | - | |||||||
| 155 | return never executed: 30;return 30;never executed: return 30; | 0 | ||||||
| 156 | - | |||||||
| 157 | case never executed: 61:case 61:never executed: case 61: | 0 | ||||||
| 158 | case never executed: 659:case 659:never executed: case 659: | 0 | ||||||
| 159 | case never executed: 658:case 658:never executed: case 658: | 0 | ||||||
| 160 | - | |||||||
| 161 | return never executed: 30;return 30;never executed: return 30; | 0 | ||||||
| 162 | - | |||||||
| 163 | default executed 45 times by 1 test: :default:Executed by:
executed 45 times by 1 test: default:Executed by:
| 45 | ||||||
| 164 | - | |||||||
| 165 | otmp = OBJ_nid2obj(nid); | - | ||||||
| 166 | if (OBJ_get0_data(otmp) ==
| 0-45 | ||||||
| 167 | ((void *)0)
| 0-45 | ||||||
| 168 | ) | - | ||||||
| 169 | nid = 0; never executed: nid = 0; | 0 | ||||||
| 170 | ASN1_OBJECT_free(otmp); | - | ||||||
| 171 | return executed 45 times by 1 test: nid;return nid;Executed by:
executed 45 times by 1 test: return nid;Executed by:
| 45 | ||||||
| 172 | } | - | ||||||
| 173 | } | - | ||||||
| 174 | - | |||||||
| 175 | int EVP_CIPHER_block_size(const EVP_CIPHER *e) | - | ||||||
| 176 | { | - | ||||||
| 177 | return executed 18082 times by 1 test: e->block_size;return e->block_size;Executed by:
executed 18082 times by 1 test: return e->block_size;Executed by:
| 18082 | ||||||
| 178 | } | - | ||||||
| 179 | - | |||||||
| 180 | int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 181 | { | - | ||||||
| 182 | return executed 28804263 times by 2 tests: ctx->cipher->block_size;return ctx->cipher->block_size;Executed by:
executed 28804263 times by 2 tests: return ctx->cipher->block_size;Executed by:
| 28804263 | ||||||
| 183 | } | - | ||||||
| 184 | - | |||||||
| 185 | int EVP_CIPHER_impl_ctx_size(const EVP_CIPHER *e) | - | ||||||
| 186 | { | - | ||||||
| 187 | return executed 256 times by 1 test: e->ctx_size;return e->ctx_size;Executed by:
executed 256 times by 1 test: return e->ctx_size;Executed by:
| 256 | ||||||
| 188 | } | - | ||||||
| 189 | - | |||||||
| 190 | int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | - | ||||||
| 191 | const unsigned char *in, unsigned int inl) | - | ||||||
| 192 | { | - | ||||||
| 193 | return executed 17755 times by 1 test: ctx->cipher->do_cipher(ctx, out, in, inl);return ctx->cipher->do_cipher(ctx, out, in, inl);Executed by:
executed 17755 times by 1 test: return ctx->cipher->do_cipher(ctx, out, in, inl);Executed by:
| 17755 | ||||||
| 194 | } | - | ||||||
| 195 | - | |||||||
| 196 | const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 197 | { | - | ||||||
| 198 | return executed 12820273 times by 2 tests: ctx->cipher;return ctx->cipher;Executed by:
executed 12820273 times by 2 tests: return ctx->cipher;Executed by:
| 12820273 | ||||||
| 199 | } | - | ||||||
| 200 | - | |||||||
| 201 | int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 202 | { | - | ||||||
| 203 | return executed 158312 times by 1 test: ctx->encrypt;return ctx->encrypt;Executed by:
executed 158312 times by 1 test: return ctx->encrypt;Executed by:
| 158312 | ||||||
| 204 | } | - | ||||||
| 205 | - | |||||||
| 206 | unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher) | - | ||||||
| 207 | { | - | ||||||
| 208 | return executed 12940989 times by 2 tests: cipher->flags;return cipher->flags;Executed by:
executed 12940989 times by 2 tests: return cipher->flags;Executed by:
| 12940989 | ||||||
| 209 | } | - | ||||||
| 210 | - | |||||||
| 211 | void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 212 | { | - | ||||||
| 213 | return never executed: ctx->app_data;return ctx->app_data;never executed: return ctx->app_data; | 0 | ||||||
| 214 | } | - | ||||||
| 215 | - | |||||||
| 216 | void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data) | - | ||||||
| 217 | { | - | ||||||
| 218 | ctx->app_data = data; | - | ||||||
| 219 | } never executed: end of block | 0 | ||||||
| 220 | - | |||||||
| 221 | void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 222 | { | - | ||||||
| 223 | return executed 31265188 times by 2 tests: ctx->cipher_data;return ctx->cipher_data;Executed by:
executed 31265188 times by 2 tests: return ctx->cipher_data;Executed by:
| 31265188 | ||||||
| 224 | } | - | ||||||
| 225 | - | |||||||
| 226 | void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data) | - | ||||||
| 227 | { | - | ||||||
| 228 | void *old_cipher_data; | - | ||||||
| 229 | - | |||||||
| 230 | old_cipher_data = ctx->cipher_data; | - | ||||||
| 231 | ctx->cipher_data = cipher_data; | - | ||||||
| 232 | - | |||||||
| 233 | return never executed: old_cipher_data;return old_cipher_data;never executed: return old_cipher_data; | 0 | ||||||
| 234 | } | - | ||||||
| 235 | - | |||||||
| 236 | int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) | - | ||||||
| 237 | { | - | ||||||
| 238 | return executed 18408 times by 1 test: cipher->iv_len;return cipher->iv_len;Executed by:
executed 18408 times by 1 test: return cipher->iv_len;Executed by:
| 18408 | ||||||
| 239 | } | - | ||||||
| 240 | - | |||||||
| 241 | int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 242 | { | - | ||||||
| 243 | return executed 120663 times by 1 test: ctx->cipher->iv_len;return ctx->cipher->iv_len;Executed by:
executed 120663 times by 1 test: return ctx->cipher->iv_len;Executed by:
| 120663 | ||||||
| 244 | } | - | ||||||
| 245 | - | |||||||
| 246 | const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 247 | { | - | ||||||
| 248 | return executed 2 times by 1 test: ctx->oiv;return ctx->oiv;Executed by:
executed 2 times by 1 test: return ctx->oiv;Executed by:
| 2 | ||||||
| 249 | } | - | ||||||
| 250 | - | |||||||
| 251 | const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 252 | { | - | ||||||
| 253 | return executed 9 times by 1 test: ctx->iv;return ctx->iv;Executed by:
executed 9 times by 1 test: return ctx->iv;Executed by:
| 9 | ||||||
| 254 | } | - | ||||||
| 255 | - | |||||||
| 256 | unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx) | - | ||||||
| 257 | { | - | ||||||
| 258 | return executed 187233 times by 1 test: ctx->iv;return ctx->iv;Executed by:
executed 187233 times by 1 test: return ctx->iv;Executed by:
| 187233 | ||||||
| 259 | } | - | ||||||
| 260 | - | |||||||
| 261 | unsigned char *EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx) | - | ||||||
| 262 | { | - | ||||||
| 263 | return executed 24043 times by 1 test: ctx->buf;return ctx->buf;Executed by:
executed 24043 times by 1 test: return ctx->buf;Executed by:
| 24043 | ||||||
| 264 | } | - | ||||||
| 265 | - | |||||||
| 266 | int EVP_CIPHER_CTX_num(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 267 | { | - | ||||||
| 268 | return executed 61168 times by 1 test: ctx->num;return ctx->num;Executed by:
executed 61168 times by 1 test: return ctx->num;Executed by:
| 61168 | ||||||
| 269 | } | - | ||||||
| 270 | - | |||||||
| 271 | void EVP_CIPHER_CTX_set_num(EVP_CIPHER_CTX *ctx, int num) | - | ||||||
| 272 | { | - | ||||||
| 273 | ctx->num = num; | - | ||||||
| 274 | } executed 61168 times by 1 test: end of blockExecuted by:
| 61168 | ||||||
| 275 | - | |||||||
| 276 | int EVP_CIPHER_key_length(const EVP_CIPHER *cipher) | - | ||||||
| 277 | { | - | ||||||
| 278 | return executed 14443 times by 1 test: cipher->key_len;return cipher->key_len;Executed by:
executed 14443 times by 1 test: return cipher->key_len;Executed by:
| 14443 | ||||||
| 279 | } | - | ||||||
| 280 | - | |||||||
| 281 | int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 282 | { | - | ||||||
| 283 | return executed 3186973 times by 2 tests: ctx->key_len;return ctx->key_len;Executed by:
executed 3186973 times by 2 tests: return ctx->key_len;Executed by:
| 3186973 | ||||||
| 284 | } | - | ||||||
| 285 | - | |||||||
| 286 | int EVP_CIPHER_nid(const EVP_CIPHER *cipher) | - | ||||||
| 287 | { | - | ||||||
| 288 | return executed 47 times by 1 test: cipher->nid;return cipher->nid;Executed by:
executed 47 times by 1 test: return cipher->nid;Executed by:
| 47 | ||||||
| 289 | } | - | ||||||
| 290 | - | |||||||
| 291 | int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) | - | ||||||
| 292 | { | - | ||||||
| 293 | return executed 13 times by 1 test: ctx->cipher->nid;return ctx->cipher->nid;Executed by:
executed 13 times by 1 test: return ctx->cipher->nid;Executed by:
| 13 | ||||||
| 294 | } | - | ||||||
| 295 | - | |||||||
| 296 | int EVP_MD_block_size(const EVP_MD *md) | - | ||||||
| 297 | { | - | ||||||
| 298 | return executed 160570 times by 1 test: md->block_size;return md->block_size;Executed by:
executed 160570 times by 1 test: return md->block_size;Executed by:
| 160570 | ||||||
| 299 | } | - | ||||||
| 300 | - | |||||||
| 301 | int EVP_MD_type(const EVP_MD *md) | - | ||||||
| 302 | { | - | ||||||
| 303 | return executed 28459 times by 1 test: md->type;return md->type;Executed by:
executed 28459 times by 1 test: return md->type;Executed by:
| 28459 | ||||||
| 304 | } | - | ||||||
| 305 | - | |||||||
| 306 | int EVP_MD_pkey_type(const EVP_MD *md) | - | ||||||
| 307 | { | - | ||||||
| 308 | return never executed: md->pkey_type;return md->pkey_type;never executed: return md->pkey_type; | 0 | ||||||
| 309 | } | - | ||||||
| 310 | - | |||||||
| 311 | int EVP_MD_size(const EVP_MD *md) | - | ||||||
| 312 | { | - | ||||||
| 313 | if (!md
| 0-426109 | ||||||
| 314 | ERR_put_error(6,(162),(159),__FILE__,316); | - | ||||||
| 315 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||
| 316 | } | - | ||||||
| 317 | return executed 426109 times by 2 tests: md->md_size;return md->md_size;Executed by:
executed 426109 times by 2 tests: return md->md_size;Executed by:
| 426109 | ||||||
| 318 | } | - | ||||||
| 319 | - | |||||||
| 320 | unsigned long EVP_MD_flags(const EVP_MD *md) | - | ||||||
| 321 | { | - | ||||||
| 322 | return executed 119 times by 1 test: md->flags;return md->flags;Executed by:
executed 119 times by 1 test: return md->flags;Executed by:
| 119 | ||||||
| 323 | } | - | ||||||
| 324 | - | |||||||
| 325 | EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type) | - | ||||||
| 326 | { | - | ||||||
| 327 | EVP_MD *md = CRYPTO_zalloc(sizeof(*md), __FILE__, 329); | - | ||||||
| 328 | - | |||||||
| 329 | if (md !=
| 0-1835 | ||||||
| 330 | ((void *)0)
| 0-1835 | ||||||
| 331 | ) { | - | ||||||
| 332 | md->type = md_type; | - | ||||||
| 333 | md->pkey_type = pkey_type; | - | ||||||
| 334 | } executed 1835 times by 1 test: end of blockExecuted by:
| 1835 | ||||||
| 335 | return executed 1835 times by 1 test: md;return md;Executed by:
executed 1835 times by 1 test: return md;Executed by:
| 1835 | ||||||
| 336 | } | - | ||||||
| 337 | EVP_MD *EVP_MD_meth_dup(const EVP_MD *md) | - | ||||||
| 338 | { | - | ||||||
| 339 | EVP_MD *to = EVP_MD_meth_new(md->type, md->pkey_type); | - | ||||||
| 340 | - | |||||||
| 341 | if (to !=
| 0 | ||||||
| 342 | ((void *)0)
| 0 | ||||||
| 343 | ) | - | ||||||
| 344 | memcpy(to, md, sizeof(*to)); never executed: memcpy(to, md, sizeof(*to)); | 0 | ||||||
| 345 | return never executed: to;return to;never executed: return to; | 0 | ||||||
| 346 | } | - | ||||||
| 347 | void EVP_MD_meth_free(EVP_MD *md) | - | ||||||
| 348 | { | - | ||||||
| 349 | CRYPTO_free(md, __FILE__, 347); | - | ||||||
| 350 | } executed 1835 times by 1 test: end of blockExecuted by:
| 1835 | ||||||
| 351 | int EVP_MD_meth_set_input_blocksize(EVP_MD *md, int blocksize) | - | ||||||
| 352 | { | - | ||||||
| 353 | md->block_size = blocksize; | - | ||||||
| 354 | return executed 1835 times by 1 test: 1;return 1;Executed by:
executed 1835 times by 1 test: return 1;Executed by:
| 1835 | ||||||
| 355 | } | - | ||||||
| 356 | int EVP_MD_meth_set_result_size(EVP_MD *md, int resultsize) | - | ||||||
| 357 | { | - | ||||||
| 358 | md->md_size = resultsize; | - | ||||||
| 359 | return executed 1835 times by 1 test: 1;return 1;Executed by:
executed 1835 times by 1 test: return 1;Executed by:
| 1835 | ||||||
| 360 | } | - | ||||||
| 361 | int EVP_MD_meth_set_app_datasize(EVP_MD *md, int datasize) | - | ||||||
| 362 | { | - | ||||||
| 363 | md->ctx_size = datasize; | - | ||||||
| 364 | return executed 1835 times by 1 test: 1;return 1;Executed by:
executed 1835 times by 1 test: return 1;Executed by:
| 1835 | ||||||
| 365 | } | - | ||||||
| 366 | int EVP_MD_meth_set_flags(EVP_MD *md, unsigned long flags) | - | ||||||
| 367 | { | - | ||||||
| 368 | md->flags = flags; | - | ||||||
| 369 | return executed 1835 times by 1 test: 1;return 1;Executed by:
executed 1835 times by 1 test: return 1;Executed by:
| 1835 | ||||||
| 370 | } | - | ||||||
| 371 | int EVP_MD_meth_set_init(EVP_MD *md, int (*init)(EVP_MD_CTX *ctx)) | - | ||||||
| 372 | { | - | ||||||
| 373 | md->init = init; | - | ||||||
| 374 | return executed 1835 times by 1 test: 1;return 1;Executed by:
executed 1835 times by 1 test: return 1;Executed by:
| 1835 | ||||||
| 375 | } | - | ||||||
| 376 | int EVP_MD_meth_set_update(EVP_MD *md, int (*update)(EVP_MD_CTX *ctx, | - | ||||||
| 377 | const void *data, | - | ||||||
| 378 | size_t count)) | - | ||||||
| 379 | { | - | ||||||
| 380 | md->update = update; | - | ||||||
| 381 | return executed 1835 times by 1 test: 1;return 1;Executed by:
executed 1835 times by 1 test: return 1;Executed by:
| 1835 | ||||||
| 382 | } | - | ||||||
| 383 | int EVP_MD_meth_set_final(EVP_MD *md, int (*final)(EVP_MD_CTX *ctx, | - | ||||||
| 384 | unsigned char *md)) | - | ||||||
| 385 | { | - | ||||||
| 386 | md->final = final; | - | ||||||
| 387 | return executed 1835 times by 1 test: 1;return 1;Executed by:
executed 1835 times by 1 test: return 1;Executed by:
| 1835 | ||||||
| 388 | } | - | ||||||
| 389 | int EVP_MD_meth_set_copy(EVP_MD *md, int (*copy)(EVP_MD_CTX *to, | - | ||||||
| 390 | const EVP_MD_CTX *from)) | - | ||||||
| 391 | { | - | ||||||
| 392 | md->copy = copy; | - | ||||||
| 393 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||
| 394 | } | - | ||||||
| 395 | int EVP_MD_meth_set_cleanup(EVP_MD *md, int (*cleanup)(EVP_MD_CTX *ctx)) | - | ||||||
| 396 | { | - | ||||||
| 397 | md->cleanup = cleanup; | - | ||||||
| 398 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||
| 399 | } | - | ||||||
| 400 | int EVP_MD_meth_set_ctrl(EVP_MD *md, int (*ctrl)(EVP_MD_CTX *ctx, int cmd, | - | ||||||
| 401 | int p1, void *p2)) | - | ||||||
| 402 | { | - | ||||||
| 403 | md->md_ctrl = ctrl; | - | ||||||
| 404 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||
| 405 | } | - | ||||||
| 406 | - | |||||||
| 407 | int EVP_MD_meth_get_input_blocksize(const EVP_MD *md) | - | ||||||
| 408 | { | - | ||||||
| 409 | return never executed: md->block_size;return md->block_size;never executed: return md->block_size; | 0 | ||||||
| 410 | } | - | ||||||
| 411 | int EVP_MD_meth_get_result_size(const EVP_MD *md) | - | ||||||
| 412 | { | - | ||||||
| 413 | return never executed: md->md_size;return md->md_size;never executed: return md->md_size; | 0 | ||||||
| 414 | } | - | ||||||
| 415 | int EVP_MD_meth_get_app_datasize(const EVP_MD *md) | - | ||||||
| 416 | { | - | ||||||
| 417 | return never executed: md->ctx_size;return md->ctx_size;never executed: return md->ctx_size; | 0 | ||||||
| 418 | } | - | ||||||
| 419 | unsigned long EVP_MD_meth_get_flags(const EVP_MD *md) | - | ||||||
| 420 | { | - | ||||||
| 421 | return never executed: md->flags;return md->flags;never executed: return md->flags; | 0 | ||||||
| 422 | } | - | ||||||
| 423 | int (*EVP_MD_meth_get_init(const EVP_MD *md))(EVP_MD_CTX *ctx) | - | ||||||
| 424 | { | - | ||||||
| 425 | return never executed: md->init;return md->init;never executed: return md->init; | 0 | ||||||
| 426 | } | - | ||||||
| 427 | int (*EVP_MD_meth_get_update(const EVP_MD *md))(EVP_MD_CTX *ctx, | - | ||||||
| 428 | const void *data, | - | ||||||
| 429 | size_t count) | - | ||||||
| 430 | { | - | ||||||
| 431 | return never executed: md->update;return md->update;never executed: return md->update; | 0 | ||||||
| 432 | } | - | ||||||
| 433 | int (*EVP_MD_meth_get_final(const EVP_MD *md))(EVP_MD_CTX *ctx, | - | ||||||
| 434 | unsigned char *md) | - | ||||||
| 435 | { | - | ||||||
| 436 | return never executed: md->final;return md->final;never executed: return md->final; | 0 | ||||||
| 437 | } | - | ||||||
| 438 | int (*EVP_MD_meth_get_copy(const EVP_MD *md))(EVP_MD_CTX *to, | - | ||||||
| 439 | const EVP_MD_CTX *from) | - | ||||||
| 440 | { | - | ||||||
| 441 | return never executed: md->copy;return md->copy;never executed: return md->copy; | 0 | ||||||
| 442 | } | - | ||||||
| 443 | int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx) | - | ||||||
| 444 | { | - | ||||||
| 445 | return never executed: md->cleanup;return md->cleanup;never executed: return md->cleanup; | 0 | ||||||
| 446 | } | - | ||||||
| 447 | int (*EVP_MD_meth_get_ctrl(const EVP_MD *md))(EVP_MD_CTX *ctx, int cmd, | - | ||||||
| 448 | int p1, void *p2) | - | ||||||
| 449 | { | - | ||||||
| 450 | return never executed: md->md_ctrl;return md->md_ctrl;never executed: return md->md_ctrl; | 0 | ||||||
| 451 | } | - | ||||||
| 452 | - | |||||||
| 453 | const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx) | - | ||||||
| 454 | { | - | ||||||
| 455 | if (!ctx
| 79614-171354 | ||||||
| 456 | return executed 79614 times by 1 test: return ((void *)0) ;Executed by:
executed 79614 times by 1 test: return ((void *)0) ;Executed by:
| 79614 | ||||||
| 457 | ((void *)0) executed 79614 times by 1 test: return ((void *)0) ;Executed by:
| 79614 | ||||||
| 458 | ; executed 79614 times by 1 test: return ((void *)0) ;Executed by:
| 79614 | ||||||
| 459 | return executed 171354 times by 1 test: ctx->digest;return ctx->digest;Executed by:
executed 171354 times by 1 test: return ctx->digest;Executed by:
| 171354 | ||||||
| 460 | } | - | ||||||
| 461 | - | |||||||
| 462 | EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx) | - | ||||||
| 463 | { | - | ||||||
| 464 | return executed 106253 times by 1 test: ctx->pctx;return ctx->pctx;Executed by:
executed 106253 times by 1 test: return ctx->pctx;Executed by:
| 106253 | ||||||
| 465 | } | - | ||||||
| 466 | - | |||||||
| 467 | void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx) | - | ||||||
| 468 | { | - | ||||||
| 469 | - | |||||||
| 470 | - | |||||||
| 471 | - | |||||||
| 472 | - | |||||||
| 473 | if (!EVP_MD_CTX_test_flags(ctx, 0x0400)
| 0-3 | ||||||
| 474 | EVP_PKEY_CTX_free(ctx->pctx); executed 3 times by 1 test: EVP_PKEY_CTX_free(ctx->pctx);Executed by:
| 3 | ||||||
| 475 | - | |||||||
| 476 | ctx->pctx = pctx; | - | ||||||
| 477 | - | |||||||
| 478 | if (pctx !=
| 0-3 | ||||||
| 479 | ((void *)0)
| 0-3 | ||||||
| 480 | ) { | - | ||||||
| 481 | - | |||||||
| 482 | EVP_MD_CTX_set_flags(ctx, 0x0400); | - | ||||||
| 483 | } executed 3 times by 1 test: else {end of blockExecuted by:
| 3 | ||||||
| 484 | EVP_MD_CTX_clear_flags(ctx, 0x0400); | - | ||||||
| 485 | } never executed: end of block | 0 | ||||||
| 486 | } | - | ||||||
| 487 | - | |||||||
| 488 | void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx) | - | ||||||
| 489 | { | - | ||||||
| 490 | return executed 4002432 times by 2 tests: ctx->md_data;return ctx->md_data;Executed by:
executed 4002432 times by 2 tests: return ctx->md_data;Executed by:
| 4002432 | ||||||
| 491 | } | - | ||||||
| 492 | - | |||||||
| 493 | int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx, | - | ||||||
| 494 | const void *data, size_t count) | - | ||||||
| 495 | { | - | ||||||
| 496 | return never executed: ctx->update;return ctx->update;never executed: return ctx->update; | 0 | ||||||
| 497 | } | - | ||||||
| 498 | - | |||||||
| 499 | void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx, | - | ||||||
| 500 | int (*update) (EVP_MD_CTX *ctx, | - | ||||||
| 501 | const void *data, size_t count)) | - | ||||||
| 502 | { | - | ||||||
| 503 | ctx->update = update; | - | ||||||
| 504 | } executed 19278 times by 1 test: end of blockExecuted by:
| 19278 | ||||||
| 505 | - | |||||||
| 506 | void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags) | - | ||||||
| 507 | { | - | ||||||
| 508 | ctx->flags |= flags; | - | ||||||
| 509 | } executed 494387 times by 1 test: end of blockExecuted by:
| 494387 | ||||||
| 510 | - | |||||||
| 511 | void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags) | - | ||||||
| 512 | { | - | ||||||
| 513 | ctx->flags &= ~flags; | - | ||||||
| 514 | } executed 1712324 times by 3 tests: end of blockExecuted by:
| 1712324 | ||||||
| 515 | - | |||||||
| 516 | int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags) | - | ||||||
| 517 | { | - | ||||||
| 518 | return executed 3624465 times by 3 tests: (ctx->flags & flags);return (ctx->flags & flags);Executed by:
executed 3624465 times by 3 tests: return (ctx->flags & flags);Executed by:
| 3624465 | ||||||
| 519 | } | - | ||||||
| 520 | - | |||||||
| 521 | void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags) | - | ||||||
| 522 | { | - | ||||||
| 523 | ctx->flags |= flags; | - | ||||||
| 524 | } executed 8361 times by 1 test: end of blockExecuted by:
| 8361 | ||||||
| 525 | - | |||||||
| 526 | void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags) | - | ||||||
| 527 | { | - | ||||||
| 528 | ctx->flags &= ~flags; | - | ||||||
| 529 | } never executed: end of block | 0 | ||||||
| 530 | - | |||||||
| 531 | int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags) | - | ||||||
| 532 | { | - | ||||||
| 533 | return executed 28481639 times by 2 tests: (ctx->flags & flags);return (ctx->flags & flags);Executed by:
executed 28481639 times by 2 tests: return (ctx->flags & flags);Executed by:
| 28481639 | ||||||
| 534 | } | - | ||||||
| Switch to Source code | Preprocessed file |