MCPcopy Create free account
hub / github.com/apache/httpd / modssl_X509_getBC

Function modssl_X509_getBC

modules/ssl/ssl_util_ssl.c:159–186  ·  view source on GitHub ↗

retrieve basic constraints ingredients */

Source from the content-addressed store, hash-verified

157
158/* retrieve basic constraints ingredients */
159BOOL modssl_X509_getBC(X509 *cert, int *ca, int *pathlen)
160{
161 BASIC_CONSTRAINTS *bc;
162 BIGNUM *bn = NULL;
163 char *cp;
164
165 bc = X509_get_ext_d2i(cert, NID_basic_constraints, NULL, NULL);
166 if (bc == NULL)
167 return FALSE;
168 *ca = bc->ca;
169 *pathlen = -1 /* unlimited */;
170 if (bc->pathlen != NULL) {
171 if ((bn = ASN1_INTEGER_to_BN(bc->pathlen, NULL)) == NULL) {
172 BASIC_CONSTRAINTS_free(bc);
173 return FALSE;
174 }
175 if ((cp = BN_bn2dec(bn)) == NULL) {
176 BN_free(bn);
177 BASIC_CONSTRAINTS_free(bc);
178 return FALSE;
179 }
180 *pathlen = atoi(cp);
181 OPENSSL_free(cp);
182 BN_free(bn);
183 }
184 BASIC_CONSTRAINTS_free(bc);
185 return TRUE;
186}
187
188char *modssl_bio_free_read(apr_pool_t *p, BIO *bio)
189{

Callers 1

ssl_check_public_certFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected