OpenCoverage

e_bf.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/e_bf.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,-
5 const unsigned char *iv, int enc);-
6-
7typedef struct {-
8 BF_KEY ks;-
9} EVP_BF_KEY;-
10-
11-
12-
13static 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))
inl>=((size_t)...of(long)*8-2))Description
TRUEnever evaluated
FALSEevaluated 261 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { BF_cbc_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), EVP_CIPHER_CTX_encrypting(ctx)); inl-=((size_t)1<<(sizeof(long)*8-2)); in +=((size_t)1<<(sizeof(long)*8-2)); out+=((size_t)1<<(sizeof(long)*8-2)); }
never executed: end of block
if (inl
inlDescription
TRUEevaluated 261 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) BF_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 261 times by 1 test: BF_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:
  • libcrypto.so.1.1
return
executed 261 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 261 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} 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 == 1
64 == 1Description
TRUEnever evaluated
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) chunk >>= 3;
never executed: chunk >>= 3;
if (inl < chunk
inl < chunkDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) chunk = inl;
executed 70 times by 1 test: chunk = inl;
Executed by:
  • libcrypto.so.1.1
while (inl
inlDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& inl >= chunk
inl >= chunkDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) { int num = EVP_CIPHER_CTX_num(ctx); BF_cfb64_encrypt(in, out, (long) ((64 == 1) && !EVP_CIPHER_CTX_test_flags(ctx, 0x2000) ? chunk*8 : chunk), &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), &num, EVP_CIPHER_CTX_encrypting(ctx)); EVP_CIPHER_CTX_set_num(ctx, num); inl -= chunk; in += chunk; out += chunk; if (inl < chunk
inl < chunkDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) chunk = inl;
executed 70 times by 1 test: chunk = inl;
Executed by:
  • libcrypto.so.1.1
}
executed 70 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
return
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} 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 < bl
inl < blDescription
TRUEnever evaluated
FALSEevaluated 129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) return
never executed: return 1;
1;
never executed: return 1;
inl -= bl; for (i=0; i <= inl
i <= inlDescription
TRUEevaluated 1572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i+=bl) BF_ecb_encrypt(in + i, out + i, &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_encrypting(ctx));
executed 1572 times by 1 test: BF_ecb_encrypt(in + i, out + i, &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_encrypting(ctx));
Executed by:
  • libcrypto.so.1.1
return
executed 129 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 129 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} 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))
inl>=((size_t)...of(long)*8-2))Description
TRUEnever evaluated
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { int num = EVP_CIPHER_CTX_num(ctx); BF_ofb64_encrypt(in, out, (long)((size_t)1<<(sizeof(long)*8-2)), &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), &num); EVP_CIPHER_CTX_set_num(ctx, num); inl-=((size_t)1<<(sizeof(long)*8-2)); in +=((size_t)1<<(sizeof(long)*8-2)); out+=((size_t)1<<(sizeof(long)*8-2)); }
never executed: end of block
if (inl
inlDescription
TRUEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) { int num = EVP_CIPHER_CTX_num(ctx); BF_ofb64_encrypt(in, out, (long)inl, &((EVP_BF_KEY *)EVP_CIPHER_CTX_get_cipher_data(ctx))->ks, EVP_CIPHER_CTX_iv_noconst(ctx), &num); EVP_CIPHER_CTX_set_num(ctx, num); }
executed 70 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
return
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 70 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER bf_cbc = { 91, 8, 16, 8, 0x8 | 0x2, bf_init_key, bf_cbc_cipher,
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: return &bf_cbc;
Executed by:
  • libcrypto.so.1.1
&bf_cbc;
executed 1962 times by 1 test: return &bf_cbc;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER bf_cfb64 = { 93, 1, 16, 8, 0x8 | 0x3, bf_init_key, bf_cfb64_cipher,
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: return &bf_cfb64;
Executed by:
  • libcrypto.so.1.1
&bf_cfb64;
executed 1962 times by 1 test: return &bf_cfb64;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER bf_ofb = { 94, 1, 16, 8, 0x8 | 0x4, bf_init_key, bf_ofb_cipher,
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: return &bf_ofb;
Executed by:
  • libcrypto.so.1.1
&bf_ofb;
executed 1962 times by 1 test: return &bf_ofb;
Executed by:
  • libcrypto.so.1.1
} static const EVP_CIPHER bf_ecb = { 92, 8, 16, 0, 0x8 | 0x1, bf_init_key, bf_ecb_cipher,
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: return &bf_ecb;
Executed by:
  • libcrypto.so.1.1
&bf_ecb;
executed 1962 times by 1 test: return &bf_ecb;
Executed by:
  • libcrypto.so.1.1
}
1962
38-
39-
40-
41static 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: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 32 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
32
46}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2