OpenCoverage

a_strnid.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/asn1/a_strnid.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/* $OpenBSD: a_strnid.c,v 1.21 2017/01/29 17:49:22 beck Exp $ */-
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL-
3 * project 1999.-
4 */-
5/* ====================================================================-
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.-
7 *-
8 * Redistribution and use in source and binary forms, with or without-
9 * modification, are permitted provided that the following conditions-
10 * are met:-
11 *-
12 * 1. Redistributions of source code must retain the above copyright-
13 * notice, this list of conditions and the following disclaimer.-
14 *-
15 * 2. Redistributions in binary form must reproduce the above copyright-
16 * notice, this list of conditions and the following disclaimer in-
17 * the documentation and/or other materials provided with the-
18 * distribution.-
19 *-
20 * 3. All advertising materials mentioning features or use of this-
21 * software must display the following acknowledgment:-
22 * "This product includes software developed by the OpenSSL Project-
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"-
24 *-
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to-
26 * endorse or promote products derived from this software without-
27 * prior written permission. For written permission, please contact-
28 * licensing@OpenSSL.org.-
29 *-
30 * 5. Products derived from this software may not be called "OpenSSL"-
31 * nor may "OpenSSL" appear in their names without prior written-
32 * permission of the OpenSSL Project.-
33 *-
34 * 6. Redistributions of any form whatsoever must retain the following-
35 * acknowledgment:-
36 * "This product includes software developed by the OpenSSL Project-
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"-
38 *-
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY-
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE-
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR-
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR-
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT-
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;-
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)-
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,-
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)-
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED-
50 * OF THE POSSIBILITY OF SUCH DAMAGE.-
51 * ====================================================================-
52 *-
53 * This product includes cryptographic software written by Eric Young-
54 * (eay@cryptsoft.com). This product includes software written by Tim-
55 * Hudson (tjh@cryptsoft.com).-
56 *-
57 */-
58-
59#include <ctype.h>-
60#include <stdio.h>-
61#include <string.h>-
62-
63#include <openssl/asn1.h>-
64#include <openssl/err.h>-
65#include <openssl/objects.h>-
66-
67static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;-
68static void st_free(ASN1_STRING_TABLE *tbl);-
69static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,-
70 const ASN1_STRING_TABLE * const *b);-
71-
72-
73/* This is the global mask for the mbstring functions: this is use to-
74 * mask out certain types (such as BMPString and UTF8String) because-
75 * certain software (e.g. Netscape) has problems with them.-
76 */-
77-
78static unsigned long global_mask = B_ASN1_UTF8STRING;-
79-
80void-
81ASN1_STRING_set_default_mask(unsigned long mask)-
82{-
83 global_mask = mask;-
84}
never executed: end of block
0
85-
86unsigned long-
87ASN1_STRING_get_default_mask(void)-
88{-
89 return global_mask;
never executed: return global_mask;
0
90}-
91-
92/* This function sets the default to various "flavours" of configuration.-
93 * based on an ASCII string. Currently this is:-
94 * MASK:XXXX : a numerical mask value.-
95 * nobmp : Don't use BMPStrings (just Printable, T61).-
96 * pkix : PKIX recommendation in RFC2459.-
97 * utf8only : only use UTF8Strings (RFC2459 recommendation for 2004).-
98 * default: the default value, Printable, T61, BMP.-
99 */-
100-
101int-
102ASN1_STRING_set_default_mask_asc(const char *p)-
103{-
104 unsigned long mask;-
105 char *end;-
106-
107 if (!strncmp(p, "MASK:", 5)) {
never executed: __result = (((const unsigned char *) (const char *) ( p ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "MASK:" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
! (__extension...MASK:" , 5 )))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( 5 )Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( p )Description
TRUEnever evaluated
FALSEnever evaluated
strlen ( p ) <...size_t) ( 5 ))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_cons..._p ( "MASK:" )Description
TRUEnever evaluated
FALSEnever evaluated
strlen ( "MASK...size_t) ( 5 ))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
108 if (!p[5])
!p[5]Description
TRUEnever evaluated
FALSEnever evaluated
0
109 return 0;
never executed: return 0;
0
110 mask = strtoul(p + 5, &end, 0);-
111 if (*end)
*endDescription
TRUEnever evaluated
FALSEnever evaluated
0
112 return 0;
never executed: return 0;
0
113 } else if (!strcmp(p, "nombstr"))
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( p ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "nombstr" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
! __extension_...bstr" )))); })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
114 mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING));
never executed: mask = ~((unsigned long)(0x0800|0x2000));
0
115 else if (!strcmp(p, "pkix"))
never executed: __result = (((const unsigned char *) (const char *) ( p ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "pkix" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
! __extension_...pkix" )))); })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
116 mask = ~((unsigned long)B_ASN1_T61STRING);
never executed: mask = ~((unsigned long)0x0004);
0
117 else if (!strcmp(p, "utf8only"))
never executed: __result = (((const unsigned char *) (const char *) ( p ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "utf8only" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
! __extension_...only" )))); })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
118 mask = B_ASN1_UTF8STRING;
never executed: mask = 0x2000;
0
119 else if (!strcmp(p, "default"))
never executed: __result = (((const unsigned char *) (const char *) ( p ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "default" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
! __extension_...ault" )))); })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
120 mask = 0xFFFFFFFFL;
never executed: mask = 0xFFFFFFFFL;
0
121 else-
122 return 0;
never executed: return 0;
0
123 ASN1_STRING_set_default_mask(mask);-
124 return 1;
never executed: return 1;
0
125}-
126-
127/* The following function generates an ASN1_STRING based on limits in a table.-
128 * Frequently the types and length of an ASN1_STRING are restricted by a-
129 * corresponding OID. For example certificates and certificate requests.-
130 */-
131-
132ASN1_STRING *-
133ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in, int inlen,-
134 int inform, int nid)-
135{-
136 ASN1_STRING_TABLE *tbl;-
137 ASN1_STRING *str = NULL;-
138 unsigned long mask;-
139 int ret;-
140 if (!out)
!outDescription
TRUEnever evaluated
FALSEevaluated 33 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • verifytest
0-33
141 out = &str;
never executed: out = &str;
0
142 tbl = ASN1_STRING_TABLE_get(nid);-
143 if (tbl) {
tblDescription
TRUEevaluated 33 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • verifytest
FALSEnever evaluated
0-33
144 mask = tbl->mask;-
145 if (!(tbl->flags & STABLE_NO_MASK))
!(tbl->flags & 0x02)Description
TRUEevaluated 31 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • verifytest
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.44.0.1
2-31
146 mask &= global_mask;
executed 31 times by 2 tests: mask &= global_mask;
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
31
147 ret = ASN1_mbstring_ncopy(out, in, inlen, inform, mask,-
148 tbl->minsize, tbl->maxsize);-
149 } else
executed 33 times by 2 tests: end of block
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
33
150 ret = ASN1_mbstring_copy(out, in, inlen, inform,
never executed: ret = ASN1_mbstring_copy(out, in, inlen, inform, (0x0002|0x0004|0x0800|0x2000) & global_mask);
0
151 DIRSTRING_TYPE & global_mask);
never executed: ret = ASN1_mbstring_copy(out, in, inlen, inform, (0x0002|0x0004|0x0800|0x2000) & global_mask);
0
152 if (ret <= 0)
ret <= 0Description
TRUEnever evaluated
FALSEevaluated 33 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • verifytest
0-33
153 return NULL;
never executed: return ((void *)0) ;
0
154 return *out;
executed 33 times by 2 tests: return *out;
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
33
155}-
156-
157/* Now the tables and helper functions for the string table:-
158 */-
159-
160/* size limits: this stuff is taken straight from RFC3280 */-
161-
162#define ub_name 32768-
163#define ub_common_name 64-
164#define ub_locality_name 128-
165#define ub_state_name 128-
166#define ub_organization_name 64-
167#define ub_organization_unit_name 64-
168#define ub_title 64-
169#define ub_email_address 128-
170#define ub_serial_number 64-
171-
172-
173/* This table must be kept in NID order */-
174-
175static const ASN1_STRING_TABLE tbl_standard[] = {-
176 {NID_commonName, 1, ub_common_name, DIRSTRING_TYPE, 0},-
177 {NID_countryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},-
178 {NID_localityName, 1, ub_locality_name, DIRSTRING_TYPE, 0},-
179 {NID_stateOrProvinceName, 1, ub_state_name, DIRSTRING_TYPE, 0},-
180 {NID_organizationName, 1, ub_organization_name, DIRSTRING_TYPE, 0},-
181 {NID_organizationalUnitName, 1, ub_organization_unit_name, DIRSTRING_TYPE, 0},-
182 {NID_pkcs9_emailAddress, 1, ub_email_address, B_ASN1_IA5STRING, STABLE_NO_MASK},-
183 {NID_pkcs9_unstructuredName, 1, -1, PKCS9STRING_TYPE, 0},-
184 {NID_pkcs9_challengePassword, 1, -1, PKCS9STRING_TYPE, 0},-
185 {NID_pkcs9_unstructuredAddress, 1, -1, DIRSTRING_TYPE, 0},-
186 {NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0},-
187 {NID_surname, 1, ub_name, DIRSTRING_TYPE, 0},-
188 {NID_initials, 1, ub_name, DIRSTRING_TYPE, 0},-
189 {NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},-
190 {NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},-
191 {NID_name, 1, ub_name, DIRSTRING_TYPE, 0},-
192 {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},-
193 {NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK},-
194 {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}-
195};-
196-
197static int-
198sk_table_cmp(const ASN1_STRING_TABLE * const *a,-
199 const ASN1_STRING_TABLE * const *b)-
200{-
201 return (*a)->nid - (*b)->nid;
never executed: return (*a)->nid - (*b)->nid;
0
202}-
203-
204static int table_cmp_BSEARCH_CMP_FN(const void *, const void *);-
205static int table_cmp(ASN1_STRING_TABLE const *, ASN1_STRING_TABLE const *);-
206static ASN1_STRING_TABLE *OBJ_bsearch_table(ASN1_STRING_TABLE *key, ASN1_STRING_TABLE const *base, int num);-
207-
208static int-
209table_cmp(const ASN1_STRING_TABLE *a, const ASN1_STRING_TABLE *b)-
210{-
211 return a->nid - b->nid;
executed 157 times by 2 tests: return a->nid - b->nid;
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
157
212}-
213-
214-
215static int-
216table_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)-
217{-
218 ASN1_STRING_TABLE const *a = a_;-
219 ASN1_STRING_TABLE const *b = b_;-
220 return table_cmp(a, b);
executed 157 times by 2 tests: return table_cmp(a, b);
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
157
221}-
222-
223static ASN1_STRING_TABLE *-
224OBJ_bsearch_table(ASN1_STRING_TABLE *key, ASN1_STRING_TABLE const *base, int num)-
225{-
226 return (ASN1_STRING_TABLE *)OBJ_bsearch_(key, base, num, sizeof(ASN1_STRING_TABLE),
executed 33 times by 2 tests: return (ASN1_STRING_TABLE *)OBJ_bsearch_(key, base, num, sizeof(ASN1_STRING_TABLE), table_cmp_BSEARCH_CMP_FN);
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
33
227 table_cmp_BSEARCH_CMP_FN);
executed 33 times by 2 tests: return (ASN1_STRING_TABLE *)OBJ_bsearch_(key, base, num, sizeof(ASN1_STRING_TABLE), table_cmp_BSEARCH_CMP_FN);
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
33
228}-
229-
230ASN1_STRING_TABLE *-
231ASN1_STRING_TABLE_get(int nid)-
232{-
233 int idx;-
234 ASN1_STRING_TABLE *ttmp;-
235 ASN1_STRING_TABLE fnd;-
236-
237 fnd.nid = nid;-
238 ttmp = OBJ_bsearch_table(&fnd, tbl_standard,-
239 sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE));-
240 if (ttmp)
ttmpDescription
TRUEevaluated 33 times by 2 tests
Evaluated by:
  • libcrypto.so.44.0.1
  • verifytest
FALSEnever evaluated
0-33
241 return ttmp;
executed 33 times by 2 tests: return ttmp;
Executed by:
  • libcrypto.so.44.0.1
  • verifytest
33
242 if (!stable)
!stableDescription
TRUEnever evaluated
FALSEnever evaluated
0
243 return NULL;
never executed: return ((void *)0) ;
0
244 idx = sk_ASN1_STRING_TABLE_find(stable, &fnd);-
245 if (idx < 0)
idx < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
246 return NULL;
never executed: return ((void *)0) ;
0
247 return sk_ASN1_STRING_TABLE_value(stable, idx);
never executed: return ((ASN1_STRING_TABLE *)sk_value(((_STACK*) (1 ? (stable) : (struct stack_st_ASN1_STRING_TABLE*)0)), (idx)));
0
248}-
249-
250int-
251ASN1_STRING_TABLE_add(int nid, long minsize, long maxsize, unsigned long mask,-
252 unsigned long flags)-
253{-
254 ASN1_STRING_TABLE *tmp;-
255 char new_nid = 0;-
256-
257 flags &= ~STABLE_FLAGS_MALLOC;-
258 if (!stable)
!stableDescription
TRUEnever evaluated
FALSEnever evaluated
0
259 stable = sk_ASN1_STRING_TABLE_new(sk_table_cmp);
never executed: stable = ((struct stack_st_ASN1_STRING_TABLE *)sk_new(((int (*)(const void *, const void *)) ((1 ? (sk_table_cmp) : (int (*)(const ASN1_STRING_TABLE * const *, const ASN1_STRING_TABLE * const *))0)))));
0
260 if (!stable) {
!stableDescription
TRUEnever evaluated
FALSEnever evaluated
0
261 ASN1error(ERR_R_MALLOC_FAILURE);-
262 return 0;
never executed: return 0;
0
263 }-
264 if (!(tmp = ASN1_STRING_TABLE_get(nid))) {
!(tmp = ASN1_S...ABLE_get(nid))Description
TRUEnever evaluated
FALSEnever evaluated
0
265 tmp = malloc(sizeof(ASN1_STRING_TABLE));-
266 if (!tmp) {
!tmpDescription
TRUEnever evaluated
FALSEnever evaluated
0
267 ASN1error(ERR_R_MALLOC_FAILURE);-
268 return 0;
never executed: return 0;
0
269 }-
270 tmp->flags = flags | STABLE_FLAGS_MALLOC;-
271 tmp->nid = nid;-
272 new_nid = 1;-
273 } else tmp->flags = (tmp->flags & STABLE_FLAGS_MALLOC) | flags;
never executed: end of block
never executed: tmp->flags = (tmp->flags & 0x01) | flags;
0
274 if (minsize != -1)
minsize != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
275 tmp->minsize = minsize;
never executed: tmp->minsize = minsize;
0
276 if (maxsize != -1)
maxsize != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
277 tmp->maxsize = maxsize;
never executed: tmp->maxsize = maxsize;
0
278 tmp->mask = mask;-
279 if (new_nid) {
new_nidDescription
TRUEnever evaluated
FALSEnever evaluated
0
280 if (sk_ASN1_STRING_TABLE_push(stable, tmp) == 0) {
sk_push(((_STA...BLE*)0))) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
281 free(tmp);-
282 ASN1error(ERR_R_MALLOC_FAILURE);-
283 return 0;
never executed: return 0;
0
284 }-
285 }
never executed: end of block
0
286 return 1;
never executed: return 1;
0
287}-
288-
289void-
290ASN1_STRING_TABLE_cleanup(void)-
291{-
292 STACK_OF(ASN1_STRING_TABLE) *tmp;-
293-
294 tmp = stable;-
295 if (!tmp)
!tmpDescription
TRUEnever evaluated
FALSEnever evaluated
0
296 return;
never executed: return;
0
297 stable = NULL;-
298 sk_ASN1_STRING_TABLE_pop_free(tmp, st_free);-
299}
never executed: end of block
0
300-
301static void-
302st_free(ASN1_STRING_TABLE *tbl)-
303{-
304 if (tbl->flags & STABLE_FLAGS_MALLOC)
tbl->flags & 0x01Description
TRUEnever evaluated
FALSEnever evaluated
0
305 free(tbl);
never executed: free(tbl);
0
306}
never executed: end of block
0
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2