OpenCoverage

pk7_smime.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/pkcs7/pk7_smime.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/*-
2 * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.-
3 *-
4 * Licensed under the OpenSSL license (the "License"). You may not use-
5 * this file except in compliance with the License. You can obtain a copy-
6 * in the file LICENSE in the source distribution or at-
7 * https://www.openssl.org/source/license.html-
8 */-
9-
10/* Simple PKCS#7 processing functions */-
11-
12#include <stdio.h>-
13#include "internal/cryptlib.h"-
14#include <openssl/x509.h>-
15#include <openssl/x509v3.h>-
16-
17-
18#define BUFFERSIZE 4096-
19-
20static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);-
21-
22PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,-
23 BIO *data, int flags)-
24{-
25 PKCS7 *p7;-
26 int i;-
27-
28 if ((p7 = PKCS7_new()) == NULL) {
(p7 = PKCS7_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11
29 PKCS7err(PKCS7_F_PKCS7_SIGN, ERR_R_MALLOC_FAILURE);-
30 return NULL;
never executed: return ((void *)0) ;
0
31 }-
32-
33 if (!PKCS7_set_type(p7, NID_pkcs7_signed))
!PKCS7_set_type(p7, 22)Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11
34 goto err;
never executed: goto err;
0
35-
36 if (!PKCS7_content_new(p7, NID_pkcs7_data))
!PKCS7_content_new(p7, 21)Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-11
37 goto err;
never executed: goto err;
0
38-
39 if (pkey && !PKCS7_sign_add_signer(p7, signcert, pkey, NULL, flags)) {
pkeyDescription
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!PKCS7_sign_ad... *)0) , flags)Description
TRUEnever evaluated
FALSEnever evaluated
0-11
40 PKCS7err(PKCS7_F_PKCS7_SIGN, PKCS7_R_PKCS7_ADD_SIGNER_ERROR);-
41 goto err;
never executed: goto err;
0
42 }-
43-
44 if (!(flags & PKCS7_NOCERTS)) {
!(flags & 0x2)Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-11
45 for (i = 0; i < sk_X509_num(certs); i++) {
i < sk_X509_num(certs)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-11
46 if (!PKCS7_add_certificate(p7, sk_X509_value(certs, i)))
!PKCS7_add_cer...lue(certs, i))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
47 goto err;
never executed: goto err;
0
48 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
49 }
executed 11 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
11
50-
51 if (flags & PKCS7_DETACHED)
flags & 0x40Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-7
52 PKCS7_set_detached(p7, 1);
executed 4 times by 1 test: PKCS7_ctrl(p7,1,1, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
4
53-
54 if (flags & (PKCS7_STREAM | PKCS7_PARTIAL))
flags & (0x1000 | 0x4000)Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-11
55 return p7;
executed 11 times by 1 test: return p7;
Executed by:
  • libcrypto.so.1.1
11
56-
57 if (PKCS7_final(p7, data, flags))
PKCS7_final(p7, data, flags)Description
TRUEnever evaluated
FALSEnever evaluated
0
58 return p7;
never executed: return p7;
0
59-
60 err:
code before this statement never executed: err:
0
61 PKCS7_free(p7);-
62 return NULL;
never executed: return ((void *)0) ;
0
63}-
64-
65int PKCS7_final(PKCS7 *p7, BIO *data, int flags)-
66{-
67 BIO *p7bio;-
68 int ret = 0;-
69-
70 if ((p7bio = PKCS7_dataInit(p7, NULL)) == NULL) {
(p7bio = PKCS7...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
71 PKCS7err(PKCS7_F_PKCS7_FINAL, ERR_R_MALLOC_FAILURE);-
72 return 0;
never executed: return 0;
0
73 }-
74-
75 SMIME_crlf_copy(data, p7bio, flags);-
76-
77 (void)BIO_flush(p7bio);-
78-
79 if (!PKCS7_dataFinal(p7, p7bio)) {
!PKCS7_dataFinal(p7, p7bio)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
80 PKCS7err(PKCS7_F_PKCS7_FINAL, PKCS7_R_PKCS7_DATASIGN);-
81 goto err;
never executed: goto err;
0
82 }-
83-
84 ret = 1;-
85-
86 err:
code before this statement executed 4 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
4
87 BIO_free_all(p7bio);-
88-
89 return ret;
executed 4 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
4
90-
91}-
92-
93/* Check to see if a cipher exists and if so add S/MIME capabilities */-
94-
95static int add_cipher_smcap(STACK_OF(X509_ALGOR) *sk, int nid, int arg)-
96{-
97 if (EVP_get_cipherbynid(nid))
EVP_get_cipher...J_nid2sn(nid))Description
TRUEevaluated 160 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-160
98 return PKCS7_simple_smimecap(sk, nid, arg);
executed 160 times by 1 test: return PKCS7_simple_smimecap(sk, nid, arg);
Executed by:
  • libcrypto.so.1.1
160
99 return 1;
executed 20 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
20
100}-
101-
102static int add_digest_smcap(STACK_OF(X509_ALGOR) *sk, int nid, int arg)-
103{-
104 if (EVP_get_digestbynid(nid))
EVP_get_digest...J_nid2sn(nid))Description
TRUEnever evaluated
FALSEevaluated 60 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-60
105 return PKCS7_simple_smimecap(sk, nid, arg);
never executed: return PKCS7_simple_smimecap(sk, nid, arg);
0
106 return 1;
executed 60 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
60
107}-
108-
109PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert,-
110 EVP_PKEY *pkey, const EVP_MD *md,-
111 int flags)-
112{-
113 PKCS7_SIGNER_INFO *si = NULL;-
114 STACK_OF(X509_ALGOR) *smcap = NULL;-
115 if (!X509_check_private_key(signcert, pkey)) {
!X509_check_pr...igncert, pkey)Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24
116 PKCS7err(PKCS7_F_PKCS7_SIGN_ADD_SIGNER,-
117 PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE);-
118 return NULL;
never executed: return ((void *)0) ;
0
119 }-
120-
121 if ((si = PKCS7_add_signature(p7, signcert, pkey, md)) == NULL) {
(si = PKCS7_ad...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24
122 PKCS7err(PKCS7_F_PKCS7_SIGN_ADD_SIGNER,-
123 PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR);-
124 return NULL;
never executed: return ((void *)0) ;
0
125 }-
126-
127 if (!(flags & PKCS7_NOCERTS)) {
!(flags & 0x2)Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-24
128 if (!PKCS7_add_certificate(p7, signcert))
!PKCS7_add_cer...(p7, signcert)Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24
129 goto err;
never executed: goto err;
0
130 }
executed 24 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
24
131-
132 if (!(flags & PKCS7_NOATTR)) {
!(flags & 0x100)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-20
133 if (!PKCS7_add_attrib_content_type(si, NULL))
!PKCS7_add_att... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
134 goto err;
never executed: goto err;
0
135 /* Add SMIMECapabilities */-
136 if (!(flags & PKCS7_NOSMIMECAP)) {
!(flags & 0x200)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-20
137 if ((smcap = sk_X509_ALGOR_new_null()) == NULL) {
(smcap = sk_X5...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
138 PKCS7err(PKCS7_F_PKCS7_SIGN_ADD_SIGNER, ERR_R_MALLOC_FAILURE);-
139 goto err;
never executed: goto err;
0
140 }-
141 if (!add_cipher_smcap(smcap, NID_aes_256_cbc, -1)
!add_cipher_sm...mcap, 427, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
142 || !add_digest_smcap(smcap, NID_id_GostR3411_2012_256, -1)
!add_digest_sm...mcap, 982, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
143 || !add_digest_smcap(smcap, NID_id_GostR3411_2012_512, -1)
!add_digest_sm...mcap, 983, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
144 || !add_digest_smcap(smcap, NID_id_GostR3411_94, -1)
!add_digest_sm...mcap, 809, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
145 || !add_cipher_smcap(smcap, NID_id_Gost28147_89, -1)
!add_cipher_sm...mcap, 813, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
146 || !add_cipher_smcap(smcap, NID_aes_192_cbc, -1)
!add_cipher_sm...mcap, 423, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
147 || !add_cipher_smcap(smcap, NID_aes_128_cbc, -1)
!add_cipher_sm...mcap, 419, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
148 || !add_cipher_smcap(smcap, NID_des_ede3_cbc, -1)
!add_cipher_sm...smcap, 44, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
149 || !add_cipher_smcap(smcap, NID_rc2_cbc, 128)
!add_cipher_sm...mcap, 37, 128)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
150 || !add_cipher_smcap(smcap, NID_rc2_cbc, 64)
!add_cipher_sm...smcap, 37, 64)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
151 || !add_cipher_smcap(smcap, NID_des_cbc, -1)
!add_cipher_sm...smcap, 31, -1)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
152 || !add_cipher_smcap(smcap, NID_rc2_cbc, 40)
!add_cipher_sm...smcap, 37, 40)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
153 || !PKCS7_add_attrib_smimecap(si, smcap))
!PKCS7_add_att...cap(si, smcap)Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
154 goto err;
never executed: goto err;
0
155 sk_X509_ALGOR_pop_free(smcap, X509_ALGOR_free);-
156 smcap = NULL;-
157 }
executed 20 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
20
158 if (flags & PKCS7_REUSE_DIGEST) {
flags & 0x8000Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 19 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-19
159 if (!pkcs7_copy_existing_digest(p7, si))
!pkcs7_copy_ex...digest(p7, si)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
160 goto err;
never executed: goto err;
0
161 if (!(flags & PKCS7_PARTIAL) && !PKCS7_SIGNER_INFO_sign(si))
!(flags & 0x4000)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
!PKCS7_SIGNER_INFO_sign(si)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
162 goto err;
never executed: goto err;
0
163 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
164 }
executed 20 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
20
165 return si;
executed 24 times by 1 test: return si;
Executed by:
  • libcrypto.so.1.1
24
166 err:-
167 sk_X509_ALGOR_pop_free(smcap, X509_ALGOR_free);-
168 return NULL;
never executed: return ((void *)0) ;
0
169}-
170-
171/*-
172 * Search for a digest matching SignerInfo digest type and if found copy-
173 * across.-
174 */-
175-
176static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si)-
177{-
178 int i;-
179 STACK_OF(PKCS7_SIGNER_INFO) *sinfos;-
180 PKCS7_SIGNER_INFO *sitmp;-
181 ASN1_OCTET_STRING *osdig = NULL;-
182 sinfos = PKCS7_get_signer_info(p7);-
183 for (i = 0; i < sk_PKCS7_SIGNER_INFO_num(sinfos); i++) {
i < sk_PKCS7_S...FO_num(sinfos)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
184 sitmp = sk_PKCS7_SIGNER_INFO_value(sinfos, i);-
185 if (si == sitmp)
si == sitmpDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
186 break;
never executed: break;
0
187 if (sk_X509_ATTRIBUTE_num(sitmp->auth_attr) <= 0)
sk_X509_ATTRIB...uth_attr) <= 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1
188 continue;
never executed: continue;
0
189 if (!OBJ_cmp(si->digest_alg->algorithm, sitmp->digest_alg->algorithm)) {
!OBJ_cmp(si->d...lg->algorithm)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
190 osdig = PKCS7_digest_from_attributes(sitmp->auth_attr);-
191 break;
executed 1 time by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1
192 }-
193-
194 }
never executed: end of block
0
195-
196 if (osdig)
osdigDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
197 return PKCS7_add1_attrib_digest(si, osdig->data, osdig->length);
executed 1 time by 1 test: return PKCS7_add1_attrib_digest(si, osdig->data, osdig->length);
Executed by:
  • libcrypto.so.1.1
1
198-
199 PKCS7err(PKCS7_F_PKCS7_COPY_EXISTING_DIGEST,-
200 PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND);-
201 return 0;
never executed: return 0;
0
202}-
203-
204int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,-
205 BIO *indata, BIO *out, int flags)-
206{-
207 STACK_OF(X509) *signers;-
208 X509 *signer;-
209 STACK_OF(PKCS7_SIGNER_INFO) *sinfos;-
210 PKCS7_SIGNER_INFO *si;-
211 X509_STORE_CTX *cert_ctx = NULL;-
212 char *buf = NULL;-
213 int i, j = 0, k, ret = 0;-
214 BIO *p7bio = NULL;-
215 BIO *tmpin = NULL, *tmpout = NULL;-
216-
217 if (!p7) {
!p7Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
218 PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_INVALID_NULL_POINTER);-
219 return 0;
never executed: return 0;
0
220 }-
221-
222 if (!PKCS7_type_is_signed(p7)) {
!(OBJ_obj2nid(...->type) == 22)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
223 PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_WRONG_CONTENT_TYPE);-
224 return 0;
never executed: return 0;
0
225 }-
226-
227 /* Check for no data and no content: no data to verify signature */-
228 if (PKCS7_get_detached(p7) && !indata) {
PKCS7_ctrl(p7,... ((void *)0) )Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!indataDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7
229 PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_NO_CONTENT);-
230 return 0;
never executed: return 0;
0
231 }-
232-
233 if (flags & PKCS7_NO_DUAL_CONTENT) {
flags & 0x10000Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
234 /*-
235 * This was originally "#if 0" because we thought that only old broken-
236 * Netscape did this. It turns out that Authenticode uses this kind-
237 * of "extended" PKCS7 format, and things like UEFI secure boot and-
238 * tools like osslsigncode need it. In Authenticode the verification-
239 * process is different, but the existing PKCs7 verification works.-
240 */-
241 if (!PKCS7_get_detached(p7) && indata) {
!PKCS7_ctrl(p7... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
indataDescription
TRUEnever evaluated
FALSEnever evaluated
0
242 PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_CONTENT_AND_DATA_PRESENT);-
243 return 0;
never executed: return 0;
0
244 }-
245 }
never executed: end of block
0
246-
247 sinfos = PKCS7_get_signer_info(p7);-
248-
249 if (!sinfos || !sk_PKCS7_SIGNER_INFO_num(sinfos)) {
!sinfosDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!sk_PKCS7_SIGN...FO_num(sinfos)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
250 PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_NO_SIGNATURES_ON_DATA);-
251 return 0;
never executed: return 0;
0
252 }-
253-
254 signers = PKCS7_get0_signers(p7, certs, flags);-
255 if (!signers)
!signersDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
256 return 0;
never executed: return 0;
0
257-
258 /* Now verify the certificates */-
259-
260 cert_ctx = X509_STORE_CTX_new();-
261 if (cert_ctx == NULL)
cert_ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
262 goto err;
never executed: goto err;
0
263 if (!(flags & PKCS7_NOVERIFY))
!(flags & 0x20)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-12
264 for (k = 0; k < sk_X509_num(signers); k++) {
k < sk_X509_num(signers)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
12-25
265 signer = sk_X509_value(signers, k);-
266 if (!(flags & PKCS7_NOCHAIN)) {
!(flags & 0x8)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-25
267 if (!X509_STORE_CTX_init(cert_ctx, store, signer,
!X509_STORE_CT...>d.sign->cert)Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25
268 p7->d.sign->cert)) {
!X509_STORE_CT...>d.sign->cert)Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25
269 PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_X509_LIB);-
270 goto err;
never executed: goto err;
0
271 }-
272 X509_STORE_CTX_set_default(cert_ctx, "smime_sign");-
273 } else if (!X509_STORE_CTX_init(cert_ctx, store, signer, NULL)) {
executed 25 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
!X509_STORE_CT... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0-25
274 PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_X509_LIB);-
275 goto err;
never executed: goto err;
0
276 }-
277 if (!(flags & PKCS7_NOCRL))
!(flags & 0x2000)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-25
278 X509_STORE_CTX_set0_crls(cert_ctx, p7->d.sign->crl);
executed 25 times by 1 test: X509_STORE_CTX_set0_crls(cert_ctx, p7->d.sign->crl);
Executed by:
  • libcrypto.so.1.1
25
279 i = X509_verify_cert(cert_ctx);-
280 if (i <= 0)
i <= 0Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25
281 j = X509_STORE_CTX_get_error(cert_ctx);
never executed: j = X509_STORE_CTX_get_error(cert_ctx);
0
282 X509_STORE_CTX_cleanup(cert_ctx);-
283 if (i <= 0) {
i <= 0Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25
284 PKCS7err(PKCS7_F_PKCS7_VERIFY,-
285 PKCS7_R_CERTIFICATE_VERIFY_ERROR);-
286 ERR_add_error_data(2, "Verify error:",-
287 X509_verify_cert_error_string(j));-
288 goto err;
never executed: goto err;
0
289 }-
290 /* Check for revocation status here */-
291 }
executed 25 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
25
292-
293 /*-
294 * Performance optimization: if the content is a memory BIO then store-
295 * its contents in a temporary read only memory BIO. This avoids-
296 * potentially large numbers of slow copies of data which will occur when-
297 * reading from a read write memory BIO when signatures are calculated.-
298 */-
299-
300 if (indata && (BIO_method_type(indata) == BIO_TYPE_MEM)) {
indataDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(BIO_method_ty...= ( 1|0x0400))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-7
301 char *ptr;-
302 long len;-
303 len = BIO_get_mem_data(indata, &ptr);-
304 tmpin = BIO_new_mem_buf(ptr, len);-
305 if (tmpin == NULL) {
tmpin == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
306 PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_MALLOC_FAILURE);-
307 goto err;
never executed: goto err;
0
308 }-
309 } else
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
310 tmpin = indata;
executed 10 times by 1 test: tmpin = indata;
Executed by:
  • libcrypto.so.1.1
10
311-
312 if ((p7bio = PKCS7_dataInit(p7, tmpin)) == NULL)
(p7bio = PKCS7...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
313 goto err;
never executed: goto err;
0
314-
315 if (flags & PKCS7_TEXT) {
flags & 0x1Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
316 if ((tmpout = BIO_new(BIO_s_mem())) == NULL) {
(tmpout = BIO_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
317 PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_MALLOC_FAILURE);-
318 goto err;
never executed: goto err;
0
319 }-
320 BIO_set_mem_eof_return(tmpout, 0);-
321 } else
never executed: end of block
0
322 tmpout = out;
executed 12 times by 1 test: tmpout = out;
Executed by:
  • libcrypto.so.1.1
12
323-
324 /* We now have to 'read' from p7bio to calculate digests etc. */-
325 if ((buf = OPENSSL_malloc(BUFFERSIZE)) == NULL) {
(buf = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
326 PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_MALLOC_FAILURE);-
327 goto err;
never executed: goto err;
0
328 }-
329 for (;;) {-
330 i = BIO_read(p7bio, buf, BUFFERSIZE);-
331 if (i <= 0)
i <= 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
12
332 break;
executed 12 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
12
333 if (tmpout)
tmpoutDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-12
334 BIO_write(tmpout, buf, i);
executed 12 times by 1 test: BIO_write(tmpout, buf, i);
Executed by:
  • libcrypto.so.1.1
12
335 }
executed 12 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12
336-
337 if (flags & PKCS7_TEXT) {
flags & 0x1Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
338 if (!SMIME_text(tmpout, out)) {
!SMIME_text(tmpout, out)Description
TRUEnever evaluated
FALSEnever evaluated
0
339 PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_SMIME_TEXT_ERROR);-
340 BIO_free(tmpout);-
341 goto err;
never executed: goto err;
0
342 }-
343 BIO_free(tmpout);-
344 }
never executed: end of block
0
345-
346 /* Now Verify All Signatures */-
347 if (!(flags & PKCS7_NOSIGS))
!(flags & 0x4)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-12
348 for (i = 0; i < sk_PKCS7_SIGNER_INFO_num(sinfos); i++) {
i < sk_PKCS7_S...FO_num(sinfos)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
12-25
349 si = sk_PKCS7_SIGNER_INFO_value(sinfos, i);-
350 signer = sk_X509_value(signers, i);-
351 j = PKCS7_signatureVerify(p7bio, p7, si, signer);-
352 if (j <= 0) {
j <= 0Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25
353 PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_SIGNATURE_FAILURE);-
354 goto err;
never executed: goto err;
0
355 }-
356 }
executed 25 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
25
357-
358 ret = 1;-
359-
360 err:
code before this statement executed 12 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
12
361 X509_STORE_CTX_free(cert_ctx);-
362 OPENSSL_free(buf);-
363 if (tmpin == indata) {
tmpin == indataDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-10
364 if (indata)
indataDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-7
365 BIO_pop(p7bio);
executed 3 times by 1 test: BIO_pop(p7bio);
Executed by:
  • libcrypto.so.1.1
3
366 }
executed 10 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
10
367 BIO_free_all(p7bio);-
368 sk_X509_free(signers);-
369 return ret;
executed 12 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
12
370}-
371-
372STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,-
373 int flags)-
374{-
375 STACK_OF(X509) *signers;-
376 STACK_OF(PKCS7_SIGNER_INFO) *sinfos;-
377 PKCS7_SIGNER_INFO *si;-
378 PKCS7_ISSUER_AND_SERIAL *ias;-
379 X509 *signer;-
380 int i;-
381-
382 if (!p7) {
!p7Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24
383 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS, PKCS7_R_INVALID_NULL_POINTER);-
384 return NULL;
never executed: return ((void *)0) ;
0
385 }-
386-
387 if (!PKCS7_type_is_signed(p7)) {
!(OBJ_obj2nid(...->type) == 22)Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24
388 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS, PKCS7_R_WRONG_CONTENT_TYPE);-
389 return NULL;
never executed: return ((void *)0) ;
0
390 }-
391-
392 /* Collect all the signers together */-
393-
394 sinfos = PKCS7_get_signer_info(p7);-
395-
396 if (sk_PKCS7_SIGNER_INFO_num(sinfos) <= 0) {
sk_PKCS7_SIGNE...m(sinfos) <= 0Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24
397 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS, PKCS7_R_NO_SIGNERS);-
398 return 0;
never executed: return 0;
0
399 }-
400-
401 if ((signers = sk_X509_new_null()) == NULL) {
(signers = sk_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-24
402 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS, ERR_R_MALLOC_FAILURE);-
403 return NULL;
never executed: return ((void *)0) ;
0
404 }-
405-
406 for (i = 0; i < sk_PKCS7_SIGNER_INFO_num(sinfos); i++) {
i < sk_PKCS7_S...FO_num(sinfos)Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
24-50
407 si = sk_PKCS7_SIGNER_INFO_value(sinfos, i);-
408 ias = si->issuer_and_serial;-
409 signer = NULL;-
410 /* If any certificates passed they take priority */-
411 if (certs)
certsDescription
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-50
412 signer = X509_find_by_issuer_and_serial(certs,
never executed: signer = X509_find_by_issuer_and_serial(certs, ias->issuer, ias->serial);
0
413 ias->issuer, ias->serial);
never executed: signer = X509_find_by_issuer_and_serial(certs, ias->issuer, ias->serial);
0
414 if (!signer && !(flags & PKCS7_NOINTERN)
!signerDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
!(flags & 0x10)Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-50
415 && p7->d.sign->cert)
p7->d.sign->certDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-50
416 signer =
executed 50 times by 1 test: signer = X509_find_by_issuer_and_serial(p7->d.sign->cert, ias->issuer, ias->serial);
Executed by:
  • libcrypto.so.1.1
50
417 X509_find_by_issuer_and_serial(p7->d.sign->cert,
executed 50 times by 1 test: signer = X509_find_by_issuer_and_serial(p7->d.sign->cert, ias->issuer, ias->serial);
Executed by:
  • libcrypto.so.1.1
50
418 ias->issuer, ias->serial);
executed 50 times by 1 test: signer = X509_find_by_issuer_and_serial(p7->d.sign->cert, ias->issuer, ias->serial);
Executed by:
  • libcrypto.so.1.1
50
419 if (!signer) {
!signerDescription
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-50
420 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,-
421 PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND);-
422 sk_X509_free(signers);-
423 return 0;
never executed: return 0;
0
424 }-
425-
426 if (!sk_X509_push(signers, signer)) {
!sk_X509_push(signers, signer)Description
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-50
427 sk_X509_free(signers);-
428 return NULL;
never executed: return ((void *)0) ;
0
429 }-
430 }
executed 50 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
50
431 return signers;
executed 24 times by 1 test: return signers;
Executed by:
  • libcrypto.so.1.1
24
432}-
433-
434/* Build a complete PKCS#7 enveloped data */-
435-
436PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,-
437 int flags)-
438{-
439 PKCS7 *p7;-
440 BIO *p7bio = NULL;-
441 int i;-
442 X509 *x509;-
443 if ((p7 = PKCS7_new()) == NULL) {
(p7 = PKCS7_ne...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
444 PKCS7err(PKCS7_F_PKCS7_ENCRYPT, ERR_R_MALLOC_FAILURE);-
445 return NULL;
never executed: return ((void *)0) ;
0
446 }-
447-
448 if (!PKCS7_set_type(p7, NID_pkcs7_enveloped))
!PKCS7_set_type(p7, 23)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
449 goto err;
never executed: goto err;
0
450 if (!PKCS7_set_cipher(p7, cipher)) {
!PKCS7_set_cipher(p7, cipher)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
451 PKCS7err(PKCS7_F_PKCS7_ENCRYPT, PKCS7_R_ERROR_SETTING_CIPHER);-
452 goto err;
never executed: goto err;
0
453 }-
454-
455 for (i = 0; i < sk_X509_num(certs); i++) {
i < sk_X509_num(certs)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-12
456 x509 = sk_X509_value(certs, i);-
457 if (!PKCS7_add_recipient(p7, x509)) {
!PKCS7_add_recipient(p7, x509)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12
458 PKCS7err(PKCS7_F_PKCS7_ENCRYPT, PKCS7_R_ERROR_ADDING_RECIPIENT);-
459 goto err;
never executed: goto err;
0
460 }-
461 }
executed 12 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
12
462-
463 if (flags & PKCS7_STREAM)
flags & 0x1000Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4
464 return p7;
executed 4 times by 1 test: return p7;
Executed by:
  • libcrypto.so.1.1
4
465-
466 if (PKCS7_final(p7, in, flags))
PKCS7_final(p7, in, flags)Description
TRUEnever evaluated
FALSEnever evaluated
0
467 return p7;
never executed: return p7;
0
468-
469 err:
code before this statement never executed: err:
0
470-
471 BIO_free_all(p7bio);-
472 PKCS7_free(p7);-
473 return NULL;
never executed: return ((void *)0) ;
0
474-
475}-
476-
477int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags)-
478{-
479 BIO *tmpmem;-
480 int ret = 0, i;-
481 char *buf = NULL;-
482-
483 if (!p7) {
!p7Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
484 PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_INVALID_NULL_POINTER);-
485 return 0;
never executed: return 0;
0
486 }-
487-
488 if (!PKCS7_type_is_enveloped(p7)) {
!(OBJ_obj2nid(...->type) == 23)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
489 PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_WRONG_CONTENT_TYPE);-
490 return 0;
never executed: return 0;
0
491 }-
492-
493 if (cert && !X509_check_private_key(cert, pkey)) {
certDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
!X509_check_pr...ey(cert, pkey)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3
494 PKCS7err(PKCS7_F_PKCS7_DECRYPT,-
495 PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE);-
496 return 0;
never executed: return 0;
0
497 }-
498-
499 if ((tmpmem = PKCS7_dataDecode(p7, pkey, NULL, cert)) == NULL) {
(tmpmem = PKCS...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
500 PKCS7err(PKCS7_F_PKCS7_DECRYPT, PKCS7_R_DECRYPT_ERROR);-
501 return 0;
never executed: return 0;
0
502 }-
503-
504 if (flags & PKCS7_TEXT) {
flags & 0x1Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
505 BIO *tmpbuf, *bread;-
506 /* Encrypt BIOs can't do BIO_gets() so add a buffer BIO */-
507 if ((tmpbuf = BIO_new(BIO_f_buffer())) == NULL) {
(tmpbuf = BIO_...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
508 PKCS7err(PKCS7_F_PKCS7_DECRYPT, ERR_R_MALLOC_FAILURE);-
509 BIO_free_all(tmpmem);-
510 return 0;
never executed: return 0;
0
511 }-
512 if ((bread = BIO_push(tmpbuf, tmpmem)) == NULL) {
(bread = BIO_p...== ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
513 PKCS7err(PKCS7_F_PKCS7_DECRYPT, ERR_R_MALLOC_FAILURE);-
514 BIO_free_all(tmpbuf);-
515 BIO_free_all(tmpmem);-
516 return 0;
never executed: return 0;
0
517 }-
518 ret = SMIME_text(bread, data);-
519 if (ret > 0 && BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) {
ret > 0Description
TRUEnever evaluated
FALSEnever evaluated
BIO_method_typ...== (10|0x0200)Description
TRUEnever evaluated
FALSEnever evaluated
0
520 if (!BIO_get_cipher_status(tmpmem))
!BIO_ctrl(tmpm... ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
521 ret = 0;
never executed: ret = 0;
0
522 }
never executed: end of block
0
523 BIO_free_all(bread);-
524 return ret;
never executed: return ret;
0
525 }-
526 if ((buf = OPENSSL_malloc(BUFFERSIZE)) == NULL) {
(buf = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
527 PKCS7err(PKCS7_F_PKCS7_DECRYPT, ERR_R_MALLOC_FAILURE);-
528 goto err;
never executed: goto err;
0
529 }-
530 for (;;) {-
531 i = BIO_read(tmpmem, buf, BUFFERSIZE);-
532 if (i <= 0) {
i <= 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4
533 ret = 1;-
534 if (BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) {
BIO_method_typ...== (10|0x0200)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4
535 if (!BIO_get_cipher_status(tmpmem))
!BIO_ctrl(tmpm... ((void *)0) )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
536 ret = 0;
never executed: ret = 0;
0
537 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
538-
539 break;
executed 4 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
4
540 }-
541 if (BIO_write(data, buf, i) != i) {
BIO_write(data, buf, i) != iDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
542 break;
never executed: break;
0
543 }-
544 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
545err:
code before this statement executed 4 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
4
546 OPENSSL_free(buf);-
547 BIO_free_all(tmpmem);-
548 return ret;
executed 4 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
4
549}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2