OpenCoverage

by_dir.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509/by_dir.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/*-
2 * Copyright 1995-2018 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#include "e_os.h"-
11#include "internal/cryptlib.h"-
12#include <stdio.h>-
13#include <time.h>-
14#include <errno.h>-
15#include <sys/types.h>-
16-
17#ifndef OPENSSL_NO_POSIX_IO-
18# include <sys/stat.h>-
19#endif-
20-
21#include <openssl/x509.h>-
22#include "internal/x509_int.h"-
23#include "x509_lcl.h"-
24-
25struct lookup_dir_hashes_st {-
26 unsigned long hash;-
27 int suffix;-
28};-
29-
30struct lookup_dir_entry_st {-
31 char *dir;-
32 int dir_type;-
33 STACK_OF(BY_DIR_HASH) *hashes;-
34};-
35-
36typedef struct lookup_dir_st {-
37 BUF_MEM *buffer;-
38 STACK_OF(BY_DIR_ENTRY) *dirs;-
39 CRYPTO_RWLOCK *lock;-
40} BY_DIR;-
41-
42static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,-
43 char **ret);-
44static int new_dir(X509_LOOKUP *lu);-
45static void free_dir(X509_LOOKUP *lu);-
46static int add_cert_dir(BY_DIR *ctx, const char *dir, int type);-
47static int get_cert_by_subject(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,-
48 X509_NAME *name, X509_OBJECT *ret);-
49static X509_LOOKUP_METHOD x509_dir_lookup = {-
50 "Load certs from files in a directory",-
51 new_dir, /* new_item */-
52 free_dir, /* free */-
53 NULL, /* init */-
54 NULL, /* shutdown */-
55 dir_ctrl, /* ctrl */-
56 get_cert_by_subject, /* get_by_subject */-
57 NULL, /* get_by_issuer_serial */-
58 NULL, /* get_by_fingerprint */-
59 NULL, /* get_by_alias */-
60};-
61-
62X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void)-
63{-
64 return &x509_dir_lookup;
executed 492 times by 1 test: return &x509_dir_lookup;
Executed by:
  • libcrypto.so.1.1
492
65}-
66-
67static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,-
68 char **retp)-
69{-
70 int ret = 0;-
71 BY_DIR *ld = (BY_DIR *)ctx->method_data;-
72-
73 switch (cmd) {-
74 case X509_L_ADD_DIR:
executed 492 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
492
75 if (argl == X509_FILETYPE_DEFAULT) {
argl == 3Description
TRUEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-492
76 const char *dir = getenv(X509_get_default_cert_dir_env());-
77-
78 if (dir)
dirDescription
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
79 ret = add_cert_dir(ld, dir, X509_FILETYPE_PEM);
never executed: ret = add_cert_dir(ld, dir, 1);
0
80 else-
81 ret = add_cert_dir(ld, X509_get_default_cert_dir(),
executed 492 times by 1 test: ret = add_cert_dir(ld, X509_get_default_cert_dir(), 1);
Executed by:
  • libcrypto.so.1.1
492
82 X509_FILETYPE_PEM);
executed 492 times by 1 test: ret = add_cert_dir(ld, X509_get_default_cert_dir(), 1);
Executed by:
  • libcrypto.so.1.1
492
83 if (!ret) {
!retDescription
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
84 X509err(X509_F_DIR_CTRL, X509_R_LOADING_CERT_DIR);-
85 }
never executed: end of block
0
86 } else
executed 492 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
492
87 ret = add_cert_dir(ld, argp, (int)argl);
never executed: ret = add_cert_dir(ld, argp, (int)argl);
0
88 break;
executed 492 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
492
89 }-
90 return ret;
executed 492 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
492
91}-
92-
93static int new_dir(X509_LOOKUP *lu)-
94{-
95 BY_DIR *a = OPENSSL_malloc(sizeof(*a));-
96-
97 if (a == NULL) {
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
98 X509err(X509_F_NEW_DIR, ERR_R_MALLOC_FAILURE);-
99 return 0;
never executed: return 0;
0
100 }-
101-
102 if ((a->buffer = BUF_MEM_new()) == NULL) {
(a->buffer = B...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
103 X509err(X509_F_NEW_DIR, ERR_R_MALLOC_FAILURE);-
104 goto err;
never executed: goto err;
0
105 }-
106 a->dirs = NULL;-
107 a->lock = CRYPTO_THREAD_lock_new();-
108 if (a->lock == NULL) {
a->lock == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
109 BUF_MEM_free(a->buffer);-
110 X509err(X509_F_NEW_DIR, ERR_R_MALLOC_FAILURE);-
111 goto err;
never executed: goto err;
0
112 }-
113 lu->method_data = a;-
114 return 1;
executed 492 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
492
115-
116 err:-
117 OPENSSL_free(a);-
118 return 0;
never executed: return 0;
0
119}-
120-
121static void by_dir_hash_free(BY_DIR_HASH *hash)-
122{-
123 OPENSSL_free(hash);-
124}
never executed: end of block
0
125-
126static int by_dir_hash_cmp(const BY_DIR_HASH *const *a,-
127 const BY_DIR_HASH *const *b)-
128{-
129 if ((*a)->hash > (*b)->hash)
(*a)->hash > (*b)->hashDescription
TRUEnever evaluated
FALSEnever evaluated
0
130 return 1;
never executed: return 1;
0
131 if ((*a)->hash < (*b)->hash)
(*a)->hash < (*b)->hashDescription
TRUEnever evaluated
FALSEnever evaluated
0
132 return -1;
never executed: return -1;
0
133 return 0;
never executed: return 0;
0
134}-
135-
136static void by_dir_entry_free(BY_DIR_ENTRY *ent)-
137{-
138 OPENSSL_free(ent->dir);-
139 sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);-
140 OPENSSL_free(ent);-
141}
executed 492 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
492
142-
143static void free_dir(X509_LOOKUP *lu)-
144{-
145 BY_DIR *a = (BY_DIR *)lu->method_data;-
146-
147 sk_BY_DIR_ENTRY_pop_free(a->dirs, by_dir_entry_free);-
148 BUF_MEM_free(a->buffer);-
149 CRYPTO_THREAD_lock_free(a->lock);-
150 OPENSSL_free(a);-
151}
executed 492 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
492
152-
153static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)-
154{-
155 int j;-
156 size_t len;-
157 const char *s, *ss, *p;-
158-
159 if (dir == NULL || !*dir) {
dir == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!*dirDescription
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
160 X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);-
161 return 0;
never executed: return 0;
0
162 }-
163-
164 s = dir;-
165 p = s;-
166 do {-
167 if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
(*p == ':')Description
TRUEnever evaluated
FALSEevaluated 10332 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(*p == '\0')Description
TRUEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-10332
168 BY_DIR_ENTRY *ent;-
169-
170 ss = s;-
171 s = p + 1;-
172 len = p - ss;-
173 if (len == 0)
len == 0Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
174 continue;
never executed: continue;
0
175 for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
j < sk_BY_DIR_...num(ctx->dirs)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
176 ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);-
177 if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0)
never executed: __result = (((const unsigned char *) (const char *) ( ent->dir ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( ss ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
strlen(ent->dir) == lenDescription
TRUEnever evaluated
FALSEnever evaluated
(__extension__..., len ))) == 0Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( len )Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_cons...p ( ent->dir )Description
TRUEnever evaluated
FALSEnever evaluated
strlen ( ent->...ze_t) ( len ))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( ss )Description
TRUEnever evaluated
FALSEnever evaluated
strlen ( ss ) ...ze_t) ( len ))Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
178 break;
never executed: break;
0
179 }
never executed: end of block
0
180 if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
j < sk_BY_DIR_...num(ctx->dirs)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
181 continue;
never executed: continue;
0
182 if (ctx->dirs == NULL) {
ctx->dirs == ((void *)0)Description
TRUEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-492
183 ctx->dirs = sk_BY_DIR_ENTRY_new_null();-
184 if (!ctx->dirs) {
!ctx->dirsDescription
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
185 X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);-
186 return 0;
never executed: return 0;
0
187 }-
188 }
executed 492 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
492
189 ent = OPENSSL_malloc(sizeof(*ent));-
190 if (ent == NULL) {
ent == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
191 X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);-
192 return 0;
never executed: return 0;
0
193 }-
194 ent->dir_type = type;-
195 ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);-
196 ent->dir = OPENSSL_strndup(ss, len);-
197 if (ent->dir == NULL || ent->hashes == NULL) {
ent->dir == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ent->hashes == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
198 by_dir_entry_free(ent);-
199 return 0;
never executed: return 0;
0
200 }-
201 if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
!sk_BY_DIR_ENT...tx->dirs, ent)Description
TRUEnever evaluated
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-492
202 by_dir_entry_free(ent);-
203 X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);-
204 return 0;
never executed: return 0;
0
205 }-
206 }
executed 492 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
492
207 } while (*p++ != '\0');
executed 10332 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
*p++ != '\0'Description
TRUEevaluated 9840 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 492 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
492-10332
208 return 1;
executed 492 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
492
209}-
210-
211static int get_cert_by_subject(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,-
212 X509_NAME *name, X509_OBJECT *ret)-
213{-
214 BY_DIR *ctx;-
215 union {-
216 X509 st_x509;-
217 X509_CRL crl;-
218 } data;-
219 int ok = 0;-
220 int i, j, k;-
221 unsigned long h;-
222 BUF_MEM *b = NULL;-
223 X509_OBJECT stmp, *tmp;-
224 const char *postfix = "";-
225-
226 if (name == NULL)
name == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-396
227 return 0;
never executed: return 0;
0
228-
229 stmp.type = type;-
230 if (type == X509_LU_X509) {
type == X509_LU_X509Description
TRUEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-396
231 data.st_x509.cert_info.subject = name;-
232 stmp.data.x509 = &data.st_x509;-
233 postfix = "";-
234 } else if (type == X509_LU_CRL) {
executed 396 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
type == X509_LU_CRLDescription
TRUEnever evaluated
FALSEnever evaluated
0-396
235 data.crl.crl.issuer = name;-
236 stmp.data.crl = &data.crl;-
237 postfix = "r";-
238 } else {
never executed: end of block
0
239 X509err(X509_F_GET_CERT_BY_SUBJECT, X509_R_WRONG_LOOKUP_TYPE);-
240 goto finish;
never executed: goto finish;
0
241 }-
242-
243 if ((b = BUF_MEM_new()) == NULL) {
(b = BUF_MEM_n...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-396
244 X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_BUF_LIB);-
245 goto finish;
never executed: goto finish;
0
246 }-
247-
248 ctx = (BY_DIR *)xl->method_data;-
249-
250 h = X509_NAME_hash(name);-
251 for (i = 0; i < sk_BY_DIR_ENTRY_num(ctx->dirs); i++) {
i < sk_BY_DIR_...num(ctx->dirs)Description
TRUEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
396
252 BY_DIR_ENTRY *ent;-
253 int idx;-
254 BY_DIR_HASH htmp, *hent;-
255-
256 ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i);-
257 j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1;-
258 if (!BUF_MEM_grow(b, j)) {
!BUF_MEM_grow(b, j)Description
TRUEnever evaluated
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-396
259 X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);-
260 goto finish;
never executed: goto finish;
0
261 }-
262 if (type == X509_LU_CRL && ent->hashes) {
type == X509_LU_CRLDescription
TRUEnever evaluated
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ent->hashesDescription
TRUEnever evaluated
FALSEnever evaluated
0-396
263 htmp.hash = h;-
264 CRYPTO_THREAD_read_lock(ctx->lock);-
265 idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp);-
266 if (idx >= 0) {
idx >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
267 hent = sk_BY_DIR_HASH_value(ent->hashes, idx);-
268 k = hent->suffix;-
269 } else {
never executed: end of block
0
270 hent = NULL;-
271 k = 0;-
272 }
never executed: end of block
0
273 CRYPTO_THREAD_unlock(ctx->lock);-
274 } else {
never executed: end of block
0
275 k = 0;-
276 hent = NULL;-
277 }
executed 396 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
396
278 for (;;) {-
279 char c = '/';-
280#ifdef OPENSSL_SYS_VMS-
281 c = ent->dir[strlen(ent->dir) - 1];-
282 if (c != ':' && c != '>' && c != ']') {-
283 /*-
284 * If no separator is present, we assume the directory-
285 * specifier is a logical name, and add a colon. We really-
286 * should use better VMS routines for merging things like-
287 * this, but this will do for now... -- Richard Levitte-
288 */-
289 c = ':';-
290 } else {-
291 c = '\0';-
292 }-
293#endif-
294 if (c == '\0') {
c == '\0'Description
TRUEnever evaluated
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-396
295 /*-
296 * This is special. When c == '\0', no directory separator-
297 * should be added.-
298 */-
299 BIO_snprintf(b->data, b->max,-
300 "%s%08lx.%s%d", ent->dir, h, postfix, k);-
301 } else {
never executed: end of block
0
302 BIO_snprintf(b->data, b->max,-
303 "%s%c%08lx.%s%d", ent->dir, c, h, postfix, k);-
304 }
executed 396 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
396
305#ifndef OPENSSL_NO_POSIX_IO-
306# ifdef _WIN32-
307# define stat _stat-
308# endif-
309 {-
310 struct stat st;-
311 if (stat(b->data, &st) < 0)
stat(b->data, &st) < 0Description
TRUEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-396
312 break;
executed 396 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
396
313 }-
314#endif-
315 /* found one. */-
316 if (type == X509_LU_X509) {
type == X509_LU_X509Description
TRUEnever evaluated
FALSEnever evaluated
0
317 if ((X509_load_cert_file(xl, b->data, ent->dir_type)) == 0)
(X509_load_cer...ir_type)) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
318 break;
never executed: break;
0
319 } else if (type == X509_LU_CRL) {
never executed: end of block
type == X509_LU_CRLDescription
TRUEnever evaluated
FALSEnever evaluated
0
320 if ((X509_load_crl_file(xl, b->data, ent->dir_type)) == 0)
(X509_load_crl...ir_type)) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
321 break;
never executed: break;
0
322 }
never executed: end of block
0
323 /* else case will caught higher up */-
324 k++;-
325 }
never executed: end of block
0
326-
327 /*-
328 * we have added it to the cache so now pull it out again-
329 */-
330 CRYPTO_THREAD_write_lock(ctx->lock);-
331 j = sk_X509_OBJECT_find(xl->store_ctx->objs, &stmp);-
332 tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, j);-
333 CRYPTO_THREAD_unlock(ctx->lock);-
334-
335 /* If a CRL, update the last file suffix added for this */-
336-
337 if (type == X509_LU_CRL) {
type == X509_LU_CRLDescription
TRUEnever evaluated
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-396
338 CRYPTO_THREAD_write_lock(ctx->lock);-
339 /*-
340 * Look for entry again in case another thread added an entry-
341 * first.-
342 */-
343 if (hent == NULL) {
hent == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
344 htmp.hash = h;-
345 idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp);-
346 hent = sk_BY_DIR_HASH_value(ent->hashes, idx);-
347 }
never executed: end of block
0
348 if (hent == NULL) {
hent == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
349 hent = OPENSSL_malloc(sizeof(*hent));-
350 if (hent == NULL) {
hent == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
351 CRYPTO_THREAD_unlock(ctx->lock);-
352 X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);-
353 ok = 0;-
354 goto finish;
never executed: goto finish;
0
355 }-
356 hent->hash = h;-
357 hent->suffix = k;-
358 if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) {
!sk_BY_DIR_HAS...>hashes, hent)Description
TRUEnever evaluated
FALSEnever evaluated
0
359 CRYPTO_THREAD_unlock(ctx->lock);-
360 OPENSSL_free(hent);-
361 X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);-
362 ok = 0;-
363 goto finish;
never executed: goto finish;
0
364 }-
365 } else if (hent->suffix < k) {
never executed: end of block
hent->suffix < kDescription
TRUEnever evaluated
FALSEnever evaluated
0
366 hent->suffix = k;-
367 }
never executed: end of block
0
368-
369 CRYPTO_THREAD_unlock(ctx->lock);-
370-
371 }
never executed: end of block
0
372-
373 if (tmp != NULL) {
tmp != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 396 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-396
374 ok = 1;-
375 ret->type = tmp->type;-
376 memcpy(&ret->data, &tmp->data, sizeof(ret->data));-
377-
378 /*-
379 * Clear any errors that might have been raised processing empty-
380 * or malformed files.-
381 */-
382 ERR_clear_error();-
383-
384 goto finish;
never executed: goto finish;
0
385 }-
386 }
executed 396 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
396
387 finish:
code before this statement executed 396 times by 1 test: finish:
Executed by:
  • libcrypto.so.1.1
396
388 BUF_MEM_free(b);-
389 return ok;
executed 396 times by 1 test: return ok;
Executed by:
  • libcrypto.so.1.1
396
390}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2