main.c
/* use the parent (id) to walk the tree to the root and
   build a certificate chain from cert->x509 */
use the parent (id) to walk the tree to the root and
build a certificate chain from cert->x509
use the parent ( id ) to walk the tree to the root and build a certificate chain from cert - > x509
static void
build_chain(const struct auth *a, STACK_OF(X509) **chain)
{
	*chain = NULL;
	if (a == NULL)
		return;
	if ((*chain = sk_X509_new_null()) == NULL)
		err(1, "sk_X509_new_null");
	for (; a != NULL; a = a->parent) {
		assert(a->cert->x509 != NULL);
		if (!sk_X509_push(*chain, a->cert->x509))
			errx(1, "sk_X509_push");
	}
}
static void build_chain ( const struct auth * a , STACK_OF ( X509 ) * * chain ) { * chain = NULL ; if ( a == NULL ) return ; if ( ( * chain = sk_X509_new_null ( ) ) == NULL ) err ( 1 , " " ) ; for ( ; a != NULL ; a = a -> parent ) { assert ( a -> cert -> x509 != NULL ) ; if ( ! sk_X509_push ( * chain , a -> cert -> x509 ) ) errx ( 1 , " " ) ; } }
use the parent (id) to walk the tree to the root and
build a certificate chain from cert->x509
use the parent ( id ) to walk the tree to the root and build a certificate chain from cert - > x509