OpenCoverage

v3_utl.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509v3/v3_utl.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/*-
2 * Copyright 1999-2017 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/* X509 v3 extension utilities */-
11-
12#include "e_os.h"-
13#include "internal/cryptlib.h"-
14#include <stdio.h>-
15#include "internal/ctype.h"-
16#include <openssl/conf.h>-
17#include <openssl/crypto.h>-
18#include <openssl/x509v3.h>-
19#include "internal/x509_int.h"-
20#include <openssl/bn.h>-
21#include "ext_dat.h"-
22-
23static char *strip_spaces(char *name);-
24static int sk_strcmp(const char *const *a, const char *const *b);-
25static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name,-
26 GENERAL_NAMES *gens);-
27static void str_free(OPENSSL_STRING str);-
28static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, const ASN1_IA5STRING *email);-
29-
30static int ipv4_from_asc(unsigned char *v4, const char *in);-
31static int ipv6_from_asc(unsigned char *v6, const char *in);-
32static int ipv6_cb(const char *elem, int len, void *usr);-
33static int ipv6_hex(unsigned char *out, const char *in, int inlen);-
34-
35/* Add a CONF_VALUE name value pair to stack */-
36-
37int X509V3_add_value(const char *name, const char *value,-
38 STACK_OF(CONF_VALUE) **extlist)-
39{-
40 CONF_VALUE *vtmp = NULL;-
41 char *tname = NULL, *tvalue = NULL;-
42 int sk_allocated = (*extlist == NULL);-
43-
44 if (name && (tname = OPENSSL_strdup(name)) == NULL)
nameDescription
TRUEevaluated 13931 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2367 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(tname = CRYPT...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 13931 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-13931
45 goto err;
never executed: goto err;
0
46 if (value && (tvalue = OPENSSL_strdup(value)) == NULL)
valueDescription
TRUEevaluated 12992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3306 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(tvalue = CRYP...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 12992 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-12992
47 goto err;
never executed: goto err;
0
48 if ((vtmp = OPENSSL_malloc(sizeof(*vtmp))) == NULL)
(vtmp = CRYPTO...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 16298 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16298
49 goto err;
never executed: goto err;
0
50 if (sk_allocated && (*extlist = sk_CONF_VALUE_new_null()) == NULL)
sk_allocatedDescription
TRUEevaluated 8129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8169 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(*extlist = sk...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8129 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8169
51 goto err;
never executed: goto err;
0
52 vtmp->section = NULL;-
53 vtmp->name = tname;-
54 vtmp->value = tvalue;-
55 if (!sk_CONF_VALUE_push(*extlist, vtmp))
!sk_CONF_VALUE...extlist, vtmp)Description
TRUEnever evaluated
FALSEevaluated 16298 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16298
56 goto err;
never executed: goto err;
0
57 return 1;
executed 16298 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
16298
58 err:-
59 X509V3err(X509V3_F_X509V3_ADD_VALUE, ERR_R_MALLOC_FAILURE);-
60 if (sk_allocated) {
sk_allocatedDescription
TRUEnever evaluated
FALSEnever evaluated
0
61 sk_CONF_VALUE_free(*extlist);-
62 *extlist = NULL;-
63 }
never executed: end of block
0
64 OPENSSL_free(vtmp);-
65 OPENSSL_free(tname);-
66 OPENSSL_free(tvalue);-
67 return 0;
never executed: return 0;
0
68}-
69-
70int X509V3_add_value_uchar(const char *name, const unsigned char *value,-
71 STACK_OF(CONF_VALUE) **extlist)-
72{-
73 return X509V3_add_value(name, (const char *)value, extlist);
executed 3611 times by 1 test: return X509V3_add_value(name, (const char *)value, extlist);
Executed by:
  • libcrypto.so.1.1
3611
74}-
75-
76/* Free function for STACK_OF(CONF_VALUE) */-
77-
78void X509V3_conf_free(CONF_VALUE *conf)-
79{-
80 if (!conf)
!confDescription
TRUEnever evaluated
FALSEevaluated 16298 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-16298
81 return;
never executed: return;
0
82 OPENSSL_free(conf->name);-
83 OPENSSL_free(conf->value);-
84 OPENSSL_free(conf->section);-
85 OPENSSL_free(conf);-
86}
executed 16298 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
16298
87-
88int X509V3_add_value_bool(const char *name, int asn1_bool,-
89 STACK_OF(CONF_VALUE) **extlist)-
90{-
91 if (asn1_bool)
asn1_boolDescription
TRUEevaluated 267 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 498 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
267-498
92 return X509V3_add_value(name, "TRUE", extlist);
executed 267 times by 1 test: return X509V3_add_value(name, "TRUE", extlist);
Executed by:
  • libcrypto.so.1.1
267
93 return X509V3_add_value(name, "FALSE", extlist);
executed 498 times by 1 test: return X509V3_add_value(name, "FALSE", extlist);
Executed by:
  • libcrypto.so.1.1
498
94}-
95-
96int X509V3_add_value_bool_nf(const char *name, int asn1_bool,-
97 STACK_OF(CONF_VALUE) **extlist)-
98{-
99 if (asn1_bool)
asn1_boolDescription
TRUEnever evaluated
FALSEnever evaluated
0
100 return X509V3_add_value(name, "TRUE", extlist);
never executed: return X509V3_add_value(name, "TRUE", extlist);
0
101 return 1;
never executed: return 1;
0
102}-
103-
104static char *bignum_to_string(const BIGNUM *bn)-
105{-
106 char *tmp, *ret;-
107 size_t len;-
108-
109 /*-
110 * Display large numbers in hex and small numbers in decimal. Converting to-
111 * decimal takes quadratic time and is no more useful than hex for large-
112 * numbers.-
113 */-
114 if (BN_num_bits(bn) < 128)
BN_num_bits(bn) < 128Description
TRUEevaluated 9477 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1502 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1502-9477
115 return BN_bn2dec(bn);
executed 9477 times by 1 test: return BN_bn2dec(bn);
Executed by:
  • libcrypto.so.1.1
9477
116-
117 tmp = BN_bn2hex(bn);-
118 if (tmp == NULL)
tmp == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1502 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1502
119 return NULL;
never executed: return ((void *)0) ;
0
120-
121 len = strlen(tmp) + 3;-
122 ret = OPENSSL_malloc(len);-
123 if (ret == NULL) {
ret == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1502 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1502
124 X509V3err(X509V3_F_BIGNUM_TO_STRING, ERR_R_MALLOC_FAILURE);-
125 OPENSSL_free(tmp);-
126 return NULL;
never executed: return ((void *)0) ;
0
127 }-
128-
129 /* Prepend "0x", but place it after the "-" if negative. */-
130 if (tmp[0] == '-') {
tmp[0] == '-'Description
TRUEevaluated 634 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 868 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
634-868
131 OPENSSL_strlcpy(ret, "-0x", len);-
132 OPENSSL_strlcat(ret, tmp + 1, len);-
133 } else {
executed 634 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
634
134 OPENSSL_strlcpy(ret, "0x", len);-
135 OPENSSL_strlcat(ret, tmp, len);-
136 }
executed 868 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
868
137 OPENSSL_free(tmp);-
138 return ret;
executed 1502 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
1502
139}-
140-
141char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a)-
142{-
143 BIGNUM *bntmp = NULL;-
144 char *strtmp = NULL;-
145-
146 if (!a)
!aDescription
TRUEnever evaluated
FALSEevaluated 1872 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1872
147 return NULL;
never executed: return ((void *)0) ;
0
148 if ((bntmp = ASN1_ENUMERATED_to_BN(a, NULL)) == NULL
(bntmp = ASN1_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1872 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1872
149 || (strtmp = bignum_to_string(bntmp)) == NULL)
(strtmp = bign...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 1872 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-1872
150 X509V3err(X509V3_F_I2S_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE);
never executed: ERR_put_error(34,(121),((1|64)),__FILE__,150);
0
151 BN_free(bntmp);-
152 return strtmp;
executed 1872 times by 1 test: return strtmp;
Executed by:
  • libcrypto.so.1.1
1872
153}-
154-
155char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, const ASN1_INTEGER *a)-
156{-
157 BIGNUM *bntmp = NULL;-
158 char *strtmp = NULL;-
159-
160 if (!a)
!aDescription
TRUEnever evaluated
FALSEevaluated 9145 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9145
161 return NULL;
never executed: return ((void *)0) ;
0
162 if ((bntmp = ASN1_INTEGER_to_BN(a, NULL)) == NULL
(bntmp = ASN1_...== ((void *)0)Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9107 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
38-9107
163 || (strtmp = bignum_to_string(bntmp)) == NULL)
(strtmp = bign...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 9107 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-9107
164 X509V3err(X509V3_F_I2S_ASN1_INTEGER, ERR_R_MALLOC_FAILURE);
executed 38 times by 1 test: ERR_put_error(34,(120),((1|64)),__FILE__,164);
Executed by:
  • libcrypto.so.1.1
38
165 BN_free(bntmp);-
166 return strtmp;
executed 9145 times by 1 test: return strtmp;
Executed by:
  • libcrypto.so.1.1
9145
167}-
168-
169ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value)-
170{-
171 BIGNUM *bn = NULL;-
172 ASN1_INTEGER *aint;-
173 int isneg, ishex;-
174 int ret;-
175 if (value == NULL) {
value == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
176 X509V3err(X509V3_F_S2I_ASN1_INTEGER, X509V3_R_INVALID_NULL_VALUE);-
177 return NULL;
never executed: return ((void *)0) ;
0
178 }-
179 bn = BN_new();-
180 if (bn == NULL) {
bn == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
181 X509V3err(X509V3_F_S2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE);-
182 return NULL;
never executed: return ((void *)0) ;
0
183 }-
184 if (value[0] == '-') {
value[0] == '-'Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
185 value++;-
186 isneg = 1;-
187 } else
never executed: end of block
0
188 isneg = 0;
executed 8 times by 1 test: isneg = 0;
Executed by:
  • libcrypto.so.1.1
8
189-
190 if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
value[0] == '0'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(value[1] == 'x')Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(value[1] == 'X')Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
191 value += 2;-
192 ishex = 1;-
193 } else
never executed: end of block
0
194 ishex = 0;
executed 8 times by 1 test: ishex = 0;
Executed by:
  • libcrypto.so.1.1
8
195-
196 if (ishex)
ishexDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
197 ret = BN_hex2bn(&bn, value);
never executed: ret = BN_hex2bn(&bn, value);
0
198 else-
199 ret = BN_dec2bn(&bn, value);
executed 8 times by 1 test: ret = BN_dec2bn(&bn, value);
Executed by:
  • libcrypto.so.1.1
8
200-
201 if (!ret || value[ret]) {
!retDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
value[ret]Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
202 BN_free(bn);-
203 X509V3err(X509V3_F_S2I_ASN1_INTEGER, X509V3_R_BN_DEC2BN_ERROR);-
204 return NULL;
never executed: return ((void *)0) ;
0
205 }-
206-
207 if (isneg && BN_is_zero(bn))
isnegDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
BN_is_zero(bn)Description
TRUEnever evaluated
FALSEnever evaluated
0-8
208 isneg = 0;
never executed: isneg = 0;
0
209-
210 aint = BN_to_ASN1_INTEGER(bn, NULL);-
211 BN_free(bn);-
212 if (!aint) {
!aintDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
213 X509V3err(X509V3_F_S2I_ASN1_INTEGER,-
214 X509V3_R_BN_TO_ASN1_INTEGER_ERROR);-
215 return NULL;
never executed: return ((void *)0) ;
0
216 }-
217 if (isneg)
isnegDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
218 aint->type |= V_ASN1_NEG;
never executed: aint->type |= 0x100;
0
219 return aint;
executed 8 times by 1 test: return aint;
Executed by:
  • libcrypto.so.1.1
8
220}-
221-
222int X509V3_add_value_int(const char *name, const ASN1_INTEGER *aint,-
223 STACK_OF(CONF_VALUE) **extlist)-
224{-
225 char *strtmp;-
226 int ret;-
227-
228 if (!aint)
!aintDescription
TRUEevaluated 1572 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 439 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
439-1572
229 return 1;
executed 1572 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1572
230 if ((strtmp = i2s_ASN1_INTEGER(NULL, aint)) == NULL)
(strtmp = i2s_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 439 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-439
231 return 0;
never executed: return 0;
0
232 ret = X509V3_add_value(name, strtmp, extlist);-
233 OPENSSL_free(strtmp);-
234 return ret;
executed 439 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
439
235}-
236-
237int X509V3_get_value_bool(const CONF_VALUE *value, int *asn1_bool)-
238{-
239 const char *btmp;-
240-
241 if ((btmp = value->value) == NULL)
(btmp = value-...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-32
242 goto err;
never executed: goto err;
0
243 if (strcmp(btmp, "TRUE") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "TRUE" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-32
244 || strcmp(btmp, "true") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "true" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-20
245 || strcmp(btmp, "Y") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "Y" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-12
246 || strcmp(btmp, "y") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "y" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-12
247 || strcmp(btmp, "YES") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "YES" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-12
248 || strcmp(btmp, "yes") == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "yes" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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
TRUEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__result == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-12
249 *asn1_bool = 0xff;-
250 return 1;
executed 20 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
20
251 }-
252 if (strcmp(btmp, "FALSE") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "FALSE" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-6
253 || strcmp(btmp, "false") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "false" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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-6
254 || strcmp(btmp, "N") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "N" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
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
255 || strcmp(btmp, "n") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "n" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
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
256 || strcmp(btmp, "NO") == 0
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "NO" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
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
257 || strcmp(btmp, "no") == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( btmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "no" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
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
258 *asn1_bool = 0;-
259 return 1;
executed 12 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
12
260 }-
261 err:
code before this statement never executed: err:
0
262 X509V3err(X509V3_F_X509V3_GET_VALUE_BOOL,-
263 X509V3_R_INVALID_BOOLEAN_STRING);-
264 X509V3_conf_err(value);-
265 return 0;
never executed: return 0;
0
266}-
267-
268int X509V3_get_value_int(const CONF_VALUE *value, ASN1_INTEGER **aint)-
269{-
270 ASN1_INTEGER *itmp;-
271-
272 if ((itmp = s2i_ASN1_INTEGER(NULL, value->value)) == NULL) {
(itmp = s2i_AS...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
273 X509V3_conf_err(value);-
274 return 0;
never executed: return 0;
0
275 }-
276 *aint = itmp;-
277 return 1;
executed 8 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
8
278}-
279-
280#define HDR_NAME 1-
281#define HDR_VALUE 2-
282-
283/*-
284 * #define DEBUG-
285 */-
286-
287STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line)-
288{-
289 char *p, *q, c;-
290 char *ntmp, *vtmp;-
291 STACK_OF(CONF_VALUE) *values = NULL;-
292 char *linebuf;-
293 int state;-
294 /* We are going to modify the line so copy it first */-
295 linebuf = OPENSSL_strdup(line);-
296 if (linebuf == NULL) {
linebuf == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 91 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-91
297 X509V3err(X509V3_F_X509V3_PARSE_LIST, ERR_R_MALLOC_FAILURE);-
298 goto err;
never executed: goto err;
0
299 }-
300 state = HDR_NAME;-
301 ntmp = NULL;-
302 /* Go through all characters */-
303 for (p = linebuf, q = linebuf; (c = *p) && (c != '\r') && (c != '\n');
(c = *p)Description
TRUEevaluated 1457 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 91 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(c != '\r')Description
TRUEevaluated 1457 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
(c != '\n')Description
TRUEevaluated 1457 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1457
304 p++) {-
305-
306 switch (state) {-
307 case HDR_NAME:
executed 991 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
991
308 if (c == ':') {
c == ':'Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 909 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
82-909
309 state = HDR_VALUE;-
310 *p = 0;-
311 ntmp = strip_spaces(q);-
312 if (!ntmp) {
!ntmpDescription
TRUEnever evaluated
FALSEevaluated 82 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-82
313 X509V3err(X509V3_F_X509V3_PARSE_LIST,-
314 X509V3_R_INVALID_NULL_NAME);-
315 goto err;
never executed: goto err;
0
316 }-
317 q = p + 1;-
318 } else if (c == ',') {
executed 82 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
c == ','Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 887 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
22-887
319 *p = 0;-
320 ntmp = strip_spaces(q);-
321 q = p + 1;-
322 if (!ntmp) {
!ntmpDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-22
323 X509V3err(X509V3_F_X509V3_PARSE_LIST,-
324 X509V3_R_INVALID_NULL_NAME);-
325 goto err;
never executed: goto err;
0
326 }-
327 X509V3_add_value(ntmp, NULL, &values);-
328 }
executed 22 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
22
329 break;
executed 991 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
991
330-
331 case HDR_VALUE:
executed 466 times by 1 test: case 2:
Executed by:
  • libcrypto.so.1.1
466
332 if (c == ',') {
c == ','Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 438 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
28-438
333 state = HDR_NAME;-
334 *p = 0;-
335 vtmp = strip_spaces(q);-
336 if (!vtmp) {
!vtmpDescription
TRUEnever evaluated
FALSEevaluated 28 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-28
337 X509V3err(X509V3_F_X509V3_PARSE_LIST,-
338 X509V3_R_INVALID_NULL_VALUE);-
339 goto err;
never executed: goto err;
0
340 }-
341 X509V3_add_value(ntmp, vtmp, &values);-
342 ntmp = NULL;-
343 q = p + 1;-
344 }
executed 28 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
28
345-
346 }
executed 466 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
466
347 }
executed 1457 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1457
348-
349 if (state == HDR_VALUE) {
state == 2Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 37 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
37-54
350 vtmp = strip_spaces(q);-
351 if (!vtmp) {
!vtmpDescription
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-54
352 X509V3err(X509V3_F_X509V3_PARSE_LIST,-
353 X509V3_R_INVALID_NULL_VALUE);-
354 goto err;
never executed: goto err;
0
355 }-
356 X509V3_add_value(ntmp, vtmp, &values);-
357 } else {
executed 54 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
54
358 ntmp = strip_spaces(q);-
359 if (!ntmp) {
!ntmpDescription
TRUEnever evaluated
FALSEevaluated 37 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-37
360 X509V3err(X509V3_F_X509V3_PARSE_LIST, X509V3_R_INVALID_NULL_NAME);-
361 goto err;
never executed: goto err;
0
362 }-
363 X509V3_add_value(ntmp, NULL, &values);-
364 }
executed 37 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
37
365 OPENSSL_free(linebuf);-
366 return values;
executed 91 times by 1 test: return values;
Executed by:
  • libcrypto.so.1.1
91
367-
368 err:-
369 OPENSSL_free(linebuf);-
370 sk_CONF_VALUE_pop_free(values, X509V3_conf_free);-
371 return NULL;
never executed: return ((void *)0) ;
0
372-
373}-
374-
375/* Delete leading and trailing spaces from a string */-
376static char *strip_spaces(char *name)-
377{-
378 char *p, *q;-
379 /* Skip over leading spaces */-
380 p = name;-
381 while (*p && ossl_isspace(*p))
*pDescription
TRUEevaluated 237 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
(ossl_ctype_check((*p), 0x8))Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 223 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-237
382 p++;
executed 14 times by 1 test: p++;
Executed by:
  • libcrypto.so.1.1
14
383 if (!*p)
!*pDescription
TRUEnever evaluated
FALSEevaluated 223 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-223
384 return NULL;
never executed: return ((void *)0) ;
0
385 q = p + strlen(p) - 1;-
386 while ((q != p) && ossl_isspace(*q))
(q != p)Description
TRUEevaluated 217 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(ossl_ctype_check((*q), 0x8))Description
TRUEnever evaluated
FALSEevaluated 217 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-217
387 q--;
never executed: q--;
0
388 if (p != q)
p != qDescription
TRUEevaluated 217 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
6-217
389 q[1] = 0;
executed 217 times by 1 test: q[1] = 0;
Executed by:
  • libcrypto.so.1.1
217
390 if (!*p)
!*pDescription
TRUEnever evaluated
FALSEevaluated 223 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-223
391 return NULL;
never executed: return ((void *)0) ;
0
392 return p;
executed 223 times by 1 test: return p;
Executed by:
  • libcrypto.so.1.1
223
393}-
394-
395-
396/*-
397 * V2I name comparison function: returns zero if 'name' matches cmp or cmp.*-
398 */-
399-
400int name_cmp(const char *name, const char *cmp)-
401{-
402 int len, ret;-
403 char c;-
404 len = strlen(cmp);-
405 if ((ret = strncmp(name, cmp, len)))
never executed: __result = (((const unsigned char *) (const char *) ( name ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( cmp ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
(ret = (__exte...mp , len ))) )Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__builtin_constant_p ( len )Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__builtin_constant_p ( name )Description
TRUEnever evaluated
FALSEnever evaluated
strlen ( name ...ze_t) ( len ))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( cmp )Description
TRUEnever evaluated
FALSEnever evaluated
strlen ( cmp )...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-14
406 return ret;
executed 8 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
8
407 c = name[len];-
408 if (!c || (c == '.'))
!cDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
(c == '.')Description
TRUEnever evaluated
FALSEnever evaluated
0-6
409 return 0;
executed 6 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
6
410 return 1;
never executed: return 1;
0
411}-
412-
413static int sk_strcmp(const char *const *a, const char *const *b)-
414{-
415 return strcmp(*a, *b);
never executed: return __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( *a ) && __builtin_constant_p ( *b ) && (__s1_len = __builtin_strlen ( *a ), __s2_len = __builtin_strlen ( *b ), (!((size_t)(const void *)(( *a ) + 1) - (size_t)(const void *)( *a )...ult == 0) { __result = (((const unsigned char *) (const char *) ( *b ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( *b ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp ( *a , *b )))); }) ;
never executed: __result = (((const unsigned char *) (const char *) ( *a ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( *b ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__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
416}-
417-
418STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x)-
419{-
420 GENERAL_NAMES *gens;-
421 STACK_OF(OPENSSL_STRING) *ret;-
422-
423 gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);-
424 ret = get_email(X509_get_subject_name(x), gens);-
425 sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);-
426 return ret;
never executed: return ret;
0
427}-
428-
429STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x)-
430{-
431 AUTHORITY_INFO_ACCESS *info;-
432 STACK_OF(OPENSSL_STRING) *ret = NULL;-
433 int i;-
434-
435 info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL);-
436 if (!info)
!infoDescription
TRUEnever evaluated
FALSEnever evaluated
0
437 return NULL;
never executed: return ((void *)0) ;
0
438 for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) {
i < sk_ACCESS_...TION_num(info)Description
TRUEnever evaluated
FALSEnever evaluated
0
439 ACCESS_DESCRIPTION *ad = sk_ACCESS_DESCRIPTION_value(info, i);-
440 if (OBJ_obj2nid(ad->method) == NID_ad_OCSP) {
OBJ_obj2nid(ad->method) == 178Description
TRUEnever evaluated
FALSEnever evaluated
0
441 if (ad->location->type == GEN_URI) {
ad->location->type == 6Description
TRUEnever evaluated
FALSEnever evaluated
0
442 if (!append_ia5
!append_ia5 (&...rceIdentifier)Description
TRUEnever evaluated
FALSEnever evaluated
0
443 (&ret, ad->location->d.uniformResourceIdentifier))
!append_ia5 (&...rceIdentifier)Description
TRUEnever evaluated
FALSEnever evaluated
0
444 break;
never executed: break;
0
445 }
never executed: end of block
0
446 }
never executed: end of block
0
447 }
never executed: end of block
0
448 AUTHORITY_INFO_ACCESS_free(info);-
449 return ret;
never executed: return ret;
0
450}-
451-
452STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x)-
453{-
454 GENERAL_NAMES *gens;-
455 STACK_OF(X509_EXTENSION) *exts;-
456 STACK_OF(OPENSSL_STRING) *ret;-
457-
458 exts = X509_REQ_get_extensions(x);-
459 gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL);-
460 ret = get_email(X509_REQ_get_subject_name(x), gens);-
461 sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);-
462 sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);-
463 return ret;
never executed: return ret;
0
464}-
465-
466static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name,-
467 GENERAL_NAMES *gens)-
468{-
469 STACK_OF(OPENSSL_STRING) *ret = NULL;-
470 X509_NAME_ENTRY *ne;-
471 const ASN1_IA5STRING *email;-
472 GENERAL_NAME *gen;-
473 int i = -1;-
474-
475 /* Now add any email address(es) to STACK */-
476 /* First supplied X509_NAME */-
477 while ((i = X509_NAME_get_index_by_NID(name,
(i = X509_NAME..., 48, i)) >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
478 NID_pkcs9_emailAddress, i)) >= 0) {
(i = X509_NAME..., 48, i)) >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
479 ne = X509_NAME_get_entry(name, i);-
480 email = X509_NAME_ENTRY_get_data(ne);-
481 if (!append_ia5(&ret, email))
!append_ia5(&ret, email)Description
TRUEnever evaluated
FALSEnever evaluated
0
482 return NULL;
never executed: return ((void *)0) ;
0
483 }
never executed: end of block
0
484 for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
i < sk_GENERAL_NAME_num(gens)Description
TRUEnever evaluated
FALSEnever evaluated
0
485 gen = sk_GENERAL_NAME_value(gens, i);-
486 if (gen->type != GEN_EMAIL)
gen->type != 1Description
TRUEnever evaluated
FALSEnever evaluated
0
487 continue;
never executed: continue;
0
488 if (!append_ia5(&ret, gen->d.ia5))
!append_ia5(&ret, gen->d.ia5)Description
TRUEnever evaluated
FALSEnever evaluated
0
489 return NULL;
never executed: return ((void *)0) ;
0
490 }
never executed: end of block
0
491 return ret;
never executed: return ret;
0
492}-
493-
494static void str_free(OPENSSL_STRING str)-
495{-
496 OPENSSL_free(str);-
497}
never executed: end of block
0
498-
499static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, const ASN1_IA5STRING *email)-
500{-
501 char *emtmp;-
502 /* First some sanity checks */-
503 if (email->type != V_ASN1_IA5STRING)
email->type != 22Description
TRUEnever evaluated
FALSEnever evaluated
0
504 return 1;
never executed: return 1;
0
505 if (!email->data || !email->length)
!email->dataDescription
TRUEnever evaluated
FALSEnever evaluated
!email->lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
506 return 1;
never executed: return 1;
0
507 if (*sk == NULL)
*sk == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
508 *sk = sk_OPENSSL_STRING_new(sk_strcmp);
never executed: *sk = sk_OPENSSL_STRING_new(sk_strcmp);
0
509 if (*sk == NULL)
*sk == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
510 return 0;
never executed: return 0;
0
511 /* Don't add duplicates */-
512 if (sk_OPENSSL_STRING_find(*sk, (char *)email->data) != -1)
sk_OPENSSL_STR...l->data) != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
513 return 1;
never executed: return 1;
0
514 emtmp = OPENSSL_strdup((char *)email->data);-
515 if (emtmp == NULL || !sk_OPENSSL_STRING_push(*sk, emtmp)) {
emtmp == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
!sk_OPENSSL_ST...sh(*sk, emtmp)Description
TRUEnever evaluated
FALSEnever evaluated
0
516 OPENSSL_free(emtmp); /* free on push failure */-
517 X509_email_free(*sk);-
518 *sk = NULL;-
519 return 0;
never executed: return 0;
0
520 }-
521 return 1;
never executed: return 1;
0
522}-
523-
524void X509_email_free(STACK_OF(OPENSSL_STRING) *sk)-
525{-
526 sk_OPENSSL_STRING_pop_free(sk, str_free);-
527}
never executed: end of block
0
528-
529typedef int (*equal_fn) (const unsigned char *pattern, size_t pattern_len,-
530 const unsigned char *subject, size_t subject_len,-
531 unsigned int flags);-
532-
533/* Skip pattern prefix to match "wildcard" subject */-
534static void skip_prefix(const unsigned char **p, size_t *plen,-
535 size_t subject_len,-
536 unsigned int flags)-
537{-
538 const unsigned char *pattern = *p;-
539 size_t pattern_len = *plen;-
540-
541 /*-
542 * If subject starts with a leading '.' followed by more octets, and-
543 * pattern is longer, compare just an equal-length suffix with the-
544 * full subject (starting at the '.'), provided the prefix contains-
545 * no NULs.-
546 */-
547 if ((flags & _X509_CHECK_FLAG_DOT_SUBDOMAINS) == 0)
(flags & 0x8000) == 0Description
TRUEevaluated 38762 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4066 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4066-38762
548 return;
executed 38762 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
38762
549-
550 while (pattern_len > subject_len && *pattern) {
pattern_len > subject_lenDescription
TRUEevaluated 29856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4066 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
*patternDescription
TRUEevaluated 29856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-29856
551 if ((flags & X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS) &&
(flags & 0x10)Description
TRUEnever evaluated
FALSEevaluated 29856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-29856
552 *pattern == '.')
*pattern == '.'Description
TRUEnever evaluated
FALSEnever evaluated
0
553 break;
never executed: break;
0
554 ++pattern;-
555 --pattern_len;-
556 }
executed 29856 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
29856
557-
558 /* Skip if entire prefix acceptable */-
559 if (pattern_len == subject_len) {
pattern_len == subject_lenDescription
TRUEevaluated 3206 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 860 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
860-3206
560 *p = pattern;-
561 *plen = pattern_len;-
562 }
executed 3206 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
3206
563}
executed 4066 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4066
564-
565/* Compare while ASCII ignoring case. */-
566static int equal_nocase(const unsigned char *pattern, size_t pattern_len,-
567 const unsigned char *subject, size_t subject_len,-
568 unsigned int flags)-
569{-
570 skip_prefix(&pattern, &pattern_len, subject_len, flags);-
571 if (pattern_len != subject_len)
pattern_len != subject_lenDescription
TRUEevaluated 34058 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7935-34058
572 return 0;
executed 34058 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
34058
573 while (pattern_len) {
pattern_lenDescription
TRUEevaluated 17693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1328 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1328-17693
574 unsigned char l = *pattern;-
575 unsigned char r = *subject;-
576 /* The pattern must not contain NUL characters. */-
577 if (l == 0)
l == 0Description
TRUEnever evaluated
FALSEevaluated 17693 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-17693
578 return 0;
never executed: return 0;
0
579 if (l != r) {
l != rDescription
TRUEevaluated 7247 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10446 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7247-10446
580 if ('A' <= l && l <= 'Z')
'A' <= lDescription
TRUEevaluated 4830 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2417 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
l <= 'Z'Description
TRUEevaluated 360 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4470 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
360-4830
581 l = (l - 'A') + 'a';
executed 360 times by 1 test: l = (l - 'A') + 'a';
Executed by:
  • libcrypto.so.1.1
360
582 if ('A' <= r && r <= 'Z')
'A' <= rDescription
TRUEevaluated 2144 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
r <= 'Z'Description
TRUEevaluated 320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1824 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
320-5103
583 r = (r - 'A') + 'a';
executed 320 times by 1 test: r = (r - 'A') + 'a';
Executed by:
  • libcrypto.so.1.1
320
584 if (l != r)
l != rDescription
TRUEevaluated 6607 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 640 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
640-6607
585 return 0;
executed 6607 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
6607
586 }
executed 640 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
640
587 ++pattern;-
588 ++subject;-
589 --pattern_len;-
590 }
executed 11086 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
11086
591 return 1;
executed 1328 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1328
592}-
593-
594/* Compare using memcmp. */-
595static int equal_case(const unsigned char *pattern, size_t pattern_len,-
596 const unsigned char *subject, size_t subject_len,-
597 unsigned int flags)-
598{-
599 skip_prefix(&pattern, &pattern_len, subject_len, flags);-
600 if (pattern_len != subject_len)
pattern_len != subject_lenDescription
TRUEnever evaluated
FALSEevaluated 835 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-835
601 return 0;
never executed: return 0;
0
602 return !memcmp(pattern, subject, pattern_len);
executed 835 times by 1 test: return !memcmp(pattern, subject, pattern_len);
Executed by:
  • libcrypto.so.1.1
835
603}-
604-
605/*-
606 * RFC 5280, section 7.5, requires that only the domain is compared in a-
607 * case-insensitive manner.-
608 */-
609static int equal_email(const unsigned char *a, size_t a_len,-
610 const unsigned char *b, size_t b_len,-
611 unsigned int unused_flags)-
612{-
613 size_t i = a_len;-
614 if (a_len != b_len)
a_len != b_lenDescription
TRUEevaluated 19106 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1647 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1647-19106
615 return 0;
executed 19106 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
19106
616 /*-
617 * We search backwards for the '@' character, so that we do not have to-
618 * deal with quoted local-parts. The domain part is compared in a-
619 * case-insensitive manner.-
620 */-
621 while (i > 0) {
i > 0Description
TRUEevaluated 8349 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 685 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
685-8349
622 --i;-
623 if (a[i] == '@' || b[i] == '@') {
a[i] == '@'Description
TRUEevaluated 637 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7712 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
b[i] == '@'Description
TRUEevaluated 325 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7387 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
325-7712
624 if (!equal_nocase(a + i, a_len - i, b + i, a_len - i, 0))
!equal_nocase(... a_len - i, 0)Description
TRUEevaluated 812 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 150 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
150-812
625 return 0;
executed 812 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
812
626 break;
executed 150 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
150
627 }-
628 }
executed 7387 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7387
629 if (i == 0)
i == 0Description
TRUEevaluated 700 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 135 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
135-700
630 i = a_len;
executed 700 times by 1 test: i = a_len;
Executed by:
  • libcrypto.so.1.1
700
631 return equal_case(a, i, b, i, 0);
executed 835 times by 1 test: return equal_case(a, i, b, i, 0);
Executed by:
  • libcrypto.so.1.1
835
632}-
633-
634/*-
635 * Compare the prefix and suffix with the subject, and check that the-
636 * characters in-between are valid.-
637 */-
638static int wildcard_match(const unsigned char *prefix, size_t prefix_len,-
639 const unsigned char *suffix, size_t suffix_len,-
640 const unsigned char *subject, size_t subject_len,-
641 unsigned int flags)-
642{-
643 const unsigned char *wildcard_start;-
644 const unsigned char *wildcard_end;-
645 const unsigned char *p;-
646 int allow_multi = 0;-
647 int allow_idna = 0;-
648-
649 if (subject_len < prefix_len + suffix_len)
subject_len < ...n + suffix_lenDescription
TRUEevaluated 935 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 445 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
445-935
650 return 0;
executed 935 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
935
651 if (!equal_nocase(prefix, prefix_len, subject, prefix_len, flags))
!equal_nocase(...ix_len, flags)Description
TRUEnever evaluated
FALSEevaluated 445 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-445
652 return 0;
never executed: return 0;
0
653 wildcard_start = subject + prefix_len;-
654 wildcard_end = subject + (subject_len - suffix_len);-
655 if (!equal_nocase(wildcard_end, suffix_len, suffix, suffix_len, flags))
!equal_nocase(...ix_len, flags)Description
TRUEevaluated 325 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 120 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
120-325
656 return 0;
executed 325 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
325
657 /*-
658 * If the wildcard makes up the entire first label, it must match at-
659 * least one character.-
660 */-
661 if (prefix_len == 0 && *suffix == '.') {
prefix_len == 0Description
TRUEevaluated 120 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
*suffix == '.'Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-120
662 if (wildcard_start == wildcard_end)
wildcard_start == wildcard_endDescription
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
663 return 0;
never executed: return 0;
0
664 allow_idna = 1;-
665 if (flags & X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS)
flags & 0x8Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-100
666 allow_multi = 1;
never executed: allow_multi = 1;
0
667 }
executed 100 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
100
668 /* IDNA labels cannot match partial wildcards */-
669 if (!allow_idna &&
!allow_idnaDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
20-100
670 subject_len >= 4 && strncasecmp((char *)subject, "xn--", 4) == 0)
subject_len >= 4Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
strncasecmp((c...xn--", 4) == 0Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-20
671 return 0;
never executed: return 0;
0
672 /* The wildcard may match a literal '*' */-
673 if (wildcard_end == wildcard_start + 1 && *wildcard_start == '*')
wildcard_end =...card_start + 1Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
*wildcard_start == '*'Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 10 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
10-80
674 return 1;
executed 30 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
30
675 /*-
676 * Check that the part matched by the wildcard contains only-
677 * permitted characters and only matches a single label unless-
678 * allow_multi is set.-
679 */-
680 for (p = wildcard_start; p != wildcard_end; ++p)
p != wildcard_endDescription
TRUEevaluated 310 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 45 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
45-310
681 if (!(('0' <= *p && *p <= '9') ||
'0' <= *pDescription
TRUEevaluated 245 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 65 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
*p <= '9'Description
TRUEnever evaluated
FALSEevaluated 245 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-245
682 ('A' <= *p && *p <= 'Z') ||
'A' <= *pDescription
TRUEevaluated 240 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
*p <= 'Z'Description
TRUEnever evaluated
FALSEevaluated 240 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-240
683 ('a' <= *p && *p <= 'z') ||
'a' <= *pDescription
TRUEevaluated 240 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 70 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
*p <= 'z'Description
TRUEevaluated 240 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-240
684 *p == '-' || (allow_multi && *p == '.')))
*p == '-'Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 45 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
allow_multiDescription
TRUEnever evaluated
FALSEevaluated 45 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
*p == '.'Description
TRUEnever evaluated
FALSEnever evaluated
0-45
685 return 0;
executed 45 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
45
686 return 1;
executed 45 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
45
687}-
688-
689#define LABEL_START (1 << 0)-
690#define LABEL_END (1 << 1)-
691#define LABEL_HYPHEN (1 << 2)-
692#define LABEL_IDNA (1 << 3)-
693-
694static const unsigned char *valid_star(const unsigned char *p, size_t len,-
695 unsigned int flags)-
696{-
697 const unsigned char *star = 0;-
698 size_t i;-
699 int state = LABEL_START;-
700 int dots = 0;-
701 for (i = 0; i < len; ++i) {
i < lenDescription
TRUEevaluated 155130 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8592 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
8592-155130
702 /*-
703 * Locate first and only legal wildcard, either at the start-
704 * or end of a non-IDNA first and not final label.-
705 */-
706 if (p[i] == '*') {
p[i] == '*'Description
TRUEevaluated 4830 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 150300 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4830-150300
707 int atstart = (state & LABEL_START);-
708 int atend = (i == len - 1 || p[i + 1] == '.');
i == len - 1Description
TRUEevaluated 690 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4140 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p[i + 1] == '.'Description
TRUEevaluated 2530 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1610 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
690-4140
709 /*--
710 * At most one wildcard per pattern.-
711 * No wildcards in IDNA labels.-
712 * No wildcards after the first label.-
713 */-
714 if (star != NULL || (state & LABEL_IDNA) != 0 || dots)
star != ((void *)0)Description
TRUEevaluated 460 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4370 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(state & (1 << 3)) != 0Description
TRUEnever evaluated
FALSEevaluated 4370 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dotsDescription
TRUEevaluated 460 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3910 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4370
715 return NULL;
executed 920 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
920
716 /* Only full-label '*.example.com' wildcards? */-
717 if ((flags & X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS)
(flags & 0x4)Description
TRUEnever evaluated
FALSEevaluated 3910 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3910
718 && (!atstart || !atend))
!atstartDescription
TRUEnever evaluated
FALSEnever evaluated
!atendDescription
TRUEnever evaluated
FALSEnever evaluated
0
719 return NULL;
never executed: return ((void *)0) ;
0
720 /* No 'foo*bar' wildcards */-
721 if (!atstart && !atend)
!atstartDescription
TRUEevaluated 230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3680 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!atendDescription
TRUEnever evaluated
FALSEevaluated 230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-3680
722 return NULL;
never executed: return ((void *)0) ;
0
723 star = &p[i];-
724 state &= ~LABEL_START;-
725 } else if (('a' <= p[i] && p[i] <= 'z')
executed 3910 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
'a' <= p[i]Description
TRUEevaluated 121853 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28447 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p[i] <= 'z'Description
TRUEevaluated 121853 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-121853
726 || ('A' <= p[i] && p[i] <= 'Z')
'A' <= p[i]Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 28217 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p[i] <= 'Z'Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-28217
727 || ('0' <= p[i] && p[i] <= '9')) {
'0' <= p[i]Description
TRUEevaluated 2760 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 25457 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p[i] <= '9'Description
TRUEnever evaluated
FALSEevaluated 2760 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-25457
728 if ((state & LABEL_START) != 0
(state & (1 << 0)) != 0Description
TRUEevaluated 25539 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 96544 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
25539-96544
729 && len - i >= 4 && strncasecmp((char *)&p[i], "xn--", 4) == 0)
len - i >= 4Description
TRUEevaluated 17637 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7902 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
strncasecmp((c...xn--", 4) == 0Description
TRUEevaluated 1380 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16257 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1380-17637
730 state |= LABEL_IDNA;
executed 1380 times by 1 test: state |= (1 << 3);
Executed by:
  • libcrypto.so.1.1
1380
731 state &= ~(LABEL_HYPHEN | LABEL_START);-
732 } else if (p[i] == '.') {
executed 122083 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
p[i] == '.'Description
TRUEevaluated 15998 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 12219 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
12219-122083
733 if ((state & (LABEL_HYPHEN | LABEL_START)) != 0)
(state & ((1 <...1 << 0))) != 0Description
TRUEevaluated 1610 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 14388 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1610-14388
734 return NULL;
executed 1610 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
1610
735 state = LABEL_START;-
736 ++dots;-
737 } else if (p[i] == '-') {
executed 14388 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
p[i] == '-'Description
TRUEevaluated 4830 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7389 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4830-14388
738 /* no domain/subdomain starts with '-' */-
739 if ((state & LABEL_START) != 0)
(state & (1 << 0)) != 0Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4600 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
230-4600
740 return NULL;
executed 230 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
230
741 state |= LABEL_HYPHEN;-
742 } else
executed 4600 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4600
743 return NULL;
executed 7389 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
7389
744 }-
745-
746 /*-
747 * The final label must not end in a hyphen or ".", and-
748 * there must be at least two dots after the star.-
749 */-
750 if ((state & (LABEL_START | LABEL_HYPHEN)) != 0 || dots < 2)
(state & ((1 <...1 << 2))) != 0Description
TRUEevaluated 690 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7902 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
dots < 2Description
TRUEevaluated 2336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5566 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
690-7902
751 return NULL;
executed 3026 times by 1 test: return ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
3026
752 return star;
executed 5566 times by 1 test: return star;
Executed by:
  • libcrypto.so.1.1
5566
753}-
754-
755/* Compare using wildcards. */-
756static int equal_wildcard(const unsigned char *pattern, size_t pattern_len,-
757 const unsigned char *subject, size_t subject_len,-
758 unsigned int flags)-
759{-
760 const unsigned char *star = NULL;-
761-
762 /*-
763 * Subject names starting with '.' can only match a wildcard pattern-
764 * via a subject sub-domain pattern suffix match.-
765 */-
766 if (!(subject_len > 1 && subject[0] == '.'))
subject_len > 1Description
TRUEevaluated 18739 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2035 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
subject[0] == '.'Description
TRUEevaluated 2033 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 16706 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2033-18739
767 star = valid_star(pattern, pattern_len, flags);
executed 18741 times by 1 test: star = valid_star(pattern, pattern_len, flags);
Executed by:
  • libcrypto.so.1.1
18741
768 if (star == NULL)
star == ((void *)0)Description
TRUEevaluated 19394 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1380 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
1380-19394
769 return equal_nocase(pattern, pattern_len,
executed 19394 times by 1 test: return equal_nocase(pattern, pattern_len, subject, subject_len, flags);
Executed by:
  • libcrypto.so.1.1
19394
770 subject, subject_len, flags);
executed 19394 times by 1 test: return equal_nocase(pattern, pattern_len, subject, subject_len, flags);
Executed by:
  • libcrypto.so.1.1
19394
771 return wildcard_match(pattern, star - pattern,
executed 1380 times by 1 test: return wildcard_match(pattern, star - pattern, star + 1, (pattern + pattern_len) - star - 1, subject, subject_len, flags);
Executed by:
  • libcrypto.so.1.1
1380
772 star + 1, (pattern + pattern_len) - star - 1,
executed 1380 times by 1 test: return wildcard_match(pattern, star - pattern, star + 1, (pattern + pattern_len) - star - 1, subject, subject_len, flags);
Executed by:
  • libcrypto.so.1.1
1380
773 subject, subject_len, flags);
executed 1380 times by 1 test: return wildcard_match(pattern, star - pattern, star + 1, (pattern + pattern_len) - star - 1, subject, subject_len, flags);
Executed by:
  • libcrypto.so.1.1
1380
774}-
775-
776/*-
777 * Compare an ASN1_STRING to a supplied string. If they match return 1. If-
778 * cmp_type > 0 only compare if string matches the type, otherwise convert it-
779 * to UTF8.-
780 */-
781-
782static int do_check_string(const ASN1_STRING *a, int cmp_type, equal_fn equal,-
783 unsigned int flags, const char *b, size_t blen,-
784 char **peername)-
785{-
786 int rv = 0;-
787-
788 if (!a->data || !a->length)
!a->dataDescription
TRUEnever evaluated
FALSEevaluated 62274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!a->lengthDescription
TRUEnever evaluated
FALSEevaluated 62274 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-62274
789 return 0;
never executed: return 0;
0
790 if (cmp_type > 0) {
cmp_type > 0Description
TRUEevaluated 7839 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 54435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7839-54435
791 if (cmp_type != a->type)
cmp_type != a->typeDescription
TRUEnever evaluated
FALSEevaluated 7839 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-7839
792 return 0;
never executed: return 0;
0
793 if (cmp_type == V_ASN1_IA5STRING)
cmp_type == 22Description
TRUEevaluated 7839 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-7839
794 rv = equal(a->data, a->length, (unsigned char *)b, blen, flags);
executed 7839 times by 1 test: rv = equal(a->data, a->length, (unsigned char *)b, blen, flags);
Executed by:
  • libcrypto.so.1.1
7839
795 else if (a->length == (int)blen && !memcmp(a->data, b, blen))
a->length == (int)blenDescription
TRUEnever evaluated
FALSEnever evaluated
!memcmp(a->data, b, blen)Description
TRUEnever evaluated
FALSEnever evaluated
0
796 rv = 1;
never executed: rv = 1;
0
797 if (rv > 0 && peername)
rv > 0Description
TRUEevaluated 219 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
peernameDescription
TRUEevaluated 33 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 186 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
33-7620
798 *peername = OPENSSL_strndup((char *)a->data, a->length);
executed 33 times by 1 test: *peername = CRYPTO_strndup((char *)a->data, a->length, __FILE__, 798);
Executed by:
  • libcrypto.so.1.1
33
799 } else {
executed 7839 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7839
800 int astrlen;-
801 unsigned char *astr;-
802 astrlen = ASN1_STRING_to_UTF8(&astr, a);-
803 if (astrlen < 0) {
astrlen < 0Description
TRUEnever evaluated
FALSEevaluated 54435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-54435
804 /*-
805 * -1 could be an internal malloc failure or a decoding error from-
806 * malformed input; we can't distinguish.-
807 */-
808 return -1;
never executed: return -1;
0
809 }-
810 rv = equal(astr, astrlen, (unsigned char *)b, blen, flags);-
811 if (rv > 0 && peername)
rv > 0Description
TRUEevaluated 744 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53691 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
peernameDescription
TRUEnever evaluated
FALSEevaluated 744 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-53691
812 *peername = OPENSSL_strndup((char *)astr, astrlen);
never executed: *peername = CRYPTO_strndup((char *)astr, astrlen, __FILE__, 812);
0
813 OPENSSL_free(astr);-
814 }
executed 54435 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
54435
815 return rv;
executed 62274 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
62274
816}-
817-
818static int do_x509_check(X509 *x, const char *chk, size_t chklen,-
819 unsigned int flags, int check_type, char **peername)-
820{-
821 GENERAL_NAMES *gens = NULL;-
822 X509_NAME *name = NULL;-
823 int i;-
824 int cnid = NID_undef;-
825 int alt_type;-
826 int san_present = 0;-
827 int rv = 0;-
828 equal_fn equal;-
829-
830 /* See below, this flag is internal-only */-
831 flags &= ~_X509_CHECK_FLAG_DOT_SUBDOMAINS;-
832 if (check_type == GEN_EMAIL) {
check_type == 1Description
TRUEevaluated 26010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 52056 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
26010-52056
833 cnid = NID_pkcs9_emailAddress;-
834 alt_type = V_ASN1_IA5STRING;-
835 equal = equal_email;-
836 } else if (check_type == GEN_DNS) {
executed 26010 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
check_type == 2Description
TRUEevaluated 52056 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-52056
837 cnid = NID_commonName;-
838 /* Implicit client-side DNS sub-domain pattern */-
839 if (chklen > 1 && chk[0] == '.')
chklen > 1Description
TRUEevaluated 46956 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
chk[0] == '.'Description
TRUEevaluated 5100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 41856 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5100-46956
840 flags |= _X509_CHECK_FLAG_DOT_SUBDOMAINS;
executed 5100 times by 1 test: flags |= 0x8000;
Executed by:
  • libcrypto.so.1.1
5100
841 alt_type = V_ASN1_IA5STRING;-
842 if (flags & X509_CHECK_FLAG_NO_WILDCARDS)
flags & 0x2Description
TRUEevaluated 26010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 26046 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
26010-26046
843 equal = equal_nocase;
executed 26010 times by 1 test: equal = equal_nocase;
Executed by:
  • libcrypto.so.1.1
26010
844 else-
845 equal = equal_wildcard;
executed 26046 times by 1 test: equal = equal_wildcard;
Executed by:
  • libcrypto.so.1.1
26046
846 } else {-
847 alt_type = V_ASN1_OCTET_STRING;-
848 equal = equal_case;-
849 }
never executed: end of block
0
850-
851 if (chklen == 0)
chklen == 0Description
TRUEnever evaluated
FALSEevaluated 78066 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-78066
852 chklen = strlen(chk);
never executed: chklen = strlen(chk);
0
853-
854 gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);-
855 if (gens) {
gensDescription
TRUEevaluated 15642 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 62424 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
15642-62424
856 for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
i < sk_GENERAL_NAME_num(gens)Description
TRUEevaluated 15642 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15423 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
15423-15642
857 GENERAL_NAME *gen;-
858 ASN1_STRING *cstr;-
859 gen = sk_GENERAL_NAME_value(gens, i);-
860 if (gen->type != check_type)
gen->type != check_typeDescription
TRUEevaluated 7803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7839 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
7803-7839
861 continue;
executed 7803 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
7803
862 san_present = 1;-
863 if (check_type == GEN_EMAIL)
check_type == 1Description
TRUEevaluated 2601 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2601-5238
864 cstr = gen->d.rfc822Name;
executed 2601 times by 1 test: cstr = gen->d.rfc822Name;
Executed by:
  • libcrypto.so.1.1
2601
865 else if (check_type == GEN_DNS)
check_type == 2Description
TRUEevaluated 5238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-5238
866 cstr = gen->d.dNSName;
executed 5238 times by 1 test: cstr = gen->d.dNSName;
Executed by:
  • libcrypto.so.1.1
5238
867 else-
868 cstr = gen->d.iPAddress;
never executed: cstr = gen->d.iPAddress;
0
869 /* Positive on success, negative on error! */-
870 if ((rv = do_check_string(cstr, alt_type, equal, flags,
(rv = do_check...eername)) != 0Description
TRUEevaluated 219 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
219-7620
871 chk, chklen, peername)) != 0)
(rv = do_check...eername)) != 0Description
TRUEevaluated 219 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
219-7620
872 break;
executed 219 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
219
873 }
executed 7620 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7620
874 GENERAL_NAMES_free(gens);-
875 if (rv != 0)
rv != 0Description
TRUEevaluated 219 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 15423 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
219-15423
876 return rv;
executed 219 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
219
877 if (san_present && !(flags & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT))
san_presentDescription
TRUEevaluated 7620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 7803 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!(flags & 0x1)Description
TRUEevaluated 7620 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-7803
878 return 0;
executed 7620 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
7620
879 }
executed 7803 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7803
880-
881 /* We're done if CN-ID is not pertinent */-
882 if (cnid == NID_undef || (flags & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT))
cnid == 0Description
TRUEnever evaluated
FALSEevaluated 70227 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
(flags & 0x20)Description
TRUEnever evaluated
FALSEevaluated 70227 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-70227
883 return 0;
never executed: return 0;
0
884-
885 i = -1;-
886 name = X509_get_subject_name(x);-
887 while ((i = X509_NAME_get_index_by_NID(name, cnid, i)) >= 0) {
(i = X509_NAME...cnid, i)) >= 0Description
TRUEevaluated 54435 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 69483 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
54435-69483
888 const X509_NAME_ENTRY *ne = X509_NAME_get_entry(name, i);-
889 const ASN1_STRING *str = X509_NAME_ENTRY_get_data(ne);-
890-
891 /* Positive on success, negative on error! */-
892 if ((rv = do_check_string(str, -1, equal, flags,
(rv = do_check...eername)) != 0Description
TRUEevaluated 744 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53691 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
744-53691
893 chk, chklen, peername)) != 0)
(rv = do_check...eername)) != 0Description
TRUEevaluated 744 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 53691 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
744-53691
894 return rv;
executed 744 times by 1 test: return rv;
Executed by:
  • libcrypto.so.1.1
744
895 }
executed 53691 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
53691
896 return 0;
executed 69483 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
69483
897}-
898-
899int X509_check_host(X509 *x, const char *chk, size_t chklen,-
900 unsigned int flags, char **peername)-
901{-
902 if (chk == NULL)
chk == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 52056 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-52056
903 return -2;
never executed: return -2;
0
904 /*-
905 * Embedded NULs are disallowed, except as the last character of a-
906 * string of length 2 or more (tolerate caller including terminating-
907 * NUL in string length).-
908 */-
909 if (chklen == 0)
chklen == 0Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 52020 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
36-52020
910 chklen = strlen(chk);
executed 36 times by 1 test: chklen = strlen(chk);
Executed by:
  • libcrypto.so.1.1
36
911 else if (memchr(chk, '\0', chklen > 1 ? chklen - 1 : chklen))
memchr(chk, '\... - 1 : chklen)Description
TRUEnever evaluated
FALSEevaluated 52020 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-52020
912 return -2;
never executed: return -2;
0
913 if (chklen > 1 && chk[chklen - 1] == '\0')
chklen > 1Description
TRUEevaluated 46956 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5100 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
chk[chklen - 1] == '\0'Description
TRUEnever evaluated
FALSEevaluated 46956 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-46956
914 --chklen;
never executed: --chklen;
0
915 return do_x509_check(x, chk, chklen, flags, GEN_DNS, peername);
executed 52056 times by 1 test: return do_x509_check(x, chk, chklen, flags, 2, peername);
Executed by:
  • libcrypto.so.1.1
52056
916}-
917-
918int X509_check_email(X509 *x, const char *chk, size_t chklen,-
919 unsigned int flags)-
920{-
921 if (chk == NULL)
chk == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 26010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26010
922 return -2;
never executed: return -2;
0
923 /*-
924 * Embedded NULs are disallowed, except as the last character of a-
925 * string of length 2 or more (tolerate caller including terminating-
926 * NUL in string length).-
927 */-
928 if (chklen == 0)
chklen == 0Description
TRUEnever evaluated
FALSEevaluated 26010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26010
929 chklen = strlen((char *)chk);
never executed: chklen = strlen((char *)chk);
0
930 else if (memchr(chk, '\0', chklen > 1 ? chklen - 1 : chklen))
memchr(chk, '\... - 1 : chklen)Description
TRUEnever evaluated
FALSEevaluated 26010 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-26010
931 return -2;
never executed: return -2;
0
932 if (chklen > 1 && chk[chklen - 1] == '\0')
chklen > 1Description
TRUEevaluated 23460 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2550 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
chk[chklen - 1] == '\0'Description
TRUEnever evaluated
FALSEevaluated 23460 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-23460
933 --chklen;
never executed: --chklen;
0
934 return do_x509_check(x, chk, chklen, flags, GEN_EMAIL, NULL);
executed 26010 times by 1 test: return do_x509_check(x, chk, chklen, flags, 1, ((void *)0) );
Executed by:
  • libcrypto.so.1.1
26010
935}-
936-
937int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,-
938 unsigned int flags)-
939{-
940 if (chk == NULL)
chk == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
941 return -2;
never executed: return -2;
0
942 return do_x509_check(x, (char *)chk, chklen, flags, GEN_IPADD, NULL);
never executed: return do_x509_check(x, (char *)chk, chklen, flags, 7, ((void *)0) );
0
943}-
944-
945int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags)-
946{-
947 unsigned char ipout[16];-
948 size_t iplen;-
949-
950 if (ipasc == NULL)
ipasc == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
951 return -2;
never executed: return -2;
0
952 iplen = (size_t)a2i_ipadd(ipout, ipasc);-
953 if (iplen == 0)
iplen == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
954 return -2;
never executed: return -2;
0
955 return do_x509_check(x, (char *)ipout, iplen, flags, GEN_IPADD, NULL);
never executed: return do_x509_check(x, (char *)ipout, iplen, flags, 7, ((void *)0) );
0
956}-
957-
958/*-
959 * Convert IP addresses both IPv4 and IPv6 into an OCTET STRING compatible-
960 * with RFC3280.-
961 */-
962-
963ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc)-
964{-
965 unsigned char ipout[16];-
966 ASN1_OCTET_STRING *ret;-
967 int iplen;-
968-
969 /* If string contains a ':' assume IPv6 */-
970-
971 iplen = a2i_ipadd(ipout, ipasc);-
972-
973 if (!iplen)
!iplenDescription
TRUEnever evaluated
FALSEnever evaluated
0
974 return NULL;
never executed: return ((void *)0) ;
0
975-
976 ret = ASN1_OCTET_STRING_new();-
977 if (ret == NULL)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
978 return NULL;
never executed: return ((void *)0) ;
0
979 if (!ASN1_OCTET_STRING_set(ret, ipout, iplen)) {
!ASN1_OCTET_ST... ipout, iplen)Description
TRUEnever evaluated
FALSEnever evaluated
0
980 ASN1_OCTET_STRING_free(ret);-
981 return NULL;
never executed: return ((void *)0) ;
0
982 }-
983 return ret;
never executed: return ret;
0
984}-
985-
986ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc)-
987{-
988 ASN1_OCTET_STRING *ret = NULL;-
989 unsigned char ipout[32];-
990 char *iptmp = NULL, *p;-
991 int iplen1, iplen2;-
992 p = strchr(ipasc, '/');
__builtin_constant_p ( '/' )Description
TRUEnever evaluated
FALSEnever evaluated
!__builtin_con...nt_p ( ipasc )Description
TRUEnever evaluated
FALSEnever evaluated
( '/' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
993 if (!p)
!pDescription
TRUEnever evaluated
FALSEnever evaluated
0
994 return NULL;
never executed: return ((void *)0) ;
0
995 iptmp = OPENSSL_strdup(ipasc);-
996 if (!iptmp)
!iptmpDescription
TRUEnever evaluated
FALSEnever evaluated
0
997 return NULL;
never executed: return ((void *)0) ;
0
998 p = iptmp + (p - ipasc);-
999 *p++ = 0;-
1000-
1001 iplen1 = a2i_ipadd(ipout, iptmp);-
1002-
1003 if (!iplen1)
!iplen1Description
TRUEnever evaluated
FALSEnever evaluated
0
1004 goto err;
never executed: goto err;
0
1005-
1006 iplen2 = a2i_ipadd(ipout + iplen1, p);-
1007-
1008 OPENSSL_free(iptmp);-
1009 iptmp = NULL;-
1010-
1011 if (!iplen2 || (iplen1 != iplen2))
!iplen2Description
TRUEnever evaluated
FALSEnever evaluated
(iplen1 != iplen2)Description
TRUEnever evaluated
FALSEnever evaluated
0
1012 goto err;
never executed: goto err;
0
1013-
1014 ret = ASN1_OCTET_STRING_new();-
1015 if (ret == NULL)
ret == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1016 goto err;
never executed: goto err;
0
1017 if (!ASN1_OCTET_STRING_set(ret, ipout, iplen1 + iplen2))
!ASN1_OCTET_ST...len1 + iplen2)Description
TRUEnever evaluated
FALSEnever evaluated
0
1018 goto err;
never executed: goto err;
0
1019-
1020 return ret;
never executed: return ret;
0
1021-
1022 err:-
1023 OPENSSL_free(iptmp);-
1024 ASN1_OCTET_STRING_free(ret);-
1025 return NULL;
never executed: return ((void *)0) ;
0
1026}-
1027-
1028int a2i_ipadd(unsigned char *ipout, const char *ipasc)-
1029{-
1030 /* If string contains a ':' assume IPv6 */-
1031-
1032 if (strchr(ipasc, ':')) {
(__extension__...pasc , ':' )))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_constant_p ( ':' )Description
TRUEnever evaluated
FALSEnever evaluated
!__builtin_con...nt_p ( ipasc )Description
TRUEnever evaluated
FALSEnever evaluated
( ':' ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1033 if (!ipv6_from_asc(ipout, ipasc))
!ipv6_from_asc(ipout, ipasc)Description
TRUEnever evaluated
FALSEnever evaluated
0
1034 return 0;
never executed: return 0;
0
1035 return 16;
never executed: return 16;
0
1036 } else {-
1037 if (!ipv4_from_asc(ipout, ipasc))
!ipv4_from_asc(ipout, ipasc)Description
TRUEnever evaluated
FALSEnever evaluated
0
1038 return 0;
never executed: return 0;
0
1039 return 4;
never executed: return 4;
0
1040 }-
1041}-
1042-
1043static int ipv4_from_asc(unsigned char *v4, const char *in)-
1044{-
1045 int a0, a1, a2, a3;-
1046 if (sscanf(in, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) != 4)
sscanf(in, "%d...&a2, &a3) != 4Description
TRUEnever evaluated
FALSEnever evaluated
0
1047 return 0;
never executed: return 0;
0
1048 if ((a0 < 0) || (a0 > 255) || (a1 < 0) || (a1 > 255)
(a0 < 0)Description
TRUEnever evaluated
FALSEnever evaluated
(a0 > 255)Description
TRUEnever evaluated
FALSEnever evaluated
(a1 < 0)Description
TRUEnever evaluated
FALSEnever evaluated
(a1 > 255)Description
TRUEnever evaluated
FALSEnever evaluated
0
1049 || (a2 < 0) || (a2 > 255) || (a3 < 0) || (a3 > 255))
(a2 < 0)Description
TRUEnever evaluated
FALSEnever evaluated
(a2 > 255)Description
TRUEnever evaluated
FALSEnever evaluated
(a3 < 0)Description
TRUEnever evaluated
FALSEnever evaluated
(a3 > 255)Description
TRUEnever evaluated
FALSEnever evaluated
0
1050 return 0;
never executed: return 0;
0
1051 v4[0] = a0;-
1052 v4[1] = a1;-
1053 v4[2] = a2;-
1054 v4[3] = a3;-
1055 return 1;
never executed: return 1;
0
1056}-
1057-
1058typedef struct {-
1059 /* Temporary store for IPV6 output */-
1060 unsigned char tmp[16];-
1061 /* Total number of bytes in tmp */-
1062 int total;-
1063 /* The position of a zero (corresponding to '::') */-
1064 int zero_pos;-
1065 /* Number of zeroes */-
1066 int zero_cnt;-
1067} IPV6_STAT;-
1068-
1069static int ipv6_from_asc(unsigned char *v6, const char *in)-
1070{-
1071 IPV6_STAT v6stat;-
1072 v6stat.total = 0;-
1073 v6stat.zero_pos = -1;-
1074 v6stat.zero_cnt = 0;-
1075 /*-
1076 * Treat the IPv6 representation as a list of values separated by ':'.-
1077 * The presence of a '::' will parse as one, two or three zero length-
1078 * elements.-
1079 */-
1080 if (!CONF_parse_list(in, ':', 0, ipv6_cb, &v6stat))
!CONF_parse_li...6_cb, &v6stat)Description
TRUEnever evaluated
FALSEnever evaluated
0
1081 return 0;
never executed: return 0;
0
1082-
1083 /* Now for some sanity checks */-
1084-
1085 if (v6stat.zero_pos == -1) {
v6stat.zero_pos == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1086 /* If no '::' must have exactly 16 bytes */-
1087 if (v6stat.total != 16)
v6stat.total != 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1088 return 0;
never executed: return 0;
0
1089 } else {
never executed: end of block
0
1090 /* If '::' must have less than 16 bytes */-
1091 if (v6stat.total == 16)
v6stat.total == 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1092 return 0;
never executed: return 0;
0
1093 /* More than three zeroes is an error */-
1094 if (v6stat.zero_cnt > 3)
v6stat.zero_cnt > 3Description
TRUEnever evaluated
FALSEnever evaluated
0
1095 return 0;
never executed: return 0;
0
1096 /* Can only have three zeroes if nothing else present */-
1097 else if (v6stat.zero_cnt == 3) {
v6stat.zero_cnt == 3Description
TRUEnever evaluated
FALSEnever evaluated
0
1098 if (v6stat.total > 0)
v6stat.total > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1099 return 0;
never executed: return 0;
0
1100 }
never executed: end of block
0
1101 /* Can only have two zeroes if at start or end */-
1102 else if (v6stat.zero_cnt == 2) {
v6stat.zero_cnt == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
1103 if ((v6stat.zero_pos != 0)
(v6stat.zero_pos != 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1104 && (v6stat.zero_pos != v6stat.total))
(v6stat.zero_p... v6stat.total)Description
TRUEnever evaluated
FALSEnever evaluated
0
1105 return 0;
never executed: return 0;
0
1106 } else
never executed: end of block
0
1107 /* Can only have one zero if *not* start or end */-
1108 {-
1109 if ((v6stat.zero_pos == 0)
(v6stat.zero_pos == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1110 || (v6stat.zero_pos == v6stat.total))
(v6stat.zero_p... v6stat.total)Description
TRUEnever evaluated
FALSEnever evaluated
0
1111 return 0;
never executed: return 0;
0
1112 }
never executed: end of block
0
1113 }-
1114-
1115 /* Format result */-
1116-
1117 if (v6stat.zero_pos >= 0) {
v6stat.zero_pos >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1118 /* Copy initial part */-
1119 memcpy(v6, v6stat.tmp, v6stat.zero_pos);-
1120 /* Zero middle */-
1121 memset(v6 + v6stat.zero_pos, 0, 16 - v6stat.total);-
1122 /* Copy final part */-
1123 if (v6stat.total != v6stat.zero_pos)
v6stat.total !...6stat.zero_posDescription
TRUEnever evaluated
FALSEnever evaluated
0
1124 memcpy(v6 + v6stat.zero_pos + 16 - v6stat.total,
never executed: memcpy(v6 + v6stat.zero_pos + 16 - v6stat.total, v6stat.tmp + v6stat.zero_pos, v6stat.total - v6stat.zero_pos);
0
1125 v6stat.tmp + v6stat.zero_pos,
never executed: memcpy(v6 + v6stat.zero_pos + 16 - v6stat.total, v6stat.tmp + v6stat.zero_pos, v6stat.total - v6stat.zero_pos);
0
1126 v6stat.total - v6stat.zero_pos);
never executed: memcpy(v6 + v6stat.zero_pos + 16 - v6stat.total, v6stat.tmp + v6stat.zero_pos, v6stat.total - v6stat.zero_pos);
0
1127 } else
never executed: end of block
0
1128 memcpy(v6, v6stat.tmp, 16);
never executed: memcpy(v6, v6stat.tmp, 16);
0
1129-
1130 return 1;
never executed: return 1;
0
1131}-
1132-
1133static int ipv6_cb(const char *elem, int len, void *usr)-
1134{-
1135 IPV6_STAT *s = usr;-
1136 /* Error if 16 bytes written */-
1137 if (s->total == 16)
s->total == 16Description
TRUEnever evaluated
FALSEnever evaluated
0
1138 return 0;
never executed: return 0;
0
1139 if (len == 0) {
len == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1140 /* Zero length element, corresponds to '::' */-
1141 if (s->zero_pos == -1)
s->zero_pos == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
1142 s->zero_pos = s->total;
never executed: s->zero_pos = s->total;
0
1143 /* If we've already got a :: its an error */-
1144 else if (s->zero_pos != s->total)
s->zero_pos != s->totalDescription
TRUEnever evaluated
FALSEnever evaluated
0
1145 return 0;
never executed: return 0;
0
1146 s->zero_cnt++;-
1147 } else {
never executed: end of block
0
1148 /* If more than 4 characters could be final a.b.c.d form */-
1149 if (len > 4) {
len > 4Description
TRUEnever evaluated
FALSEnever evaluated
0
1150 /* Need at least 4 bytes left */-
1151 if (s->total > 12)
s->total > 12Description
TRUEnever evaluated
FALSEnever evaluated
0
1152 return 0;
never executed: return 0;
0
1153 /* Must be end of string */-
1154 if (elem[len])
elem[len]Description
TRUEnever evaluated
FALSEnever evaluated
0
1155 return 0;
never executed: return 0;
0
1156 if (!ipv4_from_asc(s->tmp + s->total, elem))
!ipv4_from_asc...->total, elem)Description
TRUEnever evaluated
FALSEnever evaluated
0
1157 return 0;
never executed: return 0;
0
1158 s->total += 4;-
1159 } else {
never executed: end of block
0
1160 if (!ipv6_hex(s->tmp + s->total, elem, len))
!ipv6_hex(s->t...al, elem, len)Description
TRUEnever evaluated
FALSEnever evaluated
0
1161 return 0;
never executed: return 0;
0
1162 s->total += 2;-
1163 }
never executed: end of block
0
1164 }-
1165 return 1;
never executed: return 1;
0
1166}-
1167-
1168/*-
1169 * Convert a string of up to 4 hex digits into the corresponding IPv6 form.-
1170 */-
1171-
1172static int ipv6_hex(unsigned char *out, const char *in, int inlen)-
1173{-
1174 unsigned char c;-
1175 unsigned int num = 0;-
1176 int x;-
1177-
1178 if (inlen > 4)
inlen > 4Description
TRUEnever evaluated
FALSEnever evaluated
0
1179 return 0;
never executed: return 0;
0
1180 while (inlen--) {
inlen--Description
TRUEnever evaluated
FALSEnever evaluated
0
1181 c = *in++;-
1182 num <<= 4;-
1183 x = OPENSSL_hexchar2int(c);-
1184 if (x < 0)
x < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1185 return 0;
never executed: return 0;
0
1186 num |= (char)x;-
1187 }
never executed: end of block
0
1188 out[0] = num >> 8;-
1189 out[1] = num & 0xff;-
1190 return 1;
never executed: return 1;
0
1191}-
1192-
1193int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,-
1194 unsigned long chtype)-
1195{-
1196 CONF_VALUE *v;-
1197 int i, mval, spec_char, plus_char;-
1198 char *p, *type;-
1199 if (!nm)
!nmDescription
TRUEnever evaluated
FALSEnever evaluated
0
1200 return 0;
never executed: return 0;
0
1201-
1202 for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) {
i < sk_CONF_VALUE_num(dn_sk)Description
TRUEnever evaluated
FALSEnever evaluated
0
1203 v = sk_CONF_VALUE_value(dn_sk, i);-
1204 type = v->name;-
1205 /*-
1206 * Skip past any leading X. X: X, etc to allow for multiple instances-
1207 */-
1208 for (p = type; *p; p++) {
*pDescription
TRUEnever evaluated
FALSEnever evaluated
0
1209#ifndef CHARSET_EBCDIC-
1210 spec_char = ((*p == ':') || (*p == ',') || (*p == '.'));
(*p == ':')Description
TRUEnever evaluated
FALSEnever evaluated
(*p == ',')Description
TRUEnever evaluated
FALSEnever evaluated
(*p == '.')Description
TRUEnever evaluated
FALSEnever evaluated
0
1211#else-
1212 spec_char = ((*p == os_toascii[':']) || (*p == os_toascii[','])-
1213 || (*p == os_toascii['.']));-
1214#endif-
1215 if (spec_char) {
spec_charDescription
TRUEnever evaluated
FALSEnever evaluated
0
1216 p++;-
1217 if (*p)
*pDescription
TRUEnever evaluated
FALSEnever evaluated
0
1218 type = p;
never executed: type = p;
0
1219 break;
never executed: break;
0
1220 }-
1221 }
never executed: end of block
0
1222#ifndef CHARSET_EBCDIC-
1223 plus_char = (*type == '+');-
1224#else-
1225 plus_char = (*type == os_toascii['+']);-
1226#endif-
1227 if (plus_char) {
plus_charDescription
TRUEnever evaluated
FALSEnever evaluated
0
1228 mval = -1;-
1229 type++;-
1230 } else
never executed: end of block
0
1231 mval = 0;
never executed: mval = 0;
0
1232 if (!X509_NAME_add_entry_by_txt(nm, type, chtype,
!X509_NAME_add... -1, -1, mval)Description
TRUEnever evaluated
FALSEnever evaluated
0
1233 (unsigned char *)v->value, -1, -1,
!X509_NAME_add... -1, -1, mval)Description
TRUEnever evaluated
FALSEnever evaluated
0
1234 mval))
!X509_NAME_add... -1, -1, mval)Description
TRUEnever evaluated
FALSEnever evaluated
0
1235 return 0;
never executed: return 0;
0
1236-
1237 }
never executed: end of block
0
1238 return 1;
never executed: return 1;
0
1239}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2