OpenCoverage

pmeth_fn.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/pmeth_fn.c
Switch to Source codePreprocessed file
LineSourceCount
1int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx)-
2{-
3 int ret;-
4 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 2018 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 2018 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->sign
!ctx->pmeth->signDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2016 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2018
5 ERR_put_error(6,(141),(150),__FILE__,40)-
6 ;-
7 return
executed 2 times by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
-2;
executed 2 times by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
2
8 }-
9 ctx->operation = (1<<3);-
10 if (!ctx->pmeth->sign_init
!ctx->pmeth->sign_initDescription
TRUEevaluated 2013 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
3-2013
11 return
executed 2013 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2013 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2013
12 ret = ctx->pmeth->sign_init(ctx);-
13 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-3
14 ctx->operation = 0;
never executed: ctx->operation = 0;
0
15 return
executed 3 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 3 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
3
16}-
17-
18int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,-
19 unsigned char *sig, size_t *siglen,-
20 const unsigned char *tbs, size_t tbslen)-
21{-
22 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 2105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 2105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->sign
!ctx->pmeth->signDescription
TRUEnever evaluated
FALSEevaluated 2105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2105
23 ERR_put_error(6,(140),(150),__FILE__,58)-
24 ;-
25 return
never executed: return -2;
-2;
never executed: return -2;
0
26 }-
27 if (ctx->operation != (1<<3)
ctx->operation != (1<<3)Description
TRUEnever evaluated
FALSEevaluated 2105 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2105
28 ERR_put_error(6,(140),(151),__FILE__,62);-
29 return
never executed: return -1;
-1;
never executed: return -1;
0
30 }-
31 if (ctx->pmeth->flags & 2
ctx->pmeth->flags & 2Description
TRUEevaluated 1806 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 299 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); if (pksize == 0
pksize == 0Description
TRUEnever evaluated
FALSEevaluated 1806 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(140),(163),__FILE__,65); return
never executed: return 0;
0;
never executed: return 0;
} if (!sig
!sigDescription
TRUEevaluated 88 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1718 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { *siglen = pksize; return
executed 88 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 88 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} if (*
*siglen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 1718 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
siglen < pksize
*siglen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 1718 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(140),(155),__FILE__,65); return
never executed: return 0;
0;
never executed: return 0;
} }
executed 1718 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
0-1806
32 return
executed 2017 times by 1 test: return ctx->pmeth->sign(ctx, sig, siglen, tbs, tbslen);
Executed by:
  • libcrypto.so.1.1
ctx->pmeth->sign(ctx, sig, siglen, tbs, tbslen);
executed 2017 times by 1 test: return ctx->pmeth->sign(ctx, sig, siglen, tbs, tbslen);
Executed by:
  • libcrypto.so.1.1
2017
33}-
34-
35int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx)-
36{-
37 int ret;-
38 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 3331 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 3331 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->verify
!ctx->pmeth->verifyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3329 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-3331
39 ERR_put_error(6,(143),(150),__FILE__,74)-
40 ;-
41 return
executed 2 times by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
-2;
executed 2 times by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
2
42 }-
43 ctx->operation = (1<<4);-
44 if (!ctx->pmeth->verify_init
!ctx->pmeth->verify_initDescription
TRUEevaluated 3313 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
16-3313
45 return
executed 3313 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 3313 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
3313
46 ret = ctx->pmeth->verify_init(ctx);-
47 if (ret <= 0
ret <= 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
2-14
48 ctx->operation = 0;
executed 2 times by 1 test: ctx->operation = 0;
Executed by:
  • libcrypto.so.1.1
2
49 return
executed 16 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 16 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
16
50}-
51-
52int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,-
53 const unsigned char *sig, size_t siglen,-
54 const unsigned char *tbs, size_t tbslen)-
55{-
56 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 3327 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 3327 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->verify
!ctx->pmeth->verifyDescription
TRUEnever evaluated
FALSEevaluated 3327 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-3327
57 ERR_put_error(6,(142),(150),__FILE__,92)-
58 ;-
59 return
never executed: return -2;
-2;
never executed: return -2;
0
60 }-
61 if (ctx->operation != (1<<4)
ctx->operation != (1<<4)Description
TRUEnever evaluated
FALSEevaluated 3327 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-3327
62 ERR_put_error(6,(142),(151),__FILE__,96);-
63 return
never executed: return -1;
-1;
never executed: return -1;
0
64 }-
65 return
executed 3327 times by 1 test: return ctx->pmeth->verify(ctx, sig, siglen, tbs, tbslen);
Executed by:
  • libcrypto.so.1.1
ctx->pmeth->verify(ctx, sig, siglen, tbs, tbslen);
executed 3327 times by 1 test: return ctx->pmeth->verify(ctx, sig, siglen, tbs, tbslen);
Executed by:
  • libcrypto.so.1.1
3327
66}-
67-
68int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx)-
69{-
70 int ret;-
71 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->verify_recover
!ctx->pmeth->verify_recoverDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-11
72 ERR_put_error(6,(145),(150),__FILE__,107)-
73 ;-
74 return
never executed: return -2;
-2;
never executed: return -2;
0
75 }-
76 ctx->operation = (1<<5);-
77 if (!ctx->pmeth->verify_recover_init
!ctx->pmeth->v...y_recover_initDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-11
78 return
executed 11 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 11 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
11
79 ret = ctx->pmeth->verify_recover_init(ctx);-
80 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
81 ctx->operation = 0;
never executed: ctx->operation = 0;
0
82 return
never executed: return ret;
ret;
never executed: return ret;
0
83}-
84-
85int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,-
86 unsigned char *rout, size_t *routlen,-
87 const unsigned char *sig, size_t siglen)-
88{-
89 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->verify_recover
!ctx->pmeth->verify_recoverDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-22
90 ERR_put_error(6,(144),(150),__FILE__,125)-
91 ;-
92 return
never executed: return -2;
-2;
never executed: return -2;
0
93 }-
94 if (ctx->operation != (1<<5)
ctx->operation != (1<<5)Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-22
95 ERR_put_error(6,(144),(151),__FILE__,129);-
96 return
never executed: return -1;
-1;
never executed: return -1;
0
97 }-
98 if (ctx->pmeth->flags & 2
ctx->pmeth->flags & 2Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) { size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); if (pksize == 0
pksize == 0Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(144),(163),__FILE__,132); return
never executed: return 0;
0;
never executed: return 0;
} if (!rout
!routDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { *routlen = pksize; return
executed 11 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 11 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} if (*
*routlen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
routlen < pksize
*routlen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(144),(155),__FILE__,132); return
never executed: return 0;
0;
never executed: return 0;
} }
executed 11 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
0-22
99 return
executed 11 times by 1 test: return ctx->pmeth->verify_recover(ctx, rout, routlen, sig, siglen);
Executed by:
  • libcrypto.so.1.1
ctx->pmeth->verify_recover(ctx, rout, routlen, sig, siglen);
executed 11 times by 1 test: return ctx->pmeth->verify_recover(ctx, rout, routlen, sig, siglen);
Executed by:
  • libcrypto.so.1.1
11
100}-
101-
102int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx)-
103{-
104 int ret;-
105 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 493 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 493 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->encrypt
!ctx->pmeth->encryptDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-493
106 ERR_put_error(6,(139),(150),__FILE__,141)-
107 ;-
108 return
executed 1 time by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
-2;
executed 1 time by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
1
109 }-
110 ctx->operation = (1<<8);-
111 if (!ctx->pmeth->encrypt_init
!ctx->pmeth->encrypt_initDescription
TRUEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-492
112 return
executed 492 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 492 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
492
113 ret = ctx->pmeth->encrypt_init(ctx);-
114 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
115 ctx->operation = 0;
never executed: ctx->operation = 0;
0
116 return
never executed: return ret;
ret;
never executed: return ret;
0
117}-
118-
119int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,-
120 unsigned char *out, size_t *outlen,-
121 const unsigned char *in, size_t inlen)-
122{-
123 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->encrypt
!ctx->pmeth->encryptDescription
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-978
124 ERR_put_error(6,(105),(150),__FILE__,159)-
125 ;-
126 return
never executed: return -2;
-2;
never executed: return -2;
0
127 }-
128 if (ctx->operation != (1<<8)
ctx->operation != (1<<8)Description
TRUEnever evaluated
FALSEevaluated 978 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-978
129 ERR_put_error(6,(105),(151),__FILE__,163);-
130 return
never executed: return -1;
-1;
never executed: return -1;
0
131 }-
132 if (ctx->pmeth->flags & 2
ctx->pmeth->flags & 2Description
TRUEevaluated 975 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); if (pksize == 0
pksize == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 974 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(105),(163),__FILE__,166); return
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 1 time by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
} if (!out
!outDescription
TRUEevaluated 486 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 488 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { *outlen = pksize; return
executed 486 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 486 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} if (*
*outlen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 488 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
outlen < pksize
*outlen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 488 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(105),(155),__FILE__,166); return
never executed: return 0;
0;
never executed: return 0;
} }
executed 488 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
0-975
133 return
executed 491 times by 1 test: return ctx->pmeth->encrypt(ctx, out, outlen, in, inlen);
Executed by:
  • libcrypto.so.1.1
ctx->pmeth->encrypt(ctx, out, outlen, in, inlen);
executed 491 times by 1 test: return ctx->pmeth->encrypt(ctx, out, outlen, in, inlen);
Executed by:
  • libcrypto.so.1.1
491
134}-
135-
136int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx)-
137{-
138 int ret;-
139 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 92 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->decrypt
!ctx->pmeth->decryptDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 91 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-92
140 ERR_put_error(6,(138),(150),__FILE__,175)-
141 ;-
142 return
executed 1 time by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
-2;
executed 1 time by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
1
143 }-
144 ctx->operation = (1<<9);-
145 if (!ctx->pmeth->decrypt_init
!ctx->pmeth->decrypt_initDescription
TRUEevaluated 91 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-91
146 return
executed 91 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 91 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
91
147 ret = ctx->pmeth->decrypt_init(ctx);-
148 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
149 ctx->operation = 0;
never executed: ctx->operation = 0;
0
150 return
never executed: return ret;
ret;
never executed: return ret;
0
151}-
152-
153int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,-
154 unsigned char *out, size_t *outlen,-
155 const unsigned char *in, size_t inlen)-
156{-
157 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->decrypt
!ctx->pmeth->decryptDescription
TRUEnever evaluated
FALSEevaluated 181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-181
158 ERR_put_error(6,(104),(150),__FILE__,193)-
159 ;-
160 return
never executed: return -2;
-2;
never executed: return -2;
0
161 }-
162 if (ctx->operation != (1<<9)
ctx->operation != (1<<9)Description
TRUEnever evaluated
FALSEevaluated 181 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-181
163 ERR_put_error(6,(104),(151),__FILE__,197);-
164 return
never executed: return -1;
-1;
never executed: return -1;
0
165 }-
166 if (ctx->pmeth->flags & 2
ctx->pmeth->flags & 2Description
TRUEevaluated 178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); if (pksize == 0
pksize == 0Description
TRUEnever evaluated
FALSEevaluated 178 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(104),(163),__FILE__,200); return
never executed: return 0;
0;
never executed: return 0;
} if (!out
!outDescription
TRUEevaluated 89 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 89 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { *outlen = pksize; return
executed 89 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 89 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
} if (*
*outlen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 89 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
outlen < pksize
*outlen < pksizeDescription
TRUEnever evaluated
FALSEevaluated 89 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { ERR_put_error(6,(104),(155),__FILE__,200); return
never executed: return 0;
0;
never executed: return 0;
} }
executed 89 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
0-178
167 return
executed 92 times by 1 test: return ctx->pmeth->decrypt(ctx, out, outlen, in, inlen);
Executed by:
  • libcrypto.so.1.1
ctx->pmeth->decrypt(ctx, out, outlen, in, inlen);
executed 92 times by 1 test: return ctx->pmeth->decrypt(ctx, out, outlen, in, inlen);
Executed by:
  • libcrypto.so.1.1
92
168}-
169-
170int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx)-
171{-
172 int ret;-
173 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 46538 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 46538 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->derive
!ctx->pmeth->deriveDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 46537 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-46538
174 ERR_put_error(6,(154),(150),__FILE__,209)-
175 ;-
176 return
executed 1 time by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
-2;
executed 1 time by 1 test: return -2;
Executed by:
  • libcrypto.so.1.1
1
177 }-
178 ctx->operation = (1<<10);-
179 if (!ctx->pmeth->derive_init
!ctx->pmeth->derive_initDescription
TRUEevaluated 46537 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-46537
180 return
executed 46537 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 46537 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
46537
181 ret = ctx->pmeth->derive_init(ctx);-
182 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
183 ctx->operation = 0;
never executed: ctx->operation = 0;
0
184 return
never executed: return ret;
ret;
never executed: return ret;
0
185}-
186-
187int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer)-
188{-
189 int ret;-
190 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4367
191 || !(ctx->pmeth->derive
ctx->pmeth->deriveDescription
TRUEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
|| ctx->pmeth->encrypt
ctx->pmeth->encryptDescription
TRUEnever evaluated
FALSEnever evaluated
|| ctx->pmeth->decrypt
ctx->pmeth->decryptDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-4367
192 || !ctx->pmeth->ctrl
!ctx->pmeth->ctrlDescription
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4367
193 ERR_put_error(6,(155),(150),__FILE__,228)-
194 ;-
195 return
never executed: return -2;
-2;
never executed: return -2;
0
196 }-
197 if (ctx->operation != (1<<10)
ctx->operation != (1<<10)Description
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4367
198 && ctx->operation != (1<<8)
ctx->operation != (1<<8)Description
TRUEnever evaluated
FALSEnever evaluated
0
199 && ctx->operation != (1<<9)
ctx->operation != (1<<9)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
200 ERR_put_error(6,(155),(151),__FILE__,235)-
201 ;-
202 return
never executed: return -1;
-1;
never executed: return -1;
0
203 }-
204-
205 ret = ctx->pmeth->ctrl(ctx, 2, 0, peer);-
206-
207 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4367
208 return
never executed: return ret;
ret;
never executed: return ret;
0
209-
210 if (ret == 2
ret == 2Description
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4367
211 return
never executed: return 1;
1;
never executed: return 1;
0
212-
213 if (!ctx->pkey
!ctx->pkeyDescription
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4367
214 ERR_put_error(6,(155),(154),__FILE__,248);-
215 return
never executed: return -1;
-1;
never executed: return -1;
0
216 }-
217-
218 if (ctx->pkey->type != peer->type
ctx->pkey->type != peer->typeDescription
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4367
219 ERR_put_error(6,(155),(101),__FILE__,253);-
220 return
never executed: return -1;
-1;
never executed: return -1;
0
221 }-
222 if (!EVP_PKEY_missing_parameters(peer)
!EVP_PKEY_miss...rameters(peer)Description
TRUEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&&
0-4367
223 !EVP_PKEY_cmp_parameters(ctx->pkey, peer)
!EVP_PKEY_cmp_...x->pkey, peer)Description
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4367
224 ERR_put_error(6,(155),(153),__FILE__,266);-
225 return
never executed: return -1;
-1;
never executed: return -1;
0
226 }-
227-
228 EVP_PKEY_free(ctx->peerkey);-
229 ctx->peerkey = peer;-
230-
231 ret = ctx->pmeth->ctrl(ctx, 2, 1, peer);-
232-
233 if (ret <= 0
ret <= 0Description
TRUEnever evaluated
FALSEevaluated 4367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4367
234 ctx->peerkey = -
235 ((void *)0)-
236 ;-
237 return
never executed: return ret;
ret;
never executed: return ret;
0
238 }-
239-
240 EVP_PKEY_up_ref(peer);-
241 return
executed 4367 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4367 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4367
242}-
243-
244int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *pkeylen)-
245{-
246 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 50891 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth
!ctx->pmethDescription
TRUEnever evaluated
FALSEevaluated 50891 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| !ctx->pmeth->derive
!ctx->pmeth->deriveDescription
TRUEnever evaluated
FALSEevaluated 50891 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-50891
247 ERR_put_error(6,(153),(150),__FILE__,288)-
248 ;-
249 return
never executed: return -2;
-2;
never executed: return -2;
0
250 }-
251 if (ctx->operation != (1<<10)
ctx->operation != (1<<10)Description
TRUEnever evaluated
FALSEevaluated 50891 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-50891
252 ERR_put_error(6,(153),(151),__FILE__,292);-
253 return
never executed: return -1;
-1;
never executed: return -1;
0
254 }-
255 if (ctx->pmeth->flags & 2
ctx->pmeth->flags & 2Description
TRUEnever evaluated
FALSEevaluated 50891 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) { size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); if (pksize == 0
pksize == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { ERR_put_error(6,(153),(163),__FILE__,295); return
never executed: return 0;
0;
never executed: return 0;
} if (!key
!keyDescription
TRUEnever evaluated
FALSEnever evaluated
) { *pkeylen = pksize; return
never executed: return 1;
1;
never executed: return 1;
} if (*
*pkeylen < pksizeDescription
TRUEnever evaluated
FALSEnever evaluated
pkeylen < pksize
*pkeylen < pksizeDescription
TRUEnever evaluated
FALSEnever evaluated
) { ERR_put_error(6,(153),(155),__FILE__,295); return
never executed: return 0;
0;
never executed: return 0;
} }
never executed: end of block
0-50891
256 return
executed 50891 times by 1 test: return ctx->pmeth->derive(ctx, key, pkeylen);
Executed by:
  • libcrypto.so.1.1
ctx->pmeth->derive(ctx, key, pkeylen);
executed 50891 times by 1 test: return ctx->pmeth->derive(ctx, key, pkeylen);
Executed by:
  • libcrypto.so.1.1
50891
257}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2