Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/e_bf.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | const unsigned char *iv, int enc); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | typedef struct { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | BF_KEY ks; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | } EVP_BF_KEY; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13 | static int bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { while(inl>=((size_t)1<<(sizeof(long)*8-2))
never executed: if (inlend of block
executed 261 times by 1 test: returnBF_cbc_encrypt(in, out, (long)inl, &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); Executed by:
executed 261 times by 1 test: 1;return 1; Executed by:
executed 261 times by 1 test: } static int bf_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { size_t chunk = ((size_t)1<<(sizeof(long)*8-2)); if (64 == 1return 1; Executed by:
never executed: if (inl < chunkchunk >>= 3;
executed 70 times by 1 test: while (inlchunk = inl; Executed by:
executed 70 times by 1 test: }chunk = inl; Executed by:
executed 70 times by 1 test: returnend of block Executed by:
executed 70 times by 1 test: 1;return 1; Executed by:
executed 70 times by 1 test: } static int bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { size_t i, bl; bl = EVP_CIPHER_CTX_cipher(ctx)->block_size; if (inl < blreturn 1; Executed by:
never executed: 1;return 1; never executed: inl -= bl; for (i=0; i <= inlreturn 1;
executed 1572 times by 1 test: returnBF_ecb_encrypt(in + i, out + i, &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_encrypting(ctx)); Executed by:
executed 129 times by 1 test: 1;return 1; Executed by:
executed 129 times by 1 test: } static int bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { while(inl>=((size_t)1<<(sizeof(long)*8-2))return 1; Executed by:
never executed: if (inlend of block
executed 70 times by 1 test: returnend of block Executed by:
executed 70 times by 1 test: 1;return 1; Executed by:
executed 70 times by 1 test: } static const EVP_CIPHER bf_cbc = { 91, 8, 16, 8, 0x8 | 0x2, bf_init_key, bf_cbc_cipher, return 1; Executed by:
| 0-1572 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19 | }; const EVP_CIPHER *EVP_bf_cbc(void) { return executed 1962 times by 1 test: &bf_cbc;return &bf_cbc; Executed by:
executed 1962 times by 1 test: } static const EVP_CIPHER bf_cfb64 = { 93, 1, 16, 8, 0x8 | 0x3, bf_init_key, bf_cfb64_cipher, return &bf_cbc; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 | }; const EVP_CIPHER *EVP_bf_cfb64(void) { return executed 1962 times by 1 test: &bf_cfb64;return &bf_cfb64; Executed by:
executed 1962 times by 1 test: } static const EVP_CIPHER bf_ofb = { 94, 1, 16, 8, 0x8 | 0x4, bf_init_key, bf_ofb_cipher, return &bf_cfb64; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31 | }; const EVP_CIPHER *EVP_bf_ofb(void) { return executed 1962 times by 1 test: &bf_ofb;return &bf_ofb; Executed by:
executed 1962 times by 1 test: } static const EVP_CIPHER bf_ecb = { 92, 8, 16, 0, 0x8 | 0x1, bf_init_key, bf_ecb_cipher, return &bf_ofb; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33 | , sizeof(EVP_BF_KEY), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35 | , | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37 | }; const EVP_CIPHER *EVP_bf_ecb(void) { return executed 1962 times by 1 test: &bf_ecb;return &bf_ecb; Executed by:
executed 1962 times by 1 test: }return &bf_ecb; Executed by:
| 1962 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | const unsigned char *iv, int enc) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | BF_set_key(&((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_key_length(ctx), key); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45 | return executed 32 times by 1 test: 1;return 1; Executed by:
executed 32 times by 1 test: return 1; Executed by:
| 32 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |