OpenCoverage

v3_pci.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/x509v3/v3_pci.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/*-
2 * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.-
3 *-
4 * Licensed under the OpenSSL license (the "License"). You may not use-
5 * this file except in compliance with the License. You can obtain a copy-
6 * in the file LICENSE in the source distribution or at-
7 * https://www.openssl.org/source/license.html-
8 */-
9-
10/*-
11 * This file is dual-licensed and is also available under the following-
12 * terms:-
13 *-
14 * Copyright (c) 2004 Kungliga Tekniska Högskolan-
15 * (Royal Institute of Technology, Stockholm, Sweden).-
16 * All rights reserved.-
17 *-
18 * Redistribution and use in source and binary forms, with or without-
19 * modification, are permitted provided that the following conditions-
20 * are met:-
21 *-
22 * 1. Redistributions of source code must retain the above copyright-
23 * notice, this list of conditions and the following disclaimer.-
24 *-
25 * 2. Redistributions in binary form must reproduce the above copyright-
26 * notice, this list of conditions and the following disclaimer in the-
27 * documentation and/or other materials provided with the distribution.-
28 *-
29 * 3. Neither the name of the Institute nor the names of its contributors-
30 * may be used to endorse or promote products derived from this software-
31 * without specific prior written permission.-
32 *-
33 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND-
34 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE-
35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE-
36 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE-
37 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL-
38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS-
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)-
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT-
41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY-
42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF-
43 * SUCH DAMAGE.-
44 */-
45-
46#include <stdio.h>-
47#include "internal/cryptlib.h"-
48#include <openssl/conf.h>-
49#include <openssl/x509v3.h>-
50#include "ext_dat.h"-
51-
52static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,-
53 BIO *out, int indent);-
54static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,-
55 X509V3_CTX *ctx, char *str);-
56-
57const X509V3_EXT_METHOD v3_pci =-
58 { NID_proxyCertInfo, 0, ASN1_ITEM_ref(PROXY_CERT_INFO_EXTENSION),-
59 0, 0, 0, 0,-
60 0, 0,-
61 NULL, NULL,-
62 (X509V3_EXT_I2R)i2r_pci,-
63 (X509V3_EXT_R2I)r2i_pci,-
64 NULL,-
65};-
66-
67static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *pci,-
68 BIO *out, int indent)-
69{-
70 BIO_printf(out, "%*sPath Length Constraint: ", indent, "");-
71 if (pci->pcPathLengthConstraint)
pci->pcPathLengthConstraintDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
72 i2a_ASN1_INTEGER(out, pci->pcPathLengthConstraint);
never executed: i2a_ASN1_INTEGER(out, pci->pcPathLengthConstraint);
0
73 else-
74 BIO_printf(out, "infinite");
executed 4 times by 1 test: BIO_printf(out, "infinite");
Executed by:
  • libcrypto.so.1.1
4
75 BIO_puts(out, "\n");-
76 BIO_printf(out, "%*sPolicy Language: ", indent, "");-
77 i2a_ASN1_OBJECT(out, pci->proxyPolicy->policyLanguage);-
78 BIO_puts(out, "\n");-
79 if (pci->proxyPolicy->policy && pci->proxyPolicy->policy->data)
pci->proxyPolicy->policyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
pci->proxyPolicy->policy->dataDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2
80 BIO_printf(out, "%*sPolicy Text: %s\n", indent, "",
executed 2 times by 1 test: BIO_printf(out, "%*sPolicy Text: %s\n", indent, "", pci->proxyPolicy->policy->data);
Executed by:
  • libcrypto.so.1.1
2
81 pci->proxyPolicy->policy->data);
executed 2 times by 1 test: BIO_printf(out, "%*sPolicy Text: %s\n", indent, "", pci->proxyPolicy->policy->data);
Executed by:
  • libcrypto.so.1.1
2
82 return 1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4
83}-
84-
85static int process_pci_value(CONF_VALUE *val,-
86 ASN1_OBJECT **language, ASN1_INTEGER **pathlen,-
87 ASN1_OCTET_STRING **policy)-
88{-
89 int free_policy = 0;-
90-
91 if (strcmp(val->name, "language") == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( val->name ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "language" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 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-8
92 if (*language) {
*languageDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
93 X509V3err(X509V3_F_PROCESS_PCI_VALUE,-
94 X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED);-
95 X509V3_conf_err(val);-
96 return 0;
never executed: return 0;
0
97 }-
98 if ((*language = OBJ_txt2obj(val->value, 0)) == NULL) {
(*language = O...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
99 X509V3err(X509V3_F_PROCESS_PCI_VALUE,-
100 X509V3_R_INVALID_OBJECT_IDENTIFIER);-
101 X509V3_conf_err(val);-
102 return 0;
never executed: return 0;
0
103 }-
104 } else if (strcmp(val->name, "pathlen") == 0) {
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
never executed: __result = (((const unsigned char *) (const char *) ( val->name ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "pathlen" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__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-4
105 if (*pathlen) {
*pathlenDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
106 X509V3err(X509V3_F_PROCESS_PCI_VALUE,-
107 X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED);-
108 X509V3_conf_err(val);-
109 return 0;
never executed: return 0;
0
110 }-
111 if (!X509V3_get_value_int(val, pathlen)) {
!X509V3_get_va...(val, pathlen)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
112 X509V3err(X509V3_F_PROCESS_PCI_VALUE,-
113 X509V3_R_POLICY_PATH_LENGTH);-
114 X509V3_conf_err(val);-
115 return 0;
never executed: return 0;
0
116 }-
117 } else if (strcmp(val->name, "policy") == 0) {
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
never executed: __result = (((const unsigned char *) (const char *) ( val->name ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "policy" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
__extension__ ... )))); }) == 0Description
TRUEevaluated 4 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-4
118 unsigned char *tmp_data = NULL;-
119 long val_len;-
120 if (!*policy) {
!*policyDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4
121 *policy = ASN1_OCTET_STRING_new();-
122 if (*policy == NULL) {
*policy == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
123 X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE);-
124 X509V3_conf_err(val);-
125 return 0;
never executed: return 0;
0
126 }-
127 free_policy = 1;-
128 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
129 if (strncmp(val->value, "hex:", 4) == 0) {
never executed: __result = (((const unsigned char *) (const char *) ( val->value ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "hex:" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
(__extension__..." , 4 ))) == 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__builtin_constant_p ( 4 )Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__builtin_cons...( val->value )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
strlen ( val->...size_t) ( 4 ))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_cons...t_p ( "hex:" )Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
strlen ( "hex:...size_t) ( 4 ))Description
TRUEnever evaluated
FALSEevaluated 4 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-4
130 unsigned char *tmp_data2 =-
131 OPENSSL_hexstr2buf(val->value + 4, &val_len);-
132-
133 if (!tmp_data2) {
!tmp_data2Description
TRUEnever evaluated
FALSEnever evaluated
0
134 X509V3_conf_err(val);-
135 goto err;
never executed: goto err;
0
136 }-
137-
138 tmp_data = OPENSSL_realloc((*policy)->data,-
139 (*policy)->length + val_len + 1);-
140 if (tmp_data) {
tmp_dataDescription
TRUEnever evaluated
FALSEnever evaluated
0
141 (*policy)->data = tmp_data;-
142 memcpy(&(*policy)->data[(*policy)->length],-
143 tmp_data2, val_len);-
144 (*policy)->length += val_len;-
145 (*policy)->data[(*policy)->length] = '\0';-
146 } else {
never executed: end of block
0
147 OPENSSL_free(tmp_data2);-
148 /*-
149 * realloc failure implies the original data space is b0rked-
150 * too!-
151 */-
152 OPENSSL_free((*policy)->data);-
153 (*policy)->data = NULL;-
154 (*policy)->length = 0;-
155 X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE);-
156 X509V3_conf_err(val);-
157 goto err;
never executed: goto err;
0
158 }-
159 OPENSSL_free(tmp_data2);-
160 } else if (strncmp(val->value, "file:", 5) == 0) {
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( val->value ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "file:" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
(__extension__..." , 5 ))) == 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
__builtin_constant_p ( 5 )Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__builtin_cons...( val->value )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
strlen ( val->...size_t) ( 5 ))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_cons..._p ( "file:" )Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
strlen ( "file...size_t) ( 5 ))Description
TRUEnever evaluated
FALSEevaluated 4 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-4
161 unsigned char buf[2048];-
162 int n;-
163 BIO *b = BIO_new_file(val->value + 5, "r");-
164 if (!b) {
!bDescription
TRUEnever evaluated
FALSEnever evaluated
0
165 X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_BIO_LIB);-
166 X509V3_conf_err(val);-
167 goto err;
never executed: goto err;
0
168 }-
169 while ((n = BIO_read(b, buf, sizeof(buf))) > 0
(n = BIO_read(...eof(buf))) > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
170 || (n == 0 && BIO_should_retry(b))) {
n == 0Description
TRUEnever evaluated
FALSEnever evaluated
BIO_test_flags(b, 0x08)Description
TRUEnever evaluated
FALSEnever evaluated
0
171 if (!n)
!nDescription
TRUEnever evaluated
FALSEnever evaluated
0
172 continue;
never executed: continue;
0
173-
174 tmp_data = OPENSSL_realloc((*policy)->data,-
175 (*policy)->length + n + 1);-
176-
177 if (!tmp_data) {
!tmp_dataDescription
TRUEnever evaluated
FALSEnever evaluated
0
178 OPENSSL_free((*policy)->data);-
179 (*policy)->data = NULL;-
180 (*policy)->length = 0;-
181 X509V3err(X509V3_F_PROCESS_PCI_VALUE,-
182 ERR_R_MALLOC_FAILURE);-
183 X509V3_conf_err(val);-
184 BIO_free_all(b);-
185 goto err;
never executed: goto err;
0
186 }-
187-
188 (*policy)->data = tmp_data;-
189 memcpy(&(*policy)->data[(*policy)->length], buf, n);-
190 (*policy)->length += n;-
191 (*policy)->data[(*policy)->length] = '\0';-
192 }
never executed: end of block
0
193 BIO_free_all(b);-
194-
195 if (n < 0) {
n < 0Description
TRUEnever evaluated
FALSEnever evaluated
0
196 X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_BIO_LIB);-
197 X509V3_conf_err(val);-
198 goto err;
never executed: goto err;
0
199 }-
200 } else if (strncmp(val->value, "text:", 5) == 0) {
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( val->value ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
never executed: __result = (((const unsigned char *) (const char *) ( "text:" ))[3] - __s2[3]);
never executed: end of block
never executed: end of block
(__extension__..." , 5 ))) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__builtin_constant_p ( 5 )Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
__builtin_cons...( val->value )Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
strlen ( val->...size_t) ( 5 ))Description
TRUEnever evaluated
FALSEnever evaluated
__builtin_cons..._p ( "text:" )Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
strlen ( "text...size_t) ( 5 ))Description
TRUEnever evaluated
FALSEevaluated 4 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-4
201 val_len = strlen(val->value + 5);-
202 tmp_data = OPENSSL_realloc((*policy)->data,-
203 (*policy)->length + val_len + 1);-
204 if (tmp_data) {
tmp_dataDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-4
205 (*policy)->data = tmp_data;-
206 memcpy(&(*policy)->data[(*policy)->length],-
207 val->value + 5, val_len);-
208 (*policy)->length += val_len;-
209 (*policy)->data[(*policy)->length] = '\0';-
210 } else {
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
211 /*-
212 * realloc failure implies the original data space is b0rked-
213 * too!-
214 */-
215 OPENSSL_free((*policy)->data);-
216 (*policy)->data = NULL;-
217 (*policy)->length = 0;-
218 X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE);-
219 X509V3_conf_err(val);-
220 goto err;
never executed: goto err;
0
221 }-
222 } else {-
223 X509V3err(X509V3_F_PROCESS_PCI_VALUE,-
224 X509V3_R_INCORRECT_POLICY_SYNTAX_TAG);-
225 X509V3_conf_err(val);-
226 goto err;
never executed: goto err;
0
227 }-
228 if (!tmp_data) {
!tmp_dataDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
229 X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE);-
230 X509V3_conf_err(val);-
231 goto err;
never executed: goto err;
0
232 }-
233 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
234 return 1;
executed 12 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
12
235 err:-
236 if (free_policy) {
free_policyDescription
TRUEnever evaluated
FALSEnever evaluated
0
237 ASN1_OCTET_STRING_free(*policy);-
238 *policy = NULL;-
239 }
never executed: end of block
0
240 return 0;
never executed: return 0;
0
241}-
242-
243static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,-
244 X509V3_CTX *ctx, char *value)-
245{-
246 PROXY_CERT_INFO_EXTENSION *pci = NULL;-
247 STACK_OF(CONF_VALUE) *vals;-
248 ASN1_OBJECT *language = NULL;-
249 ASN1_INTEGER *pathlen = NULL;-
250 ASN1_OCTET_STRING *policy = NULL;-
251 int i, j;-
252-
253 vals = X509V3_parse_list(value);-
254 for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
i < sk_CONF_VALUE_num(vals)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-8
255 CONF_VALUE *cnf = sk_CONF_VALUE_value(vals, i);-
256 if (!cnf->name || (*cnf->name != '@' && !cnf->value)) {
!cnf->nameDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
*cnf->name != '@'Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
!cnf->valueDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
257 X509V3err(X509V3_F_R2I_PCI,-
258 X509V3_R_INVALID_PROXY_POLICY_SETTING);-
259 X509V3_conf_err(cnf);-
260 goto err;
never executed: goto err;
0
261 }-
262 if (*cnf->name == '@') {
*cnf->name == '@'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
2-6
263 STACK_OF(CONF_VALUE) *sect;-
264 int success_p = 1;-
265-
266 sect = X509V3_get_section(ctx, cnf->name + 1);-
267 if (!sect) {
!sectDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
268 X509V3err(X509V3_F_R2I_PCI, X509V3_R_INVALID_SECTION);-
269 X509V3_conf_err(cnf);-
270 goto err;
never executed: goto err;
0
271 }-
272 for (j = 0; success_p && j < sk_CONF_VALUE_num(sect); j++) {
success_pDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
j < sk_CONF_VALUE_num(sect)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
273 success_p =-
274 process_pci_value(sk_CONF_VALUE_value(sect, j),-
275 &language, &pathlen, &policy);-
276 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6
277 X509V3_section_free(ctx, sect);-
278 if (!success_p)
!success_pDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
279 goto err;
never executed: goto err;
0
280 } else {
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
281 if (!process_pci_value(cnf, &language, &pathlen, &policy)) {
!process_pci_v...hlen, &policy)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-6
282 X509V3_conf_err(cnf);-
283 goto err;
never executed: goto err;
0
284 }-
285 }
executed 6 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
6
286 }-
287-
288 /* Language is mandatory */-
289 if (!language) {
!languageDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
290 X509V3err(X509V3_F_R2I_PCI,-
291 X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED);-
292 goto err;
never executed: goto err;
0
293 }-
294 i = OBJ_obj2nid(language);-
295 if ((i == NID_Independent || i == NID_id_ppl_inheritAll) && policy) {
i == 667Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
i == 665Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
policyDescription
TRUEnever evaluated
FALSEnever evaluated
0-4
296 X509V3err(X509V3_F_R2I_PCI,-
297 X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY);-
298 goto err;
never executed: goto err;
0
299 }-
300-
301 pci = PROXY_CERT_INFO_EXTENSION_new();-
302 if (pci == NULL) {
pci == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
303 X509V3err(X509V3_F_R2I_PCI, ERR_R_MALLOC_FAILURE);-
304 goto err;
never executed: goto err;
0
305 }-
306-
307 pci->proxyPolicy->policyLanguage = language;-
308 language = NULL;-
309 pci->proxyPolicy->policy = policy;-
310 policy = NULL;-
311 pci->pcPathLengthConstraint = pathlen;-
312 pathlen = NULL;-
313 goto end;
executed 4 times by 1 test: goto end;
Executed by:
  • libcrypto.so.1.1
4
314 err:-
315 ASN1_OBJECT_free(language);-
316 ASN1_INTEGER_free(pathlen);-
317 pathlen = NULL;-
318 ASN1_OCTET_STRING_free(policy);-
319 policy = NULL;-
320 PROXY_CERT_INFO_EXTENSION_free(pci);-
321 pci = NULL;-
322 end:
code before this statement never executed: end:
0
323 sk_CONF_VALUE_pop_free(vals, X509V3_conf_free);-
324 return pci;
executed 4 times by 1 test: return pci;
Executed by:
  • libcrypto.so.1.1
4
325}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.2