OpenCoverage

cmeth_lib.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/cmeth_lib.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len)-
4{-
5 EVP_CIPHER *cipher = CRYPTO_zalloc(sizeof(EVP_CIPHER), __FILE__, 18);-
6-
7 if (cipher !=
cipher != ((void *)0)Description
TRUEevaluated 259 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-259
8 ((void *)0)
cipher != ((void *)0)Description
TRUEevaluated 259 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-259
9 ) {-
10 cipher->nid = cipher_type;-
11 cipher->block_size = block_size;-
12 cipher->key_len = key_len;-
13 }
executed 259 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
259
14 return
executed 259 times by 1 test: return cipher;
Executed by:
  • libcrypto.so.1.1
cipher;
executed 259 times by 1 test: return cipher;
Executed by:
  • libcrypto.so.1.1
259
15}-
16-
17EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher)-
18{-
19 EVP_CIPHER *to = EVP_CIPHER_meth_new(cipher->nid, cipher->block_size,-
20 cipher->key_len);-
21-
22 if (to !=
to != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
23 ((void *)0)
to != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
24 )-
25 memcpy(to, cipher, sizeof(*to));
never executed: memcpy(to, cipher, sizeof(*to));
0
26 return
never executed: return to;
to;
never executed: return to;
0
27}-
28-
29void EVP_CIPHER_meth_free(EVP_CIPHER *cipher)-
30{-
31 CRYPTO_free(cipher, __FILE__, 40);-
32}
executed 737 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
737
33-
34int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len)-
35{-
36 cipher->iv_len = iv_len;-
37 return
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
259
38}-
39-
40int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags)-
41{-
42 cipher->flags = flags;-
43 return
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
259
44}-
45-
46int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size)-
47{-
48 cipher->ctx_size = ctx_size;-
49 return
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
259
50}-
51-
52int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher,-
53 int (*init) (EVP_CIPHER_CTX *ctx,-
54 const unsigned char *key,-
55 const unsigned char *iv,-
56 int enc))-
57{-
58 cipher->init = init;-
59 return
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
259
60}-
61-
62int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher,-
63 int (*do_cipher) (EVP_CIPHER_CTX *ctx,-
64 unsigned char *out,-
65 const unsigned char *in,-
66 size_t inl))-
67{-
68 cipher->do_cipher = do_cipher;-
69 return
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 259 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
259
70}-
71-
72int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher,-
73 int (*cleanup) (EVP_CIPHER_CTX *))-
74{-
75 cipher->cleanup = cleanup;-
76 return
executed 3 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3
77}-
78-
79int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher,-
80 int (*set_asn1_parameters) (EVP_CIPHER_CTX *,-
81 ASN1_TYPE *))-
82{-
83 cipher->set_asn1_parameters = set_asn1_parameters;-
84 return
never executed: return 1;
1;
never executed: return 1;
0
85}-
86-
87int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher,-
88 int (*get_asn1_parameters) (EVP_CIPHER_CTX *,-
89 ASN1_TYPE *))-
90{-
91 cipher->get_asn1_parameters = get_asn1_parameters;-
92 return
never executed: return 1;
1;
never executed: return 1;
0
93}-
94-
95int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher,-
96 int (*ctrl) (EVP_CIPHER_CTX *, int type,-
97 int arg, void *ptr))-
98{-
99 cipher->ctrl = ctrl;-
100 return
executed 121 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 121 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
121
101}-
102-
103-
104int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,-
105 const unsigned char *key,-
106 const unsigned char *iv,-
107 int enc)-
108{-
109 return
executed 2089 times by 1 test: return cipher->init;
Executed by:
  • libcrypto.so.1.1
cipher->init;
executed 2089 times by 1 test: return cipher->init;
Executed by:
  • libcrypto.so.1.1
2089
110}-
111int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx,-
112 unsigned char *out,-
113 const unsigned char *in,-
114 size_t inl)-
115{-
116 return
executed 3361 times by 1 test: return cipher->do_cipher;
Executed by:
  • libcrypto.so.1.1
cipher->do_cipher;
executed 3361 times by 1 test: return cipher->do_cipher;
Executed by:
  • libcrypto.so.1.1
3361
117}-
118-
119int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *)-
120{-
121 return
never executed: return cipher->cleanup;
cipher->cleanup;
never executed: return cipher->cleanup;
0
122}-
123-
124int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,-
125 ASN1_TYPE *)-
126{-
127 return
never executed: return cipher->set_asn1_parameters;
cipher->set_asn1_parameters;
never executed: return cipher->set_asn1_parameters;
0
128}-
129-
130int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,-
131 ASN1_TYPE *)-
132{-
133 return
never executed: return cipher->get_asn1_parameters;
cipher->get_asn1_parameters;
never executed: return cipher->get_asn1_parameters;
0
134}-
135-
136int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *,-
137 int type, int arg,-
138 void *ptr)-
139{-
140 return
executed 1788 times by 1 test: return cipher->ctrl;
Executed by:
  • libcrypto.so.1.1
cipher->ctrl;
executed 1788 times by 1 test: return cipher->ctrl;
Executed by:
  • libcrypto.so.1.1
1788
141}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2